safemap

package
v0.0.0-...-2ca8ae2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2018 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafeMap

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

SafeMap is a map with lock

func NewSafeMap

func NewSafeMap() *SafeMap

NewSafeMap return new safemap

func (*SafeMap) Check

func (m *SafeMap) Check(k interface{}) bool

Check Returns true if k is exist in the map.

func (*SafeMap) Delete

func (m *SafeMap) Delete(k interface{})

Delete the given key and value.

func (*SafeMap) Get

func (m *SafeMap) Get(k interface{}) interface{}

Get from maps return the k's value

func (*SafeMap) Items

func (m *SafeMap) Items() map[interface{}]interface{}

Items returns all items in safemap.

func (*SafeMap) Set

func (m *SafeMap) Set(k interface{}, v interface{}) bool

Set Maps the given key and value. Returns false if the key is already in the map and changes nothing.

Jump to

Keyboard shortcuts

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