Documentation ¶
Index ¶
Constants ¶
View Source
const (
PROTOCOL = "tcp" //connection protocol
)
View Source
const TTL = 604800 //key expire time one week
Variables ¶
Functions ¶
func NewPool ¶
func NewPool(serverAddr string, password string, IdleTimeout time.Duration, MaxIdle, MaxActive int) *redis.Pool
*
- Redis Pool *
- serverAddr the server address 127.0.0.1:6379
- password password 127.0.0.1:6379:password
- IdleTimeout 超时
- MaxIdle 连接池最大容量
- MaxActive 最大活跃数量
- dbno 选择db127.0.0.1:6379:password:1 *
Types ¶
type IdGenerator ¶
func New ¶
func New() *IdGenerator
func (*IdGenerator) GetId ¶
func (m *IdGenerator) GetId(count int, business_name, day string) (int64, error)
func (*IdGenerator) GetIdHandler ¶
func (m *IdGenerator) GetIdHandler(w http.ResponseWriter, r *http.Request)
func (*IdGenerator) Initialize ¶
func (m *IdGenerator) Initialize() error
func (*IdGenerator) Uninitialize ¶
func (m *IdGenerator) Uninitialize() error
Click to show internal directories.
Click to hide internal directories.