cmap

package
v0.35.9 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0 Imports: 1 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CMap

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

CMap is a goroutine-safe map

func NewCMap

func NewCMap() *CMap

func (*CMap) Clear

func (cm *CMap) Clear()

func (*CMap) Delete

func (cm *CMap) Delete(key string)

func (*CMap) Get

func (cm *CMap) Get(key string) interface{}

func (*CMap) GetOrSet added in v0.35.0

func (cm *CMap) GetOrSet(key string, newValue interface{}) (value interface{}, alreadyExists bool)

GetOrSet returns the existing value if present. Othewise, it stores `newValue` and returns it.

func (*CMap) Has

func (cm *CMap) Has(key string) bool

func (*CMap) Keys

func (cm *CMap) Keys() []string

func (*CMap) Set

func (cm *CMap) Set(key string, value interface{})

func (*CMap) Size

func (cm *CMap) Size() int

func (*CMap) Values

func (cm *CMap) Values() []interface{}

Jump to

Keyboard shortcuts

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