mapstr

package
v3.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapStr

type MapStr map[string]interface{}

MapStr the common event data definition

func New

func New() MapStr

New create a new MapStr instance

func NewArrayFromInterface

func NewArrayFromInterface(datas []map[string]interface{}) []MapStr

NewArrayFromInterface create a new array from interface

func NewFromInterface

func NewFromInterface(data interface{}) (MapStr, error)

NewFromInterface create a mapstr instance from the interface

func (MapStr) Bool

func (cli MapStr) Bool(key string) (bool, error)

Bool get the value as bool

func (MapStr) Different

func (cli MapStr) Different(target MapStr) (more MapStr, less MapStr, changes MapStr)

Different the current value is different from the content of the given data

func (MapStr) Exists

func (cli MapStr) Exists(key string) bool

Exists check the key exists

func (MapStr) Float

func (cli MapStr) Float(key string) (float64, error)

Float get the value as float64

func (MapStr) ForEach

func (cli MapStr) ForEach(callItem func(key string, val interface{}) error) error

ForEach for each the every item

func (MapStr) Get

func (cli MapStr) Get(key string) (val interface{}, exists bool)

Get return the origin value by the key

func (MapStr) Int64

func (cli MapStr) Int64(key string) (int64, error)

Int64 return the value by the key

func (MapStr) IsEmpty

func (cli MapStr) IsEmpty() bool

IsEmpty check the empty status

func (MapStr) MapStr

func (cli MapStr) MapStr(key string) (MapStr, error)

MapStr get the MapStr object

func (MapStr) MapStrArray

func (cli MapStr) MapStrArray(key string) ([]MapStr, error)

MapStrArray get the MapStr object array

func (MapStr) MarshalJSONInto

func (cli MapStr) MarshalJSONInto(target interface{}) error

MarshalJSONInto convert to the input value

func (MapStr) Merge

func (cli MapStr) Merge(second MapStr)

Merge merge second into self,if the key is the same then the new value replaces the old value.

func (MapStr) Remove

func (cli MapStr) Remove(key string) interface{}

Remove delete the item by the key and return the deleted one

func (MapStr) Reset

func (cli MapStr) Reset()

Reset reset the mapstr into the init state

func (MapStr) Set

func (cli MapStr) Set(key string, value interface{})

Set set a new value for the key, the old value will be replaced

func (MapStr) String

func (cli MapStr) String(key string) (string, error)

String get the value as string

func (MapStr) Time

func (cli MapStr) Time(key string) (*time.Time, error)

Time get the value as time.Time

func (MapStr) ToJSON

func (cli MapStr) ToJSON() ([]byte, error)

ToJSON convert to json string

Jump to

Keyboard shortcuts

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