collect

package
v0.0.0-...-2812ca0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2018 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 SafeMap

type SafeMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

SafeMap is multiple thread safe, could be accessed by multiple thread simultaneously.

func NewSafeMap

func NewSafeMap() *SafeMap

NewSafeMap generates a instance of SafeMap type.

func (*SafeMap) Get

func (m *SafeMap) Get(k string) *Value

Get returns a value from inner map safely.

func (*SafeMap) Put

func (m *SafeMap) Put(k string, v interface{})

Put stores a key-value pair into inner map safely.

func (*SafeMap) Remove

func (m *SafeMap) Remove(k string)

Remove removes the key-value pair.

type Value

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

Value represents the value's info of a key-value pair.

func (*Value) Exist

func (v *Value) Exist() bool

Exist returns the data exist in map or not.

func (*Value) Int

func (v *Value) Int() (int, bool)

Int returns data as int.

func (*Value) Int32

func (v *Value) Int32() (int32, bool)

Int32 returns data as int32.

func (*Value) Int64

func (v *Value) Int64() (int64, bool)

Int64 returns data as int64.

func (*Value) Result

func (v *Value) Result() (interface{}, bool)

Result returns the origin data and status in map.

func (*Value) String

func (v *Value) String() (string, bool)

String returns data as string.

Jump to

Keyboard shortcuts

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