internal

package
v0.0.0-...-7eda018 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const HeartbeatInterval = 5 * time.Second

Variables

View Source
var TrentoNamespace = uuid.Must(uuid.Parse("fb92284e-aa5e-47f6-a883-bf9469e7a0dc"))

Functions

func BindEnv

func BindEnv()

func CRC32hash

func CRC32hash(input []byte) int

func Contains

func Contains(s []string, str string) bool

func FindMatches

func FindMatches(pattern string, text []byte) map[string]interface{}

FindMatches finds regular expression matches in a key/value based text (ini files, for example), and returns a map with them. If the matched key has spaces, they will be replaced with underscores If the same keys is found multiple times, the entry of the map will have a list as value with all of the matched values The pattern must have 2 groups. For example: `(.+)=(.*)`

func InitConfig

func InitConfig(configName string) error

InitConfig intializes the config for the application If no config file is provided with the --config flag it will look for a config in following locations:

${context} being one of the supported components: agent|web|runner

Order represents priority /etc/trento/${context}.yaml /usr/etc/trento/${context}.yaml $HOME/.config/trento/${context}.yaml

func Md5sum

func Md5sum(data string) string

func Md5sumFile

func Md5sumFile(filePath string) (string, error)

func Repeat

func Repeat(operation string, tick func(), interval time.Duration, ctx context.Context)

Repeat executes a function at a given interval. the first tick runs immediately

func SetLogFormatter

func SetLogFormatter(timestampFormat string)

func SetLogLevel

func SetLogLevel(level string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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