Documentation ¶
Overview ¶
*********************************************************
- Author : Michael
- Email : dolotech@163.com
- Last modified : 2016-04-30 09:40
- Filename : debug.go
- Description :
- ******************************************************
线程安全的数组封装,注意:写锁接口不能嵌套调用,比如:Range接口不能调用删除接口Del
Index ¶
- Constants
- Variables
- func AalidataPwd(name string) (b bool)
- func AccountRegexp(account string) bool
- func Base62decode(base62 string) uint64
- func Base62encode(num uint64) string
- func BytesToInt(b []byte) int
- func BytesToInt64(b []byte) int64
- func Clone(dst, src interface{}) error
- func DateStr() string
- func Day() int
- func Decode(data []byte, to interface{}) error
- func Decrypt(data []byte, key []byte) []byte
- func Dump(v interface{})
- func EmailRegexp(mail string) bool
- func Encode(data interface{}) ([]byte, error)
- func Encrypt(data []byte, key []byte) []byte
- func GCSummary() string
- func GetAuth() []rune
- func InetToaton(ipnr string) uint32
- func InetTobton(ipnr net.IP) uint32
- func InetTontoa(ipnr uint32) net.IP
- func Int64ToBytes(n int64) []byte
- func IntToBytes(n int) []byte
- func LegalName(name string, maxcount int) bool
- func Md5(text string) string
- func Month() time.Month
- func MonthDays(year int, month int) (days int)
- func PhoneRegexp(phone string) bool
- func RandInt32() (r int32)
- func RandInt32N(n int32) (r int32)
- func RandInt64() (r int64)
- func RandInt64N(n int64) (r int64)
- func RandUint32() (r uint32)
- func Sdump(v interface{}) string
- func Sleep(second int)
- func Sleep64(second int64)
- func SleepRand(second int)
- func SleepRand64(second int64)
- func SliceIndexOf(arr []string, str string) int
- func SliceLastIndexOf(arr []string, str string) int
- func SliceRemoveFormSlice(oriArr []string, removeArr []string) []string
- func Str2Unix(t string) (int64, error)
- func StringAdd(numStr string) string
- func Struct2Map(obj interface{}) map[string]interface{}
- func SubStr(str string, begin, length int) (substr string)
- func TimeToHeadphpoto(t int64, userid int, headname int64) (string, string)
- func TimeToPhpotoPath(t int64, userid int) string
- func Timestamp() int64
- func TimestampNano() int64
- func TimestampSaturday() int64
- func TimestampToday() int64
- func TimestampTomorrow() int64
- func TimestampYesterday() int64
- func Unix2Day(t int64) int
- func Unix2Month(t int64) time.Month
- func Unix2Str(t int64) string
- func Unix2Year(t int64) int
- func UseridCovToInvate(userid string) uint32
- func Weekday() time.Weekday
- func Year() int
- type AesEncrypt
- type Array
- type List
- func (this *List) Add(value interface{})
- func (this *List) Del(value interface{})
- func (this *List) Delete(f func(interface{}) bool)
- func (this *List) Get(f func(interface{}) bool) interface{}
- func (this *List) LRange(f func(interface{}) bool)
- func (this *List) Len() int
- func (this *List) Pure()
- func (this *List) Range(f func(interface{}) bool)
- func (this *List) Replace(value interface{}, f func(interface{}) bool)
- type Map
- func (this *Map) Del(key interface{})
- func (this *Map) Exist(key interface{}) bool
- func (this *Map) Get(key interface{}) interface{}
- func (this *Map) Iter() <-chan interface{}
- func (this *Map) LRange(f func(interface{}, interface{}) bool)
- func (this *Map) Len() int
- func (this *Map) Range(f func(interface{}, interface{}) bool)
- func (this *Map) Set(key interface{}, value interface{}) bool
- type Queue
- type RPCConfig
- type TimeOuter
- type Timer
- type TimerManager
- type TimerQueue
Constants ¶
const FORMAT string = "2006-01-02 15:04:05"
const FORMATDATA string = "2006-01-02 "
Variables ¶
var IllegalNameRune = [13]rune{0x00, 0x09, 0x5f, 0x20, 0x22, 0x60, 0x1a, 0x0a, 0x0d, 0x27, 0x25, 0x5c, 0x2c}
不可见字符,用于用户提交的字符过滤分别对应为:,\0 \t _ space " ` ctrl+z \n \r ` % \ ,
Functions ¶
func Base62decode ¶
func Base62encode ¶
func Decrypt ¶
Decrypt the data with key. data is the bytes to be decrypted. key is the decrypted key. It is the same as the encrypt key.
func Dump ¶
func Dump(v interface{})
Print to standard out the value that is passed as the argument with indentation. Pointers are dereferenced.
func Encrypt ¶
Encrypt the data with key. data is the bytes to be encrypted. key is the encrypt key. It is the same as the decrypt key.
func InetToaton ¶
点分结构的IP地址转成数值类型 eg: t.Log((InetToaton("192.168.1.190")))
func InetTobton ¶
字节类型的IP地址转成数值类型 t.Log((InetTobton(net.IPv4(192,168,1,190))))
func InetTontoa ¶
数值类型转成点分结构的IP地址 eg: t.Log((InetTontoa(3232235966).String()))
func Md5 ¶
md5 加密
func Md5(text string) string { hashMd5 := md5.New() io.WriteString(hashMd5, text) return fmt.Sprintf("%x", hashMd5.Sum(nil)) }
func RandInt32N ¶
func RandInt64N ¶
func RandUint32 ¶
func RandUint32() (r uint32)
func Sdump ¶
func Sdump(v interface{}) string
Return the value that is passed as the argument with indentation. Pointers are dereferenced.
func SliceRemoveFormSlice ¶
字节转换成整形
func Struct2Map ¶
func Struct2Map(obj interface{}) map[string]interface{}
func TimeToHeadphpoto ¶
把时间戳转换成头像存储目录
func UseridCovToInvate ¶
Types ¶
type AesEncrypt ¶
type AesEncrypt struct {
// contains filtered or unexported fields
}
func (*AesEncrypt) Decrypt ¶
func (this *AesEncrypt) Decrypt(src []byte) (strDesc []byte, err error)
解密字符串
func (*AesEncrypt) SetKey ¶
func (this *AesEncrypt) SetKey(key []byte)
type Array ¶
type Array interface { //Push 向链表尾部添加一个或者多个元素 Push(values ...interface{}) // Pop 从列表尾部移除并返回一个元素 Pop() interface{} //PushFront 向链表头部添加一个元素 PushFront(values ...interface{}) // PopFront从链表头部移除并返回一个元素 PopFront() interface{} // Len 返回集链表元素的长度 Len() int // Values 返回链表所有元素组成的 Slice Values() []interface{} // Iter 遍历链表的所有元素 Iter() <-chan interface{} // Clear 清空链表 Clear() }
type TimerManager ¶
type TimerManager struct {
// contains filtered or unexported fields
}
func NewTimerManager ¶
func NewTimerManager(size int) *TimerManager
func (*TimerManager) AddTimer ¶
func (this *TimerManager) AddTimer(i TimeOuter, e int64, iv int64) uint32
func (*TimerManager) RemoveTimer ¶
func (this *TimerManager) RemoveTimer(id uint32)
func (*TimerManager) Run ¶
func (this *TimerManager) Run(now int64, limit int)
type TimerQueue ¶
type TimerQueue []*Timer
func (TimerQueue) Len ¶
func (this TimerQueue) Len() int
func (TimerQueue) Less ¶
func (this TimerQueue) Less(i, j int) bool
func (*TimerQueue) Pop ¶
func (this *TimerQueue) Pop() interface{}
func (*TimerQueue) Push ¶
func (this *TimerQueue) Push(x interface{})
func (TimerQueue) Swap ¶
func (this TimerQueue) Swap(i, j int)