safemap

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafeHashMap

type SafeHashMap struct {
	sync.Mutex
	// contains filtered or unexported fields
}

SafeHashMap is a concurrent safe Set interface implementation based on the hashmap

func New

func New() *SafeHashMap

New creates new safe hashmap

func (*SafeHashMap) Contains

func (s *SafeHashMap) Contains(value interface{}) bool

Contains checks if given hash map has a given value

func (*SafeHashMap) Copy

func (s *SafeHashMap) Copy() *SafeHashMap

Copy copies the safe map

func (*SafeHashMap) Get

func (s *SafeHashMap) Get(key interface{}) (interface{}, bool)

Get gets the safe hashmap value

func (*SafeHashMap) Length

func (s *SafeHashMap) Length() int

Length gets the hash map length

func (*SafeHashMap) Set

func (s *SafeHashMap) Set(key, value interface{})

Set sets the value at given _key

func (*SafeHashMap) UnsafeGet

func (s *SafeHashMap) UnsafeGet(key interface{}) (interface{}, bool)

UnsafeGet gets the value at given key even if the map is locked

func (*SafeHashMap) UnsafeSet

func (s *SafeHashMap) UnsafeSet(key, value interface{})

UnsafeSet adds the value at given key even if the map is locked

func (*SafeHashMap) Values

func (s *SafeHashMap) Values() map[interface{}]interface{}

Values gets the hashmap values

Jump to

Keyboard shortcuts

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