utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUrl

func CheckUrl(url string) error

func EncryptPassword

func EncryptPassword(salt, raw string) string

func Getkey

func Getkey(keys []string, sid int) string

func InitStatsd

func InitStatsd(addr string)

func KeysOfMap

func KeysOfMap(m map[string]string) []string

func LdapBind

func LdapBind(addr,
	BaseDN,
	BindDN,
	BindPasswd,
	UserField,
	user,
	password string) (sucess bool, err error)

func Ldapsearch

func Ldapsearch(addr,
	BaseDN,
	BindDN,
	BindPasswd,
	UserField,
	user string,
	Attributes []string) (map[string]string, error)

func ParseUrl

func ParseUrl(target string) (schema, host, port, path string)

func PushFalcon

func PushFalcon(addr string, itemCheckedArray []*dataobj.CheckResult, ip string)

func PushPromethues

func PushPromethues(addr string, itemsChecked []*dataobj.CheckResult, ip string)

func PushStatsd

func PushStatsd(metric string, value int64) error

func ReadLastLine

func ReadLastLine(filename string) (string, error)

func TimeFormat

func TimeFormat(ts int64) string

Types

type MetricValue

type MetricValue struct {
	Endpoint  string      `json:"endpoint"`
	Metric    string      `json:"metric"`
	Tags      string      `json:"tags"`
	Value     interface{} `json:"value"`
	Timestamp int64       `json:"timestamp"`
	Type      string      `json:"counterType"`
	Step      int64       `json:"step"`
}

Jump to

Keyboard shortcuts

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