libmap

package
v3.1.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2016 License: MIT Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllNonExpiredCache

func AllNonExpiredCache(cache *gocache.Cache) map[string]gocache.Item

func Flatten

func Flatten(input interface{}, delimiter string) (flat map[string]interface{}, err error)

Flatten nested interface{} into a single level map[string]interface{}.

Types

type TSafeMapBytes

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

TSafeMapBytes is concurrency-safe map of bytes.

func NewTSafeMapBytes

func NewTSafeMapBytes(data map[string][]byte) *TSafeMapBytes

NewTSafeMapBytes creates an instance of TSafeMapBytes

func (*TSafeMapBytes) All

func (mp *TSafeMapBytes) All() map[string][]byte

All returns all values.

func (*TSafeMapBytes) Get

func (mp *TSafeMapBytes) Get(key string) []byte

Get value.

func (*TSafeMapBytes) Set

func (mp *TSafeMapBytes) Set(key string, value []byte)

Set value.

func (*TSafeMapBytes) ToJson

func (mp *TSafeMapBytes) ToJson() ([]byte, error)

ToJson returns the JSON encoded map.

type TSafeMapCounter

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

TSafeMapCounter is concurrency-safe map of counter.

func NewTSafeMapCounter

func NewTSafeMapCounter(data map[string]int) *TSafeMapCounter

NewTSafeMapCounter creates an instance of TSafeMapCounter

func (*TSafeMapCounter) All

func (mp *TSafeMapCounter) All() map[string]int

All returns all count values.

func (*TSafeMapCounter) Get

func (mp *TSafeMapCounter) Get(key string) int

Get value.

func (*TSafeMapCounter) Incr

func (mp *TSafeMapCounter) Incr(key string, value int)

Incr increments value by X.

func (*TSafeMapCounter) Reset

func (mp *TSafeMapCounter) Reset(key string)

Reset wipes count data to 0.

func (*TSafeMapCounter) ToJson

func (mp *TSafeMapCounter) ToJson() ([]byte, error)

ToJson returns JSON encoded values.

type TSafeMapString

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

TSafeMapString is concurrency-safe map of string.

func NewTSafeMapString

func NewTSafeMapString(data map[string]string) *TSafeMapString

NewTSafeMapString creates an instance of TSafeMapString

func (*TSafeMapString) All

func (mp *TSafeMapString) All() map[string]string

All returns all values in map.

func (*TSafeMapString) Delete

func (mp *TSafeMapString) Delete(key string) string

Delete by key.

func (*TSafeMapString) Get

func (mp *TSafeMapString) Get(key string) string

Get value.

func (*TSafeMapString) Set

func (mp *TSafeMapString) Set(key string, value string)

Set value.

func (*TSafeMapString) ToJson

func (mp *TSafeMapString) ToJson() ([]byte, error)

ToJson returns the JSON encoded values.

type TSafeMapStrings

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

TSafeMapStrings is concurrency-safe map of []string.

func NewTSafeMapStrings

func NewTSafeMapStrings(data map[string][]string) *TSafeMapStrings

NewTSafeMapStrings returns instance of TSafeMapStrings

func (*TSafeMapStrings) All

func (mp *TSafeMapStrings) All() map[string][]string

All returns all values.

func (*TSafeMapStrings) Append

func (mp *TSafeMapStrings) Append(key string, value string)

Append to slice by key.

func (*TSafeMapStrings) Exists

func (mp *TSafeMapStrings) Exists(key string) bool

Exists check existance of a key

func (*TSafeMapStrings) Get

func (mp *TSafeMapStrings) Get(key string) []string

Get a slice of value.

func (*TSafeMapStrings) Reset

func (mp *TSafeMapStrings) Reset(key string)

Reset wipes all values.

func (*TSafeMapStrings) Set

func (mp *TSafeMapStrings) Set(key string, value []string)

Set value.

func (*TSafeMapStrings) ToJson

func (mp *TSafeMapStrings) ToJson() ([]byte, error)

ToJson returns JSON encoded values.

type TSafeNestedMapInterface

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

TSafeNestedMapInterface is concurrency-safe map of interface.

func NewTSafeNestedMapInterface

func NewTSafeNestedMapInterface(data map[string]interface{}) *TSafeNestedMapInterface

NewTSafeNestedMapInterface creates an instance of TSafeNestedMapInterface

func (*TSafeNestedMapInterface) All

func (mp *TSafeNestedMapInterface) All() map[string]interface{}

All returns all values.

func (*TSafeNestedMapInterface) Get

func (mp *TSafeNestedMapInterface) Get(key string) interface{}

Get value.

func (*TSafeNestedMapInterface) Set

func (mp *TSafeNestedMapInterface) Set(key string, value interface{})

Set value.

func (*TSafeNestedMapInterface) ToJson

func (mp *TSafeNestedMapInterface) ToJson() ([]byte, error)

ToJson returns JSON encoded values.

Jump to

Keyboard shortcuts

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