Documentation ¶
Overview ¶
Package stringutils provides helper functions for dealing with strings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomASCIIString ¶ added in v1.9.0
GenerateRandomASCIIString generates an ASCII random stirng with length n.
func GenerateRandomAlphaOnlyString ¶
GenerateRandomAlphaOnlyString generates an alphabetical random string with length n.
func InSlice ¶
InSlice tests whether a string is contained in a slice of strings or not. Comparison is case insensitive
func ShellQuoteArguments ¶
ShellQuoteArguments takes a list of strings and escapes them so they will be handled right when passed as arguments to an program via a shell
Types ¶
type StrSlice ¶ added in v1.9.0
type StrSlice struct {
// contains filtered or unexported fields
}
StrSlice representes a string or an array of strings. We need to override the json decoder to accept both options.
func NewStrSlice ¶ added in v1.9.0
NewStrSlice creates an StrSlice based on the specified parts (as strings).
func (*StrSlice) MarshalJSON ¶ added in v1.9.0
MarshalJSON Marshals (or serializes) the StrSlice into the json format. This method is needed to implement json.Marshaller.
func (*StrSlice) UnmarshalJSON ¶ added in v1.9.0
UnmarshalJSON decodes the byte slice whether it's a string or an array of strings. This method is needed to implement json.Unmarshaler.