Documentation ¶
Overview ¶
misc document
tools project tools.go
Index ¶
- Variables
- func BytesToInt16(b []byte) int16
- func BytesToInt16A(b []byte, offset int) int16
- func BytesToInt24(b []byte) int32
- func BytesToInt24A(b []byte, offset int) int32
- func BytesToInt32(b []byte) int32
- func BytesToInt32A(b []byte, offset int) int32
- func BytesToInt64(array []byte) int64
- func BytesToInt64A(array []byte, offset int) int64
- func BytesToUint16(array []byte) uint16
- func BytesToUint16A(array []byte, offset int) uint16
- func BytesToUint24(array []byte) uint32
- func BytesToUint24A(array []byte, offset int) uint32
- func BytesToUint32(array []byte) uint32
- func BytesToUint32A(array []byte, offset int) uint32
- func CoarseTimeNow() time.Time
- func DateTime(pattern string) string
- func Exec(command string, wait bool, args ...string) error
- func Exist(filename string) bool
- func Fill(prefix string, v interface{}) error
- func GenRSAKey(bits int) (priv_key, pub_key []byte, err error)
- func GetArray(m map[string]interface{}, key string) ([]interface{}, bool)
- func GetFloat(m map[string]interface{}, key string) (float64, bool)
- func GetInt(m map[string]interface{}, key string) (int64, bool)
- func GetMap(m map[string]interface{}, key string) (map[string]interface{}, bool)
- func GetObject(m map[string]interface{}, key string, obj interface{}) bool
- func GetRealIp(req *http.Request) string
- func GetRefererDomain(req *http.Request) string
- func GetString(m map[string]interface{}, key string) (string, bool)
- func GetUrlPath(rawurl string) string
- func HMAC_SHA256(key []byte, b []byte) []byte
- func Int16ToBytes(n int16) [2]byte
- func Int16ToBytesA(n int16, array []byte, offset int)
- func Int24ToBytes(n int32) [3]byte
- func Int24ToBytesA(n int32, array []byte, offset int)
- func Int32ToBytes(n int32) [4]byte
- func Int32ToBytesA(n int32, array []byte, offset int)
- func Int64ToBytes(n int64) [8]byte
- func Int64ToBytesA(n int64, array []byte, offset int)
- func Ip2long(ipstr string) (ip uint32)
- func Long2ip(ip uint32) string
- func MD5(b []byte) []byte
- func PutUint16_Big(b []byte, v uint16)
- func PutUint16_Little(b []byte, v uint16)
- func PutUint24_Big(b []byte, v uint32)
- func PutUint24_Little(b []byte, v uint32)
- func PutUint32_Big(b []byte, v uint32)
- func PutUint32_Little(b []byte, v uint32)
- func PutUint64_Big(b []byte, v uint64)
- func PutUint64_Little(b []byte, v uint64)
- func RSADecrypt(encrypt, priv_key []byte) (data []byte, err error)
- func RSAEncrypt(origData, pub_key []byte) (encrypt []byte, err error)
- func ReadBytes(req *http.Request) ([]byte, error)
- func ReadContent(req *http.Request) (content string, err error)
- func SHA1(b []byte) []byte
- func SHA256(b []byte) []byte
- func SHA512(b []byte) []byte
- func SleepMilliSecond(millsecond int)
- func TimeFormat(format string, t time.Time) string
- func Timestamp() string
- func TimestampByPattern(p string) string
- func URLEncode(rawurl string) string
- func UUID() string
- func Uint16ToBytes(n uint16) [2]byte
- func Uint16ToBytesA(n uint16, array []byte, offset int)
- func Uint16_Big(b []byte) uint16
- func Uint16_Little(b []byte) uint16
- func Uint24ToBytes(n uint32) [3]byte
- func Uint24ToBytesA(n uint32, array []byte, offset int)
- func Uint24_Big(b []byte) uint32
- func Uint24_Little(b []byte) uint32
- func Uint32ToBytes(n uint32) [4]byte
- func Uint32ToBytesA(n uint32, array []byte, offset int)
- func Uint32_Big(b []byte) uint32
- func Uint32_Little(b []byte) uint32
- func Uint64_Big(b []byte) uint64
- func Uint64_Little(b []byte) uint64
- type Env
- type PersistQueue
- func (q *PersistQueue) Close() error
- func (q *PersistQueue) Delete() error
- func (q *PersistQueue) Empty() error
- func (q *PersistQueue) Poll(msg interface{}) error
- func (q *PersistQueue) PollTimeout(msg interface{}, timeout time.Duration) error
- func (q *PersistQueue) Put(msg interface{}) error
- func (q *PersistQueue) Size() uint64
- type WorkerFunc
- type WorkerPool
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorTimeout = errors.New("timeout")
ErrorTimeout ....
Functions ¶
func BytesToInt16 ¶
func BytesToInt16A ¶
func BytesToInt24 ¶
func BytesToInt24A ¶
func BytesToInt32 ¶
func BytesToInt32A ¶
func BytesToInt64 ¶
func BytesToInt64A ¶
func BytesToUint16 ¶
func BytesToUint16A ¶
func BytesToUint24 ¶
func BytesToUint24A ¶
func BytesToUint32 ¶
func BytesToUint32A ¶
func GetRefererDomain ¶
func GetUrlPath ¶
func HMAC_SHA256 ¶
func Int16ToBytes ¶
func Int16ToBytesA ¶
func Int24ToBytes ¶
func Int24ToBytesA ¶
func Int32ToBytes ¶
func Int32ToBytesA ¶
func Int64ToBytes ¶
func Int64ToBytesA ¶
func PutUint16_Big ¶
func PutUint16_Little ¶
func PutUint24_Big ¶
func PutUint24_Little ¶
func PutUint32_Big ¶
func PutUint32_Little ¶
func PutUint64_Big ¶
func PutUint64_Little ¶
func SleepMilliSecond ¶
func SleepMilliSecond(millsecond int)
func TimestampByPattern ¶
func Uint16ToBytes ¶
func Uint16ToBytesA ¶
func Uint16_Big ¶
func Uint16_Little ¶
func Uint24ToBytes ¶
func Uint24ToBytesA ¶
func Uint24_Big ¶
func Uint24_Little ¶
func Uint32ToBytes ¶
func Uint32ToBytesA ¶
func Uint32_Big ¶
func Uint32_Little ¶
func Uint64_Big ¶
func Uint64_Little ¶
Types ¶
type PersistQueue ¶
type PersistQueue struct {
// contains filtered or unexported fields
}
PersistQueue ....
func NewPersistQueue ¶
func NewPersistQueue(path string, bufsize int) (*PersistQueue, error)
NewPersistQueue 创建一个持久队列,path为队列目录,bufsize为缓冲区大小,ssd硬盘单队列测试下来每秒20000左右
func (*PersistQueue) PollTimeout ¶
func (q *PersistQueue) PollTimeout(msg interface{}, timeout time.Duration) error
PollTimeout ...
Source Files ¶
Click to show internal directories.
Click to hide internal directories.