Documentation ¶
Index ¶
- Constants
- Variables
- func GetInt64OrDefault(v interface{}, defaultV int64) (int64, bool)
- type ParaKey
- type Parameters
- func (para *Parameters) AddTags(tags []string) error
- func (para *Parameters) AddTagsWithKey(key string, tags []string) error
- func (para *Parameters) CloneData() util.MapStr
- func (para *Parameters) Config(key ParaKey, obj interface{})
- func (newPara *Parameters) ConfigBinding(key ParaKey, rt reflect.Type, mutable *reflect.Value)
- func (e *Parameters) Delete(key string) error
- func (para *Parameters) Get(key ParaKey) interface{}
- func (para *Parameters) GetArray(key ParaKey) ([]interface{}, bool)
- func (para *Parameters) GetBool(key ParaKey, defaultV bool) bool
- func (para *Parameters) GetBytes(key ParaKey) ([]byte, bool)
- func (para *Parameters) GetDurationOrDefault(key ParaKey, defaultV string) time.Duration
- func (para *Parameters) GetFloat32(key ParaKey, defaultV float32) (float32, bool)
- func (para *Parameters) GetFloat32OrDefault(key ParaKey, defaultV float32) float32
- func (para *Parameters) GetFloat64(key ParaKey, defaultV float64) (float64, bool)
- func (para *Parameters) GetFloat64OrDefault(key ParaKey, defaultV float64) float64
- func (para *Parameters) GetInt(key ParaKey, defaultV int) (int, bool)
- func (para *Parameters) GetInt64(key ParaKey, defaultV int64) (int64, bool)
- func (para *Parameters) GetInt64Array(key ParaKey) ([]int64, bool)
- func (para *Parameters) GetInt64OrDefault(key ParaKey, defaultV int64) int64
- func (para *Parameters) GetIntMapOrInit(key ParaKey) (map[string]int, bool)
- func (para *Parameters) GetIntOrDefault(key ParaKey, defaultV int) int
- func (para *Parameters) GetMap(key ParaKey) (map[string]interface{}, bool)
- func (para *Parameters) GetMapArray(key ParaKey) ([]map[string]interface{}, bool)
- func (para *Parameters) GetOrDefault(key ParaKey, val interface{}) interface{}
- func (para *Parameters) GetString(key ParaKey) (string, bool)
- func (para *Parameters) GetStringArray(key ParaKey) ([]string, bool)
- func (para *Parameters) GetStringMap(key ParaKey) (result map[string]string, ok bool)
- func (para *Parameters) GetStringOrDefault(key ParaKey, val string) string
- func (para *Parameters) GetTags() (map[string]string, bool)
- func (para *Parameters) GetTime(key ParaKey) (time.Time, bool)
- func (e *Parameters) GetValue(key string) (interface{}, error)
- func (para *Parameters) Has(key ParaKey) bool
- func (para *Parameters) HasTag(key string) bool
- func (e *Parameters) Increment(key string, v int)
- func (para *Parameters) MustGet(key ParaKey) interface{}
- func (para *Parameters) MustGetArray(key ParaKey) []interface{}
- func (para *Parameters) MustGetBytes(key ParaKey) []byte
- func (para *Parameters) MustGetInt(key ParaKey) int
- func (para *Parameters) MustGetInt64(key ParaKey) int64
- func (para *Parameters) MustGetMap(key ParaKey) map[string]interface{}
- func (para *Parameters) MustGetString(key ParaKey) string
- func (para *Parameters) MustGetStringArray(key ParaKey) []string
- func (para *Parameters) MustGetTime(key ParaKey) time.Time
- func (e *Parameters) PutValue(key string, v interface{}) (interface{}, error)
- func (para *Parameters) ResetParameters()
- func (para *Parameters) Set(key ParaKey, value interface{})
- func (e *Parameters) SetErrorWithOption(jsonErr util.MapStr, addErrKey bool)
- func (e *Parameters) Stats(key string) int
- func (para *Parameters) UpdateTags(addTags, removeTags []string)
Constants ¶
View Source
const ( FieldsKey = "fields" TagsKey = "tags" )
Variables ¶
View Source
var (
ErrKeyNotFound = errors.New("key not found")
)
Functions ¶
func GetInt64OrDefault ¶
Types ¶
type Parameters ¶
type Parameters struct { Timestamp time.Time Data util.MapStr `json:"data,omitempty"` Meta util.MapStr `json:"-"` // contains filtered or unexported fields }
func (*Parameters) AddTags ¶
func (para *Parameters) AddTags(tags []string) error
AddTags appends a tag to the tags field of ms. If the tags field does not exist then it will be created. If the tags field exists and is not a []string then an error will be returned. It does not deduplicate the list of tags.
func (*Parameters) AddTagsWithKey ¶
func (para *Parameters) AddTagsWithKey(key string, tags []string) error
AddTagsWithKey appends a tag to the key field of ms. If the field does not exist then it will be created. If the field exists and is not a []string then an error will be returned. It does not deduplicate the list.
func (*Parameters) CloneData ¶
func (para *Parameters) CloneData() util.MapStr
func (*Parameters) Config ¶
func (para *Parameters) Config(key ParaKey, obj interface{})
func (*Parameters) ConfigBinding ¶
func (*Parameters) Delete ¶
func (e *Parameters) Delete(key string) error
func (*Parameters) Get ¶
func (para *Parameters) Get(key ParaKey) interface{}
func (*Parameters) GetArray ¶
func (para *Parameters) GetArray(key ParaKey) ([]interface{}, bool)
GetArray will return a array which type of the items are interface {}
func (*Parameters) GetDurationOrDefault ¶
func (para *Parameters) GetDurationOrDefault(key ParaKey, defaultV string) time.Duration
func (*Parameters) GetFloat32 ¶
func (para *Parameters) GetFloat32(key ParaKey, defaultV float32) (float32, bool)
func (*Parameters) GetFloat32OrDefault ¶
func (para *Parameters) GetFloat32OrDefault(key ParaKey, defaultV float32) float32
func (*Parameters) GetFloat64 ¶
func (para *Parameters) GetFloat64(key ParaKey, defaultV float64) (float64, bool)
func (*Parameters) GetFloat64OrDefault ¶
func (para *Parameters) GetFloat64OrDefault(key ParaKey, defaultV float64) float64
func (*Parameters) GetInt64 ¶
func (para *Parameters) GetInt64(key ParaKey, defaultV int64) (int64, bool)
func (*Parameters) GetInt64Array ¶
func (para *Parameters) GetInt64Array(key ParaKey) ([]int64, bool)
func (*Parameters) GetInt64OrDefault ¶
func (para *Parameters) GetInt64OrDefault(key ParaKey, defaultV int64) int64
func (*Parameters) GetIntMapOrInit ¶
func (para *Parameters) GetIntMapOrInit(key ParaKey) (map[string]int, bool)
func (*Parameters) GetIntOrDefault ¶
func (para *Parameters) GetIntOrDefault(key ParaKey, defaultV int) int
func (*Parameters) GetMap ¶
func (para *Parameters) GetMap(key ParaKey) (map[string]interface{}, bool)
func (*Parameters) GetMapArray ¶
func (para *Parameters) GetMapArray(key ParaKey) ([]map[string]interface{}, bool)
func (*Parameters) GetOrDefault ¶
func (para *Parameters) GetOrDefault(key ParaKey, val interface{}) interface{}
func (*Parameters) GetStringArray ¶
func (para *Parameters) GetStringArray(key ParaKey) ([]string, bool)
func (*Parameters) GetStringMap ¶
func (para *Parameters) GetStringMap(key ParaKey) (result map[string]string, ok bool)
func (*Parameters) GetStringOrDefault ¶
func (para *Parameters) GetStringOrDefault(key ParaKey, val string) string
func (*Parameters) GetValue ¶
func (e *Parameters) GetValue(key string) (interface{}, error)
func (*Parameters) Has ¶
func (para *Parameters) Has(key ParaKey) bool
func (*Parameters) HasTag ¶
func (para *Parameters) HasTag(key string) bool
func (*Parameters) Increment ¶
func (e *Parameters) Increment(key string, v int)
func (*Parameters) MustGet ¶
func (para *Parameters) MustGet(key ParaKey) interface{}
func (*Parameters) MustGetArray ¶
func (para *Parameters) MustGetArray(key ParaKey) []interface{}
func (*Parameters) MustGetBytes ¶
func (para *Parameters) MustGetBytes(key ParaKey) []byte
func (*Parameters) MustGetInt ¶
func (para *Parameters) MustGetInt(key ParaKey) int
MustGetInt return 0 if not key was found
func (*Parameters) MustGetInt64 ¶
func (para *Parameters) MustGetInt64(key ParaKey) int64
func (*Parameters) MustGetMap ¶
func (para *Parameters) MustGetMap(key ParaKey) map[string]interface{}
func (*Parameters) MustGetString ¶
func (para *Parameters) MustGetString(key ParaKey) string
func (*Parameters) MustGetStringArray ¶
func (para *Parameters) MustGetStringArray(key ParaKey) []string
func (*Parameters) MustGetTime ¶
func (para *Parameters) MustGetTime(key ParaKey) time.Time
func (*Parameters) PutValue ¶
func (e *Parameters) PutValue(key string, v interface{}) (interface{}, error)
func (*Parameters) ResetParameters ¶
func (para *Parameters) ResetParameters()
func (*Parameters) Set ¶
func (para *Parameters) Set(key ParaKey, value interface{})
TODO remove lock async, channel
func (*Parameters) SetErrorWithOption ¶
func (e *Parameters) SetErrorWithOption(jsonErr util.MapStr, addErrKey bool)
SetErrorWithOption sets jsonErr value in the event fields according to addErrKey value.
func (*Parameters) Stats ¶
func (e *Parameters) Stats(key string) int
func (*Parameters) UpdateTags ¶
func (para *Parameters) UpdateTags(addTags, removeTags []string)
Click to show internal directories.
Click to hide internal directories.