structure

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrentMap

type ConcurrentMap[Key KeyType, Val any] struct {
	// contains filtered or unexported fields
}

ConcurrentMap represents safe concurrent map container

func NewConcurrentMap

func NewConcurrentMap[Key KeyType, T any]() *ConcurrentMap[Key, T]

func (*ConcurrentMap[Key, T]) Del added in v1.1.5

func (container *ConcurrentMap[Key, T]) Del(key Key)

Del remove keys from container

func (*ConcurrentMap[Key, T]) Find

func (container *ConcurrentMap[Key, T]) Find(key Key) (item T, err error)

Find returns item if key is not exist, returns not found error

func (*ConcurrentMap[Key, T]) Get

func (container *ConcurrentMap[Key, T]) Get(key Key) (item T, exist bool)

Get return item and exist

func (*ConcurrentMap[Key, T]) Set

func (container *ConcurrentMap[Key, T]) Set(key Key, value T) error

Set sets map item

type KeyType added in v1.1.5

type KeyType interface {
	int | int16 | int32 | int64 | string
}

Jump to

Keyboard shortcuts

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