package
3.11.0-beta3+incompatible
Repository: https://github.com/signalfx/neo-agent.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
Package filter contains common filtering logic that can be used to filter datapoints or various resources within other agent components, such as monitors.
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
BoolToInt returns 1 if b is true and 0 otherwise.
ChunkScanner looks for a line and all subsequent indented lines and returns a scanner that will output that chunk as a single token.
CloneAndExcludeStringMapByKey clones a string map excluding the specified keys.
CloneAndFilterStringMapWithFunc clones a string map and only includes key/value pairs for which the filter function returns true.
CloneInterface takes an object and returns a copy of it regardless of whether it is really a pointer underneath or not.
CloneStringMap makes a shallow copy of a map[string]string.
ConvertToMapViaYAML takes a struct and converts it to map[string]interface{} by marshalling it to yaml and back to a map.
DatapointToString pretty prints a datapoint in a consistent manner for logging purposes.
Debounce0 calls a zero arg function on the trailing edge of every `duration`.
DecodeValueGenerically apply some very basic heuristics to decode string values to the most sensible type for use in config structs.
DuplicateInterfaceMapKeysAsCamelCase takes a map[string]interface{} and camel cases the keys.
EnsurePrefix ensures that string s starts with the given prefix.
FindFieldWithEmbeddedStructs will look for a field with the given name, recursing down into embedded structs if there are any.
FirstNonEmpty returns the first string that is not empty, otherwise "".
FirstNonZero returns the first int in `ns` that is not zero.
GetStructFieldNames returns a slice with the names of all of the fields in the struct `s`.
IndentLines indents all lines in `ss` by `spaces` number of spaces.
InterfaceMapToStringMap converts a map[interface{}]interface{} to a map[string]string.
InterfaceSliceToStringSlice returns a new slice that contains the elements of `is` as strings.
IsSignalChanClosed returns whether a channel is closed that is used only for the sake of sending a single singal.
IsStructOrPointerToStruct returns true if the given reflect.Type is a struct or pointer to a struct.
LowercaseFirstChar make the first character of a string lowercase.
MakeRange creates an int slice containing all ints between `min` and `max`.
MaxInt returns the greater of x and y.
MergeInterfaceMaps merges any number of map[string]interface{} with a later map's keys overriding earlier maps.
MergeStringMaps merges n maps with a later map's keys overriding earlier maps.
MinInt returns the lesser of x and y.
NewIDGenerator returns a function that will produce, for any given generator instance, a unique, non-empty, string value each time it is called.
NewThrottledLogger returns an initialized ThrottleLogger.
ParseLineNumberFromYAMLError takes an error message nested in yaml.TypeError and returns a line number if indicated in the error message.
RegexpGroupMap matches text against the given regexp and returns a map of all of the named subgroups to the values found in text.
RemoveAllElementsFromStringSlice removes all elements from toRemove that exists in inputStrings.
RemoveEmptyMapValues will strip a map of any key/value pairs for which the value is the empty string.
RunOnArrayOfIntervals the given function once on the specified intervals, and repeat according to the supplied RepeatPolicy.
RunOnInterval the given fn once every interval, starting at the moment the function is called.
SortMapKeys returns a slice of all of the keys of a map sorted alphabetically ascending.
StringInterfaceMapToAllInterfaceMap converts a map[string]interface{} to a map[interface{}]interface{}.
StringMapToInterfaceMap converts a map[string]string to a map[string]interface{}.
StringSetToSlice converts a map representing a set into a slice of strings.
StringSliceToMap converts a slice of strings into a map with keys from the slice.
StripIndent looks at the first line in s and strips off whatever whitespace indentation it has from every line in s.
UniqueStrings returns a slice with the unique set of strings from the input.
YAMLNameOfField returns the YAML key that is used for the given struct field.
YAMLNameOfFieldInStruct returns the YAML key that is used for the given struct field, looking up fieldName in the given st struct.
# Constants
RepeatAll repeats all intervals.
RepeatLast repeats only the last interval.
RepeatNone does not repeat.
# Structs
LogrusGolibShim makes a Logrus logger conform to the golib Log interface.
ThrottledLogger throttles error and warning messages sent through it via the special ThrottledError method (other standard level methods are not throttled).
# Type aliases
RepeatPolicy repeat behavior for RunOnIntervals Function.