maps

package
v0.0.0-...-b521294 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucketed

type Bucketed[K constraints.Integer, V any] struct {
	// contains filtered or unexported fields
}

func NewBucketed

func NewBucketed[K constraints.Integer, V any](n int) Bucketed[K, V]

n defaults to 256.

func (Bucketed[K, V]) Add

func (m Bucketed[K, V]) Add(k K, v V) (V, bool)

func (Bucketed[K, V]) Delete

func (m Bucketed[K, V]) Delete(k K) (V, bool)

func (Bucketed[K, V]) Get

func (m Bucketed[K, V]) Get(k K) (V, bool)

type Builtin

type Builtin[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewBuiltin

func NewBuiltin[K comparable, V any]() *Builtin[K, V]

func (*Builtin[K, V]) Add

func (m *Builtin[K, V]) Add(k K, v V) (V, bool)

func (*Builtin[K, V]) Delete

func (m *Builtin[K, V]) Delete(k K) (V, bool)

func (*Builtin[K, V]) Get

func (m *Builtin[K, V]) Get(k K) (V, bool)

type Map

type Map[K, V any] interface {
	Get(K) (_ V, ok bool)

	// Replaces.
	Add(K, V) (_ V, exists bool)

	Delete(K) (_ V, exists bool)
}

Concurrent safe.

type Sync

type Sync[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func (*Sync[K, V]) Add

func (m *Sync[K, V]) Add(k K, v V) (V, bool)

func (*Sync[K, V]) Delete

func (m *Sync[K, V]) Delete(k K) (V, bool)

func (*Sync[K, V]) Get

func (m *Sync[K, V]) Get(k K) (V, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL