Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToFloat64 ¶
ConvertToFloat64 converts value to a float64 or errors out.
func GetCurrentTime ¶
func GetCurrentTime() string
GetCurrentTime return the current time (time.Now()), with location set to UTC, as a string formatted with the RFC3339 layout. This should be the format of all timestamps returned by the SDK.
The SDK uses this function to generate all of its timestamps. It is highly recommended that plugins use this as well for timestamp generation.
func ParseRFC3339 ¶
ParseRFC3339 parses a timestamp string in RFC3339 format into a Time struct. If it is given an empty string, it will return the zero-value for a Time instance. You can check if it is a zero time with the Time's `IsZero` method.
func RedactPasswords ¶
func RedactPasswords(obj interface{}) (redacted interface{}, err error)
RedactPasswords redacts any map fields where the key contains the substring "pass" (case-insensitive). It traverses through any slice or map within to search for fields to redact.
This does not make any attempt to find other potential passwords as magic strings. via regex, or via entropy. This is just meant to cover the basic case of "pass": "foo" within various config locations where it is likely to exist and should not be leaked out into logs.
This function is likely very inefficient due to the interface casting and the need to copy the lists/maps provided so that it does not overwrite the original list/map.
Types ¶
This section is empty.