Documentation ¶
Index ¶
- Constants
- func CurMillisecond() int64
- func DrainChannel(ch reflect.Value, expire time.Time) bool
- func Duplicate(src interface{}, dst interface{}) error
- func Perm(n int32) []int32
- func PermArray(array []int32) []int32
- func ProcTime(t string) (int64, bool)
- func ToJsonBytes(v interface{}) []byte
- func ToJsonString(v interface{}) string
- func ToObj(b []byte, dst interface{}) error
- func ToValues(vs ...interface{}) []reflect.Value
Constants ¶
View Source
const ( X_MinuteSec int64 = 60 X_HourSec int64 = 60 * 60 // hour sec X_DaySec int64 = X_HourSec * 24 // day sec X_DayMilliSec int64 = X_DaySec * 1000 // day millisec X_TimeZone_ModSec int64 = X_HourSec * 8 // 8 hours )
////////////////////////////////////////////////////////////////////////////
Variables ¶
This section is empty.
Functions ¶
func CurMillisecond ¶
func CurMillisecond() int64
////////////////////////////////////////////////////////////////////////////
func DrainChannel ¶
DrainChannel waits for the channel to finish emptying (draining) for up to the expiration. It returns true if the drain completed (the channel is empty), false otherwise.
func ToJsonBytes ¶
func ToJsonBytes(v interface{}) []byte
func ToJsonString ¶
func ToJsonString(v interface{}) string
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
caches
|
|
tempcache
有有效期的cache:每条记录有单独到有效期, 获取记录时判断是否有效, 失效则重新获取
|
有有效期的cache:每条记录有单独到有效期, 获取记录时判断是否有效, 失效则重新获取 |
timercache
定时更新cache: 每类cache有一个更新时间, 到期后, 整体更新该类数据
|
定时更新cache: 每类cache有一个更新时间, 到期后, 整体更新该类数据 |
计数器: 调用自增接口时, 如果与记录中key相同则增加记录中计数, 否则重新计数 例: 限制每分钟(秒钟)接口访问次数, 以时间为参数调用自增接口, 根据返回值判断是否到上限
|
计数器: 调用自增接口时, 如果与记录中key相同则增加记录中计数, 否则重新计数 例: 限制每分钟(秒钟)接口访问次数, 以时间为参数调用自增接口, 根据返回值判断是否到上限 |
dbs
|
|
mgo
* Create by SunXiguang 2018-12-28 Desc: mongodb命令定义
|
* Create by SunXiguang 2018-12-28 Desc: mongodb命令定义 |
redis
redis命令常量定义
|
redis命令常量定义 |
redis/redix
redis常用接口封装
|
redis常用接口封装 |
读取本地配置文件.
|
读取本地配置文件. |
Package lru implements an LRU cache.
|
Package lru implements an LRU cache. |
协程安全的list(对contain/list进行封装)
|
协程安全的list(对contain/list进行封装) |
字符串和数字排序 1.如果能转成数字, 则转成数字比较;2.数字排在字符串前;3.升序排列
|
字符串和数字排序 1.如果能转成数字, 则转成数字比较;2.数字排在字符串前;3.升序排列 |
zips
|
|
zk配置,需要外部进行初始化
|
zk配置,需要外部进行初始化 |
Click to show internal directories.
Click to hide internal directories.