Documentation ¶
Overview ¶
Package utils provides some general purpose utils used within orpheus.
Index ¶
- func AppendStringToBinary(binary []byte, s string) ([]byte, error)
- func GetSliceDiff(a []string, b []string) (diff []string)
- func IsJSONObject(s string) bool
- func IsKeyNotFoundError(err error) bool
- func IsSubSlice(needle, haystack []string) bool
- func PrettyPrintJSON(s string) (string, error)
- func RandASCIIString(n int) string
- func RemoveStringFromBinary(binary []byte, s string) ([]byte, error)
- func SplitURL(url string) (scheme, host, path string, err error)
- func StringInSlice(a string, list []string) bool
- func StructToMap(i interface{}, tag string) map[string]interface{}
- type Strings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendStringToBinary ¶
AppendStringToBinary appends a string to a binary byte slice
func GetSliceDiff ¶
GetSliceDiff returns all element that are present in slice a but not in b
func IsJSONObject ¶
IsJSONObject checks if a string is a valid json object.
func IsKeyNotFoundError ¶
IsKeyNotFoundError checks if an error is an KeyNotFound error
func IsSubSlice ¶
IsSubSlice checks if a slice of strings is a subset of another slice
func PrettyPrintJSON ¶
PrettyPrintJSON formats a json-string nicely.
func RandASCIIString ¶
RandASCIIString returns a random string consisting of ASCII characters of the given length.
func RemoveStringFromBinary ¶
RemoveStringFromBinary removes a string from a binary byte slice
func StringInSlice ¶
StringInSlice check if a given string is present in a slice.
func StructToMap ¶
StructToMap creates a map from an interface{} using the passed tag name
Types ¶
type Strings ¶
type Strings []string
Strings is an alias for a string slice
func (Strings) MarshalBinary ¶
MarshalBinary marshals Strings into bytes
func (*Strings) UnmarshalBinary ¶
UnmarshalBinary unmarshalls bytes into Strings.
Directories ¶
Path | Synopsis |
---|---|
Package fileutils provides utility functions related to files.
|
Package fileutils provides utility functions related to files. |
Package logger provides logging functionality.
|
Package logger provides logging functionality. |
Package sstring provides a SensitiveString type that can hold sensitive data.
|
Package sstring provides a SensitiveString type that can hold sensitive data. |
Package times provides constants that expand the ones provided by time.
|
Package times provides constants that expand the ones provided by time. |