Documentation ¶
Index ¶
- func NewPool(redisURL string, options ...func(*redis.Pool)) (*redis.Pool, error)
- func RandomBase64(n int) string
- func StringsWithScores(reply any, err error) ([]string, []float64, error)
- func WithIdleTimeout(v time.Duration) func(*redis.Pool)
- func WithMaxActive(v int) func(*redis.Pool)
- func WithMaxIdle(v int) func(*redis.Pool)
- type CappedZSet
- type IntervalHash
- func (h *IntervalHash) Clear(rc redis.Conn) error
- func (h *IntervalHash) Del(rc redis.Conn, fields ...string) error
- func (h *IntervalHash) Get(rc redis.Conn, field string) (string, error)
- func (h *IntervalHash) MGet(rc redis.Conn, fields ...string) ([]string, error)
- func (h *IntervalHash) Set(rc redis.Conn, field, value string) error
- type IntervalSeries
- type IntervalSet
- type Locker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandomBase64 ¶
RandomBase64 creates a random string of the length passed in
func StringsWithScores ¶
StringsWithScores parses an array reply which is alternating pairs of strings and scores (floats)
func WithIdleTimeout ¶ added in v0.6.0
WithIdleTimeout configures how long to wait before reaping a connection
func WithMaxActive ¶ added in v0.6.0
WithMaxActive configures maximum number of concurrent connections to allow
func WithMaxIdle ¶ added in v0.6.0
WithMaxIdle configures the maximum number of idle connections to keep
Types ¶
type CappedZSet ¶
type CappedZSet struct {
// contains filtered or unexported fields
}
CappedZSet is a sorted set but enforces a cap on size
func NewCappedZSet ¶
func NewCappedZSet(key string, cap int, expire time.Duration) *CappedZSet
NewCappedZSet creates a new capped sorted set
type IntervalHash ¶
type IntervalHash struct {
// contains filtered or unexported fields
}
IntervalHash operates like a hash map but with expiring intervals
func NewIntervalHash ¶
func NewIntervalHash(keyBase string, interval time.Duration, size int) *IntervalHash
NewIntervalHash creates a new empty interval hash
func (*IntervalHash) Clear ¶ added in v0.5.0
func (h *IntervalHash) Clear(rc redis.Conn) error
Clear removes all fields
func (*IntervalHash) Del ¶ added in v0.5.0
func (h *IntervalHash) Del(rc redis.Conn, fields ...string) error
Del removes the given fields
type IntervalSeries ¶
type IntervalSeries struct {
// contains filtered or unexported fields
}
IntervalSeries returns all values from interval based hashes.
func NewIntervalSeries ¶
func NewIntervalSeries(keyBase string, interval time.Duration, size int) *IntervalSeries
NewIntervalSeries creates a new empty series
type IntervalSet ¶
type IntervalSet struct {
// contains filtered or unexported fields
}
IntervalSet operates like a set but with expiring intervals
func NewIntervalSet ¶
func NewIntervalSet(keyBase string, interval time.Duration, size int) *IntervalSet
NewIntervalSet creates a new empty interval set
func (*IntervalSet) Add ¶
func (s *IntervalSet) Add(rc redis.Conn, member string) error
Add adds the given value
func (*IntervalSet) Clear ¶ added in v0.5.0
func (s *IntervalSet) Clear(rc redis.Conn) error
Clear removes all values
type Locker ¶
type Locker struct {
// contains filtered or unexported fields
}
Locker is a lock implementation where grabbing returns a lock value and that value must be used to release or extend the lock.
func (*Locker) Extend ¶
Extend extends our lock expiration by the passed in number of seconds provided the lock value is correct