safemap

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEntryExist    = errors.New("entry exist")
	ErrEntryNotExist = errors.New("entry not exist")
)

Functions

This section is empty.

Types

type SafeMap

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

func NewSafeMap

func NewSafeMap() *SafeMap

func (*SafeMap) BoundedWalk

func (this *SafeMap) BoundedWalk(callback func(k, v interface{}) bool)

func (*SafeMap) Clear

func (this *SafeMap) Clear()

clear all the data

func (*SafeMap) Delete

func (this *SafeMap) Delete(key interface{}) (interface{}, bool)

if key exist return value + true, else return nil + false

func (*SafeMap) Find

func (this *SafeMap) Find(key interface{}) (interface{}, bool)

if key exist return value + true, else return nil + false

func (*SafeMap) Insert

func (this *SafeMap) Insert(key interface{}, value interface{}) error

if key exist return err, else return nil

func (*SafeMap) Len

func (this *SafeMap) Len() int

all kv pair count

func (*SafeMap) Replace

func (this *SafeMap) Replace(key interface{}, value interface{}) (interface{}, bool)

if key exist update, else insert

func (*SafeMap) Update

func (this *SafeMap) Update(key interface{}, value interface{}) error

if key exist return nil, else return err

func (*SafeMap) Walk

func (this *SafeMap) Walk(callback func(k, v interface{}))

walk through all the key value node then callback

Jump to

Keyboard shortcuts

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