Documentation
¶
Index ¶
- Constants
- Variables
- func Black(format string, args ...interface{})
- func Blue(format string, args ...interface{})
- func Bytes2Int64(data []byte) int64
- func Bytes2String(data []byte) string
- func CreatePkcs1Keys(keyLength int) (privateKey, publicKey string)
- func CreatePkcs8Keys(keyLength int) (privateKey, publicKey string)
- func Fuchsia(format string, args ...interface{})
- func Green(format string, args ...interface{})
- func HMac(key []byte, data []byte, hash crypto.Hash) string
- func Hash(data []byte, hash crypto.Hash) string
- func HashValue(key interface{}) uint32
- func Index4Bit(key interface{}, bitCount uint8) uint32
- func Index4Int16(key interface{}) int16
- func Index4Int8(key interface{}) int8
- func Index4Uint8(key interface{}) uint8
- func Ip2Long(ip string) (ipVal uint32, err error)
- func JsonDecode(data []byte, v interface{}) (err error)
- func JsonDecodeFile(filePath string, v interface{}) (err error)
- func JsonEncode(v interface{}) (data []byte, err error)
- func Long2Ip(ipVal uint32) string
- func MarshalPkcs8PrivateKey(key *rsa.PrivateKey) []byte
- func Md5(data []byte) string
- func Red(format string, args ...interface{})
- func Sha1(data []byte) string
- func YamlDecode(data []byte, v interface{}) (err error)
- func YamlDecodeFile(filePath string, v interface{}) (err error)
- func YamlEncode(v interface{}) (data []byte, err error)
- func Yellow(format string, args ...interface{})
- type Aes
- type Bitmap
- type CanHash
- type HashSet
- type I18n
- type Msg
- type Rsa
- type ShardMap
Constants ¶
View Source
const ( En = `en` ZhTw = `zh-tw` ZhCn = `zh_CN` )
Variables ¶
View Source
var ( ErrInvalidPaddingChar = errors.New(`invalid padding char`) ErrAesDecrypt = errors.New(`aes decrypt error`) )
View Source
var ( ErrMsgMapEmpty = errors.New("msgMap can not empty") ErrNoYamlFiles = errors.New("there are no `.yml` or `.yaml` files in this directory") ErrNoJsonFiles = errors.New("there are no `.json` files in this directory") )
View Source
var ( AcquireArgs = func() []interface{} { return argsPool.Get().([]interface{}) } ReleaseArgs = func(args *[]interface{}) { if args == nil { return } *args = (*args)[:0] argsPool.Put(*args) } )
View Source
var (
ErrIpV4Address = errors.New(`invalid ip v4 address`)
)
View Source
var (
SetValue = struct{}{}
)
Functions ¶
func Bytes2Int64 ¶ added in v1.0.7
func Bytes2String ¶ added in v1.0.7
func Index4Int16 ¶
func Index4Int16(key interface{}) int16
func Index4Int8 ¶
func Index4Int8(key interface{}) int8
func Index4Uint8 ¶
func Index4Uint8(key interface{}) uint8
func JsonDecode ¶
func JsonDecodeFile ¶
func JsonEncode ¶
func MarshalPkcs8PrivateKey ¶ added in v1.0.6
func MarshalPkcs8PrivateKey(key *rsa.PrivateKey) []byte
func YamlDecode ¶
func YamlDecodeFile ¶
func YamlEncode ¶
Types ¶
type Aes ¶ added in v1.0.3
type Aes struct {
// contains filtered or unexported fields
}
func (*Aes) CbcDecrypt ¶ added in v1.0.3
func (*Aes) CbcEncrypt ¶ added in v1.0.3
type Bitmap ¶
type HashSet ¶
type HashSet interface {
Add(items ...interface{}) (newNum int)
Delete(items ...interface{}) (delNum int)
Exists(item interface{}) (exists bool)
Length() (length int)
}
func NewHashSet ¶
type Rsa ¶ added in v1.0.3
type Rsa struct {
// contains filtered or unexported fields
}
func NewRsaWithPkcs1 ¶ added in v1.0.6
func NewRsaWithPkcs8 ¶ added in v1.0.6
Source Files
¶
Click to show internal directories.
Click to hide internal directories.