Documentation
¶
Index ¶
- func CharGet(input string, position int) rune
- func CopyFile(srcPath, destPath string) (int64, error)
- func DeepCopy(src interface{}) (dest interface{})
- func Escape(s string) string
- func FileExists(path string) (bool, error)
- func GenerateRandomBytes(count int) ([]byte, error)
- func GenerateRandomString(count int) (string, error)
- func IndexAt(testString, substring string, startingIndex int) int
- func IndexAtAny(testString, chars string, startingIndex int) int
- func IsDirectory(path string) (bool, error)
- func IsTokenCharFirst(ch rune) bool
- func IsTokenCharNext(ch rune) bool
- func IsTokenName(s string) bool
- func IsTokenNameWithMiddleChars(s string, middleChars string) bool
- func PatternMatch(pattern string, testString string) bool
- func PrintableStr(input string) string
- func RuneIndexAt(testString, substring []rune, startingIndex int) int
- func RuneIndexAtAny(testString, chars []rune, startingIndex int) int
- func SortedKeys(m interface{}) []string
- func StringArrayToString(strs []string, delimiter string) string
- func Substr(input string, start int, length int) string
- func Utf8len(data []byte, offset int) int
- func WhichSuffix(s string, suffixes ...string) *string
- type HashedText
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepCopy ¶ added in v1.0.11
func DeepCopy(src interface{}) (dest interface{})
DeepCopy generates a separate copy of a source object
func Escape ¶
Escape translates control characters to backslash escape sequence; e.g., '\r' becomes `\r`
func FileExists ¶ added in v1.0.3
FileExists returns true if path corresponds to a file, and false if it corresponds to nothing or to a directory.
func GenerateRandomBytes ¶ added in v1.0.3
GenerateRandomBytes returns a byte array of cryptographic (true) random numbers. The byte array length is specified by count.
func GenerateRandomString ¶ added in v1.0.3
GenerateRandomString returns a base-64 encoding of a cryptographic (true) random number byte array. The byte array length is specified by count.
func IndexAtAny ¶ added in v1.0.8
IndexAtAny is like strings.Index with a starting index
func IsDirectory ¶ added in v1.0.3
IsDirectory returns true if path corresponds to a directory, and false if it corresponds to nothing or to a file.
func IsTokenCharFirst ¶
IsTokenCharFirst returns true if ch is a letter or underscore
func IsTokenCharNext ¶
IsTokenCharNext returns true if ch is a letter, number or underscore
func IsTokenName ¶
IsTokenName returns true if s contains only letters, numbers or underscores, and does not start with a number, and has at least one letter
func IsTokenNameWithMiddleChars ¶ added in v1.0.5
IsTokenNameWithMiddleChars returns true if s contains only letters, numbers or underscores, or has allowed characters that are not first or last, does not start with a number, and has at least one letter. A common middleChars string is "-".
func PatternMatch ¶ added in v1.0.3
PatternMatch performs a simple asterisk-based pattern match
func PrintableStr ¶ added in v1.0.3
PrintableStr converts non-printable characters in input to a dot
func RuneIndexAt ¶ added in v1.0.8
RuneIndexAt is a version of IndexAt for rune arrays
func RuneIndexAtAny ¶ added in v1.0.8
RuneIndexAtAny is a version of IndexAtAny for rune arrays
func SortedKeys ¶
func SortedKeys(m interface{}) []string
SortedKeys returns the key array for the map, sorted A-Z
func StringArrayToString ¶ added in v1.0.6
StringArrayToStrings converts an array of strings to a single string, placing the delimiter string between each
func Substr ¶
Substr returns a string based on logical character start and length, instead of bytes like a slice
func Utf8len ¶ added in v1.0.3
Utf8len returns the number of bytes in the logical UTF-8 character, 0 if the character is incomplete, or -1 if the character is invalid,
func WhichSuffix ¶
WhichSuffix returns a pointer to the first suffix matching s, or nil if none of the suffixes match
Types ¶
type HashedText ¶ added in v1.0.3
type HashedText string
HashedText is a typed alias for string
func HashText ¶ added in v1.0.3
func HashText(text string) HashedText
HashText returns a sha1 hash of text in base64 encoding.