cmap

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConMap

type ConMap struct {
	// contains filtered or unexported fields
}

ConMap for concurrency

func NewConMap

func NewConMap(ktype, vtype reflect.Type) (*ConMap, error)

NewConMap create a ConMap instance

func (*ConMap) Delete

func (c *ConMap) Delete(key interface{}) error

Delete destory key value pair from ConMap

func (*ConMap) Load

func (c *ConMap) Load(key interface{}) (interface{}, bool)

Load get key value pair from ConMap

func (*ConMap) LoadOrStore

func (c *ConMap) LoadOrStore(key, value interface{}) (interface{}, bool)

LoadOrStore get key value pair from ConMap or store it if not exists

func (*ConMap) Range

func (c *ConMap) Range(f func(key, value interface{}) bool)

Range visit each key in ConMap

func (*ConMap) Store

func (c *ConMap) Store(key, value interface{}) error

Store save key value pairs into ConMap

type IntMap

type IntMap struct {
	// contains filtered or unexported fields
}

IntMap for integer

func (*IntMap) Delete

func (i *IntMap) Delete(key int)

Delete destory key value pair

func (*IntMap) Load

func (i *IntMap) Load(key int) (string, bool)

Load get key value pair

func (*IntMap) LoadOrStore

func (i *IntMap) LoadOrStore(key int, value string) (string, bool)

LoadOrStore get or save key value pair

func (*IntMap) Range

func (i *IntMap) Range(f func(key int, value string) bool)

Range iterate key value pairs

func (*IntMap) Store

func (i *IntMap) Store(key int, value string)

Store save key value pairs

Jump to

Keyboard shortcuts

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