module

package
v0.0.0-...-9be3a58 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2017 License: BSD-3-Clause Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	PROTOCOL = "tcp" //connection protocol
)
View Source
const TTL = 604800 //key expire time one week

Variables

View Source
var (
	MaxIdle     int           = 100
	MaxActive   int           = 1000
	IdleTimeout time.Duration = time.Duration(28 * time.Second)
)

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

type IdGenerator struct {
	RedisPool *redis.Pool
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL