Documentation ¶
Index ¶
- type B
- func (b B) Buffer() *bytes.Buffer
- func (b B) DefaultFloat64(defaultVal float64) float64
- func (b B) DefaultInt64(defaultVal int64) int64
- func (b B) DefaultUint64(defaultVal uint64) uint64
- func (b B) Float64() (float64, error)
- func (b B) Int64() (int64, error)
- func (b B) String() string
- func (b B) Uint64() (uint64, error)
- type Encryption
- type Interface
- type Random
- type S
- func (s S) Bool() (bool, error)
- func (s S) Buffer() *bytes.Buffer
- func (s S) Bytes() []byte
- func (s S) DefaultBool() bool
- func (s S) DefaultFloat32(defaultVal float32) float32
- func (s S) DefaultFloat64(defaultVal float64) float64
- func (s S) DefaultInt(defaultVal int) int
- func (s S) DefaultInt64(defaultVal int64) int64
- func (s S) DefaultTime(layout string) time.Time
- func (s S) DefaultUint64(defaultVal uint64) uint64
- func (s S) Float32() (float32, error)
- func (s S) Float64() (float64, error)
- func (s S) Int() (int, error)
- func (s S) Int64() (int64, error)
- func (s S) String() string
- func (s S) Time(layout string) (time.Time, error)
- func (s S) Uint64() (uint64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type B ¶
type B []byte
B Provide a []byte conversions
func (B) DefaultFloat64 ¶
DefaultFloat64 Convert []byte to float64
func (B) DefaultInt64 ¶
DefaultInt64 Convert []byte to int64
func (B) DefaultUint64 ¶
DefaultUint64 Convert []byte to uint64
type Encryption ¶ added in v1.0.4
type Encryption struct {
// contains filtered or unexported fields
}
Encryption Provide some commonly used encryption function
func NewEncryption ¶ added in v1.0.4
func NewEncryption(data []byte) *Encryption
NewEncryption Create a Encryption instance data The encrypted data
func (*Encryption) MD5 ¶ added in v1.0.4
func (e *Encryption) MD5() (string, error)
MD5 md5 encryption
type Interface ¶
type Interface interface { // String Convert interface{} to string String() string // Int64 Convert interface{} to int64 Int64() (int64, error) // DefaultInt64 Convert interface{} to int64 DefaultInt64(defaultVal int64) int64 // Uint64 Convert interface{} to uint64 Uint64() (uint64, error) // DefaultUint64 Convert interface{} to uint64 DefaultUint64(defaultVal uint64) uint64 // Float64 Convert interface{} to float64 Float64() (float64, error) // DefaultFloat64 Convert interface{} to float64 DefaultFloat64(defaultVal float64) float64 // Bool Convert interface{} to bool Bool() (bool, error) // DefaultBool Convert interface{} to bool DefaultBool() bool }
Interface Provide a interface{} conversions
type Random ¶ added in v1.0.3
type Random struct {
// contains filtered or unexported fields
}
Random provide random code generation
func NewRandom ¶ added in v1.0.3
NewRandom create the Random instances l the length of the generated random code
func (*Random) LowerLetter ¶ added in v1.0.3
LowerLetter the random code generation only contain lowercase letters
func (*Random) NumberAndLetter ¶ added in v1.0.3
NumberAndLetter generated contains Numbers and letters (case-insensitive) random code
func (*Random) Source ¶ added in v1.0.3
Source from the specified data source to generate random codes
func (*Random) UpperLetter ¶ added in v1.0.3
UpperLetter the random code generation only contains uppercase letters
type S ¶
type S string
S Provide a string conversions
func (S) DefaultFloat32 ¶
DefaultFloat32 Convert string to float32
func (S) DefaultFloat64 ¶
DefaultFloat64 Convert string to float64
func (S) DefaultInt64 ¶
DefaultInt64 Convert string to int64
func (S) DefaultTime ¶
DefaultTime Convert string to time, If conversion errors,return time.Now()
func (S) DefaultUint64 ¶
DefaultUint64 Convert string to Uint64