Documentation ¶
Index ¶
- func Base64Encode(src []byte) []byte
- func GenMd5(src interface{}) string
- func LowerFirst(s string) string
- func PadLeft(s, pad string, length int) string
- func PadRight(s, pad string, length int) string
- func Padding(s, pad string, length int, pos uint8) string
- func PrettyJSON(v interface{}) (string, error)
- func RandomBytes(length int) ([]byte, error)
- func RandomString(length int) (string, error)
- func RenderTemplate(input string, data interface{}, isFile ...bool) string
- func Repeat(s string, times int) string
- func RepeatRune(char rune, times int) (chars []rune)
- func Replaces(str string, pairs map[string]string) string
- func Similarity(s, t string, rate float32) (float32, bool)
- func Split(s, sep string) (ss []string)
- func Substr(s string, pos, length int) string
- func UpperFirst(s string) string
- func UpperWord(s string) string
- type SimilarComparator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandomString ¶
RandomString generate. Example: this will give us a 44 byte, base64 encoded output
token, err := RandomString(32) if err != nil { // Serve an appropriately vague error to the // user, but log the details internally. }
func RenderTemplate ¶
RenderTemplate render text template
func RepeatRune ¶
RepeatRune repeat a rune char.
func Replaces ¶
Replaces replace multi strings pairs - [old => new] can also use: strings.NewReplacer("old1", "new1", "old2", "new2").Replace(str)
Types ¶
type SimilarComparator ¶
type SimilarComparator struct {
// contains filtered or unexported fields
}
SimilarComparator definition links:
https://github.com/mkideal/cli/blob/master/fuzzy.go
Click to show internal directories.
Click to hide internal directories.