utils

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSessionID

func GenerateSessionID() string

GenerateSessionID = uuid.New

func GetSubgroupName

func GetSubgroupName(tags map[string]string) (string, error)

GetSubgroupName helper for exstracting proper subgroup name from tags

func GetType

func GetType(cfg map[string]interface{}) (string, error)

GetType return type of plugin or error if field type not present

func Hostname

func Hostname() string

Hostname return node hostname or panic on errors

func InterfaceToString

func InterfaceToString(v interface{}) (s string)

InterfaceToString print bytes with %q and other with %v format

func Pack

func Pack(input interface{}) (buf []byte, err error)

Pack is helper for encode data in to msgpack

func Unpack

func Unpack(data []byte, res interface{}) error

Unpack is helper for decoding data in to msgpack

Types

type NameStack

type NameStack []string

NameStack helper type for stacking metrics name

func (*NameStack) Pop

func (n *NameStack) Pop() (item string)

Pop remove one name from metric path

func (*NameStack) Push

func (n *NameStack) Push(item string)

Push add one name to metric path

Jump to

Keyboard shortcuts

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