utils

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SignalCtx context.Context = getSignalContext()
)

Functions

func Base64Encode added in v0.20.0

func Base64Encode(data string) string

Base64Encode base 64 encodes a string.

func GetDefaultConfigDirectory added in v0.8.11

func GetDefaultConfigDirectory() (string, error)

GetDefaultConfigDirectory returns the full path to the .newrelic directory within the user's home directory.

func GetTimestamp added in v0.8.11

func GetTimestamp() int64

GetTimestamp returns the current epoch timestamp in seconds.

func LogIfError added in v0.4.0

func LogIfError(err error)

LogIfError wraps the err nil check to cleanup the code. Logs at Error level

func LogIfFatal added in v0.4.0

func LogIfFatal(err error)

LogIfFatal wraps the err nil check to cleanup the code. Logs at Fatal level

func MakeRange added in v0.18.27

func MakeRange(min, max int) []int

MakeRange generates a slice of sequential integers.

func MinOf added in v0.8.11

func MinOf(vars ...int) int

MinOf returns the minimum int value provided.

func StructToMap

func StructToMap(item interface{}, fields []string) map[string]interface{}

Types

type StructToMapCallback

type StructToMapCallback func(item interface{}, fields []string) map[string]interface{}

Jump to

Keyboard shortcuts

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