package
0.0.0-20241005054043-280ebc17731b
Repository: https://github.com/release-argus/argus.git
Documentation: pkg.go.dev
# Functions
No description provided by the author
CheckTemplate will compile
true == pass
false == fail.
Contains returns whether `s` contains `e`.
CopyIfSecret will loop through 'fields' and replace values in 'to' of '<secret>' with values in 'from' if they are non-empty.
CopyMap will return a copy of the map.
ValueIfNotNil will take the `check` pointer and return the default value of that type if `check` is nil.
DefaultOrValue will return the default of `check` if it's nil, otherwise value.
ErrorToString accounts for nil errors, returning an empty string for those and err.Error() for non-nil errors.
EvalEnvVars will evaluate the environment variables in the string.
EvalNilPtr - Return the value of pointer if it's non-nil, otherwise nilValue.
FirstNonDefault will return the first var in `vars` that is not the default.
FirstNonDefaultWithEnv will return the first var in `vars` that is not an empty string after evaluating any environment variables.
FirstNonNilPtr will return the first pointer in `pointers` that is not nil.
FirstNonNilPtrWithEnv will return the first pointer in `pointers` that is not nil after evaluating any environment variables.
No description provided by the author
FormatMessageSource for logging.
GetHash will return the SHA256 hash of the string.
No description provided by the author
GetValueByKey will return the value of the key in the JSON.
Indentation used in line.
InitMap will initialise the map if it's nil.
LowercaseStringStringMap will convert all lowercase all keys in the map.
MergeMaps will merge `m2` into `m1` and any fields in `fields` that are '<secret>' will be replaced with the value in `m2`.
No description provided by the author
NormaliseNewlines all newlines in `data` to \n.
ParseKeys will return the JSON keys in the string.
PrintlnIfNil will print `msg` is `ptr` is nil.
PrintlnIfNotDefault will print `msg` is `x` is not the default for that type.
PrintlnIfNotNil will print `msg` is `ptr` is not nil.
PtrOrValueToPtr will take the pointer `a` and the value `b`, returning `a` when it isn't nil.
PtrValueOrValue will return the value of `ptr` if it's non-nil, otherwise `fallback`.
RandAlphaNumericLower will return a random alphanumeric (lowercase) string of length n.
RandNumeric will return a random numeric string of length n.
RandString will make a random string of length n with alphabet.
regexCheck returns whether there is a regex match of `re` on `text`.
regexCheckWithParams returns the result of a regex match of `re` on `text` after replacing "{{ version }}" with the version string.
RegexTemplate on `texts[index]` with the regex `template“.
RemoveElement from list.
RemoveIndex from list.
ReplaceElement in the string list.
Sorted keys will return a sorted list of the keys in a map.
StringToBoolPtr will take a string and convert it to a boolean pointer
"" => nil
"true" => true
"false" => false.
StringToPointer will return a pointer to str, but nil if it's an empty string.
No description provided by the author
TemplateString with pongo2 and `context`.
ToJSONString will return a JSON string representation of the interface.
ToYAMLString will return a YAML string representation of the interface.
ValueIfNotDefault will take the `check` var and return `value` when `check` is not it's default.
ValueIfNotNil will take the `check` pointer and return address of `value` when `check` is not nil.
# Structs
Field is a helper struct for String() methods.
JLog is a log for various levels of logging.
No description provided by the author
ServiceInfo.