Documentation
¶
Index ¶
- Variables
- type Rand
- func (r *Rand) B(n int) []byte
- func (r *Rand) D(min, max time.Duration) time.Duration
- func (r *Rand) GetDigits(n int) string
- func (r *Rand) GetLetters(n int) string
- func (r *Rand) GetString(s string, n int) string
- func (r *Rand) GetSymbols(n int) string
- func (r *Rand) Intn(max int) int
- func (r *Rand) Meet(num, total int) bool
- func (r *Rand) MeetProb(prob float32) bool
- func (r *Rand) N(min, max int) int
- func (r *Rand) Perm(n int) []int
- func (r *Rand) S(n int, symbols ...bool) string
- type Str
- type TerminalLog
- type Transfer
- func (r *Transfer) BabelToPascal() string
- func (r *Transfer) BabelToSnake() string
- func (r *Transfer) CamelToBabel() string
- func (r *Transfer) CamelToPascal() string
- func (r *Transfer) CamelToSnake() string
- func (r *Transfer) KebabToCamel() string
- func (r *Transfer) PascalToBabel() string
- func (r *Transfer) PascalToCamel() string
- func (r *Transfer) PascalToSnake() string
- func (r *Transfer) Pluralize() string
- func (r *Transfer) SnakeToBabel() string
- func (r *Transfer) SnakeToCamel() string
- func (r *Transfer) SnakeToPascal() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // 52 UpperLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" // 26 LowerLetters = "abcdefghijklmnopqrstuvwxyz" // 26 Symbols = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" // 32 Digits = "0123456789" // 10 )
Functions ¶
This section is empty.
Types ¶
type Rand ¶
type Rand struct {
// contains filtered or unexported fields
}
func (*Rand) GetDigits ¶
GetDigits returns a random str which contains only digits, and its length is `n`.
func (*Rand) GetLetters ¶
GetLetters returns a random str which contains only letters, and its length is `n`.
func (*Rand) GetString ¶
GetString randomly picks and returns `n` count of chars from given str `s`. It also supports unicode str like Chinese/Russian/Japanese, etc.
func (*Rand) GetSymbols ¶
GetSymbols returns a random str which contains only symbols, and its length is `n`.
func (*Rand) N ¶
N returns a random int between min and max: [min, max]. The `min` and `max` also support negative numbers.
type TerminalLog ¶
type TerminalLog struct {
// contains filtered or unexported fields
}
type Transfer ¶
type Transfer struct {
// contains filtered or unexported fields
}
func NewTransfer ¶
func (*Transfer) BabelToPascal ¶
BabelToPascal babel -> 大驼峰
func (*Transfer) PascalToBabel ¶
PascalToSnake 大驼峰 -> babel
Click to show internal directories.
Click to hide internal directories.