nat

package
v1.60.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

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

func New

func New[K comparable, V any]() *Table[K, V]

New return *Cache

func (*Table[K, V]) Delete

func (t *Table[K, V]) Delete(key K)

func (*Table[K, V]) Get

func (t *Table[K, V]) Get(key K) V

func (*Table[K, V]) GetOrCreateLock

func (t *Table[K, V]) GetOrCreateLock(key K) (*sync.Cond, bool)

func (*Table[K, V]) Load

func (t *Table[K, V]) Load(key K) (value V, ok bool)

func (*Table[K, V]) LoadOrStore

func (t *Table[K, V]) LoadOrStore(key K, newValue V) (actual V, loaded bool)

func (*Table[K, V]) Range

func (t *Table[K, V]) Range(f func(key K, value V) bool)

Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.

func (*Table[K, V]) Set

func (t *Table[K, V]) Set(key K, value V)

Jump to

Keyboard shortcuts

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