collect

package
v0.0.0-...-adb5aae Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2017 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 generate a instance of SafeMap type.

func (*SafeMap) Get

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

Get return a value from inner map safely.

func (*SafeMap) Put

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

Put store 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 return the data exist in map or not.

func (*Value) Int

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

Int return data as int.

func (*Value) Int32

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

Int32 return data as int32.

func (*Value) Int64

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

Int64 return data as int64.

func (*Value) Result

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

Result return the origin data and status in map.

func (*Value) String

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

String return data as string.

Jump to

Keyboard shortcuts

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