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 ¶
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 ¶
type StrSlice struct {
// contains filtered or unexported fields
}
StrSlice represents a string or an array of strings. We need to override the json decoder to accept both options.
func NewStrSlice ¶
NewStrSlice creates an StrSlice based on the specified parts (as strings).
func (*StrSlice) MarshalJSON ¶
MarshalJSON Marshals (or serializes) the StrSlice into the json format. This method is needed to implement json.Marshaller.
func (*StrSlice) UnmarshalJSON ¶
UnmarshalJSON decodes the byte slice whether it's a string or an array of strings. This method is needed to implement json.Unmarshaler.