Documentation
¶
Index ¶
- func NewPool(redisURL string, options ...func(*valkey.Pool)) (*valkey.Pool, error)
- func RandomBase64(n int) string
- func StringsWithScores(reply any, err error) ([]string, []float64, error)
- func WithIdleTimeout(v time.Duration) func(*valkey.Pool)
- func WithMaxActive(v int) func(*valkey.Pool)
- func WithMaxIdle(v int) func(*valkey.Pool)
- type CappedZSet
- type IntervalHash
- func (h *IntervalHash) Clear(ctx context.Context, vc valkey.Conn) error
- func (h *IntervalHash) Del(ctx context.Context, vc valkey.Conn, fields ...string) error
- func (h *IntervalHash) Get(ctx context.Context, vc valkey.Conn, field string) (string, error)
- func (h *IntervalHash) MGet(ctx context.Context, vc valkey.Conn, fields ...string) ([]string, error)
- func (h *IntervalHash) Set(ctx context.Context, vc valkey.Conn, field, value string) error
- type IntervalSeries
- type IntervalSet
- func (s *IntervalSet) Add(ctx context.Context, vc valkey.Conn, member string) error
- func (s *IntervalSet) Clear(ctx context.Context, vc valkey.Conn) error
- func (s *IntervalSet) IsMember(ctx context.Context, vc valkey.Conn, member string) (bool, error)
- func (s *IntervalSet) Rem(ctx context.Context, vc valkey.Conn, members ...string) error
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 ¶
WithIdleTimeout configures how long to wait before reaping a connection
func WithMaxActive ¶
WithMaxActive configures maximum number of concurrent connections to allow
func WithMaxIdle ¶
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
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