Documentation
¶
Index ¶
- func NewRedis(opt *Options) *sdk1.Client
- func NewRedisFull() *sdk2.Pool
- type Client
- type Expiration
- func (m *Expiration) Days(num uint32) time.Duration
- func (m *Expiration) Hours(num uint32) time.Duration
- func (m *Expiration) Minutes(num uint32) time.Duration
- func (m *Expiration) Months(num uint32) time.Duration
- func (m *Expiration) Seconds(num uint32) time.Duration
- func (m *Expiration) Weeks(num uint32) time.Duration
- type OptionFunc
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRedisFull ¶
Types ¶
type Expiration ¶
type Expiration struct {
// contains filtered or unexported fields
}
func NewExpiration ¶
func NewExpiration() *Expiration
type Options ¶
type Options struct {
//
Name string // redis alias name, for trace
Proto string //
Addr string // host = ip + port
Auth string
//
DialTimeout timeEx.Duration // connect max life time.
ReadTimeout timeEx.Duration // connect max life time.
WriteTimeout timeEx.Duration // connect max life time.
SlowLog timeEx.Duration // connect max life time.
PoolSize int
//
// Active number of items allocated by the pool at a given time.
// When zero, there is no limit on the number of items in the pool.
Active int
// Idle number of idle items in the pool.
Idle int
// Close items after remaining item for this duration. If the value
// is zero, then item items are not closed. Applications should set
// the timeout to a value less than the server's timeout.
IdleTimeout timeEx.Duration
// If WaitTimeout is set and the pool is at the Active limit, then Get() waits WatiTimeout
// until a item to be returned to the pool before returning.
WaitTimeout timeEx.Duration
// If WaitTimeout is not set, then Wait effects.
// if Wait is set true, then wait until ctx timeout, or default flase and return directly.
Wait bool
}
Click to show internal directories.
Click to hide internal directories.