Documentation ¶
Index ¶
- Variables
- func Base64Encode(data string) string
- func GetDefaultConfigDirectory() (string, error)
- func GetTimestamp() int64
- func IntSliceToStringSlice(in []int) (out []string)
- func LogIfError(err error)
- func LogIfFatal(err error)
- func MakeRange(min, max int) []int
- func MinOf(vars ...int) int
- func Obfuscate(input string) string
- func StdinExists() bool
- func StringInSlice(str string, slice []string) bool
- func StructToMap(item interface{}, fields []string) map[string]interface{}
- type NRDBClient
- type Retry
- type StructToMapCallback
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{
Use: "utils",
Short: "Various utility methods",
}
Command represents the utils command.
View Source
var (
SignalCtx context.Context = getSignalContext()
)
Functions ¶
func Base64Encode ¶ added in v0.20.0
Base64Encode base 64 encodes a string.
func GetDefaultConfigDirectory ¶ added in v0.8.11
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 IntSliceToStringSlice ¶ added in v0.30.0
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 Obfuscate ¶ added in v0.30.0
Obfuscate receives a string, and replaces everything after the first 8 characters with an asterisk before returning the result.
func StdinExists ¶ added in v0.24.0
func StdinExists() bool
Standard way to check for stdin in most environments (https://stackoverflow.com/questions/22563616/determine-if-stdin-has-data-with-go)
func StringInSlice ¶ added in v0.28.0
func StructToMap ¶
Types ¶
type NRDBClient ¶ added in v0.26.0
type StructToMapCallback ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.