Documentation
¶
Index ¶
- type Encryption
- type Interface
- type Random
- type Str
- func (s Str) ToBool() bool
- func (s Str) ToBuffer() *bytes.Buffer
- func (s Str) ToBytes() []byte
- func (s Str) ToFloat32() float32
- func (s Str) ToFloat64() float64
- func (s Str) ToInt() int
- func (s Str) ToInt32() int32
- func (s Str) ToInt64() int64
- func (s Str) ToString() string
- func (s Str) ToTime(layout string) time.Time
- func (s Str) ToUint32() uint32
- func (s Str) ToUint64() uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encryption ¶ added in v1.0.4
type Encryption struct {
// contains filtered or unexported fields
}
Encryption 提供加密操作
func NewEncryption ¶ added in v1.0.4
func NewEncryption(v []byte) *Encryption
NewEncryption 创建Encryption的实例 v 需要加密的值
type Interface ¶
type Interface interface {
// ToString Convert interface{} to string
ToString() string
// ToBytes Convert interface{} to []byte
ToBytes() []byte
// ToString Convert interface{} to int64
ToInt64() int64
// ToString Convert interface{} to int32
ToInt32() int32
// ToString Convert interface{} to int
ToInt() int
// ToString Convert interface{} to uint64
ToUint64() uint64
// ToString Convert interface{} to uint32
ToUint32() uint32
// ToString Convert interface{} to float64
ToFloat64() float64
// ToString Convert interface{} to float32
ToFloat32() float32
// ToString Convert interface{} to bool
ToBool() bool
// ToString Convert interface{} to time,
// // If error isn't nil return time.Now()
ToTime(layout string) time.Time
}
Interface Provide a interface{} convert operation
type Random ¶ added in v1.0.3
type Random struct {
// contains filtered or unexported fields
}
Random 提供随机码的生成函数
func (*Random) LowerLetter ¶ added in v1.0.3
LowerLetter 生成只包含小写字母的随机码
func (*Random) NumberAndLetter ¶ added in v1.0.3
NumberAndLetter 生成包含数字和字母(不区分大小写)的随机码
func (*Random) UpperLetter ¶ added in v1.0.3
UpperLetter 生成只包含大写字母的随机码
Click to show internal directories.
Click to hide internal directories.