Documentation
¶
Index ¶
- Variables
- type Buffer
- func (my *Buffer) Byte(byteList ...byte) *Buffer
- func (*Buffer) NewByBytes(original []byte) *Buffer
- func (*Buffer) NewByString(original string) *Buffer
- func (my *Buffer) Rune(runeList ...rune) *Buffer
- func (my *Buffer) String(stringList ...string) *Buffer
- func (my *Buffer) ToBytes() []byte
- func (my *Buffer) ToString() string
- type Rand
- func (my *Rand) B(n int) []byte
- func (my *Rand) D(min, max time.Duration) time.Duration
- func (my *Rand) GetDigits(n int) string
- func (my *Rand) GetLetters(n int) string
- func (my *Rand) GetString(s string, n int) string
- func (my *Rand) GetSymbols(n int) string
- func (my *Rand) Intn(max int) int
- func (my *Rand) Meet(num, total int) bool
- func (my *Rand) MeetProb(prob float32) bool
- func (my *Rand) N(min, max int) int
- func (*Rand) New() *Rand
- func (my *Rand) Perm(n int) []int
- func (my *Rand) S(n int, symbols ...bool) string
- type Str
- type TerminalLog
- type TerminalLogColor
- type Transfer
- func (my *Transfer) BabelToPascal() string
- func (my *Transfer) BabelToSnake() string
- func (my *Transfer) CamelToBabel() string
- func (my *Transfer) CamelToPascal() string
- func (my *Transfer) CamelToSnake() string
- func (my *Transfer) KebabToCamel() string
- func (*Transfer) New(original string) *Transfer
- func (my *Transfer) PascalToBabel() string
- func (my *Transfer) PascalToCamel() string
- func (my *Transfer) PascalToSnake() string
- func (my *Transfer) Pluralize() string
- func (my *Transfer) SnakeToBabel() string
- func (my *Transfer) SnakeToCamel() string
- func (my *Transfer) SnakeToPascal() string
Constants ¶
This section is empty.
Variables ¶
var ( Letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // 52 UpperLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" // 26 LowerLetters = "abcdefghijklmnopqrstuvwxyz" // 26 Symbols = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" // 32 Digits = "0123456789" // 10 RandApp Rand )
var ( StrApp Str TerminalLogApp TerminalLog )
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
var BufferApp Buffer
func (*Buffer) NewByBytes ¶
func (*Buffer) NewByString ¶
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 Str ¶
type Str struct {
// contains filtered or unexported fields
}
func (*Str) PadLeftZeros ¶
PadLeftZeros 前置补零
type TerminalLog ¶
type TerminalLog struct {
// contains filtered or unexported fields
}
type TerminalLogColor ¶
type TerminalLogColor string
const ( TerminalLogColorBlack TerminalLogColor = "\033[30m" TerminalLogColorRed TerminalLogColor = "\033[31m" TerminalLogColorGreen TerminalLogColor = "\033[32m" TerminalLogColorYellow TerminalLogColor = "\033[33m" TerminalLogColorBlue TerminalLogColor = "\033[34m" TerminalLogColorMagenta TerminalLogColor = "\033[35m" TerminalLogColorCyan TerminalLogColor = "\033[36m" TerminalLogColorWhite TerminalLogColor = "\033[37m" TerminalLogColorReset TerminalLogColor = "\033[0m" )
type Transfer ¶
type Transfer struct {
// contains filtered or unexported fields
}
var TransferApp Transfer
func (*Transfer) BabelToPascal ¶
BabelToPascal babel -> 大驼峰
func (*Transfer) CamelToPascal ¶
CamelToPascal 小驼峰 -> 大驼峰
func (*Transfer) PascalToBabel ¶
PascalToBabel 大驼峰 -> babel
func (*Transfer) PascalToCamel ¶
PascalToCamel 大驼峰 -> 小驼峰
func (*Transfer) PascalToSnake ¶
PascalToSnake 大驼峰 -> 下划线
func (*Transfer) SnakeToPascal ¶
SnakeToPascal 下划线 -> 大驼峰