Documentation ¶
Index ¶
- Variables
- type DB
- type DBOpt
- func WithBufferedQueries(c int) DBOpt
- func WithCapacity(c int) DBOpt
- func WithChannelKey(s string) DBOpt
- func WithItemKeyPattern(s string) DBOpt
- func WithListKey(s string) DBOpt
- func WithLogger(logger *log.Logger) DBOpt
- func WithPool(pool Pool) DBOpt
- func WithPubSubOpts(opts PubSubOpts) DBOpt
- func WithTTL(d time.Duration) DBOpt
- type Item
- type ItemField
- type Pool
- type PubSubOpts
- type Query
- type QueryReject
- type QueryResolve
- type Redis
- type SimpleItem
- type SimplePool
- type Statement
- type Stats
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB implements all subscriptions and updates.
type DBOpt ¶
type DBOpt func(*DB)
DBOpt configures DB.
func WithBufferedQueries ¶
WithBufferedQueries configures a capacity of queries queue.
func WithItemKeyPattern ¶
WithItemKeyPattern configures item key pattern.
type PubSubOpts ¶
PubSubOpts contains parameters for pubcub configuration.
type Query ¶
type Query interface {
// contains filtered or unexported methods
}
Query scans items to perform a request.
func QueryAll ¶
func QueryAll(resolve QueryResolve, reject QueryReject) Query
QueryAll creates a query to scan all items.
func QueryByID ¶
func QueryByID(id string, unix int64, resolve QueryResolve, reject QueryReject) Query
QueryByID creates a query to get an item by identifier. The func accepts unix timestamp if you want to query the item not older than it.
func QueryStats ¶
QueryStats creates a query to scan db statistics.
type Redis ¶
type Redis interface { Pipeline() redis.Pipeliner HGetAll(key string) *redis.StringStringMapCmd ZRangeByScoreWithScores(key string, opt redis.ZRangeBy) *redis.ZSliceCmd Subscribe(channels ...string) *redis.PubSub Eval(script string, keys []string, args ...interface{}) *redis.Cmd EvalSha(sha1 string, keys []string, args ...interface{}) *redis.Cmd ScriptExists(hashes ...string) *redis.BoolSliceCmd ScriptLoad(script string) *redis.StringCmd }
type SimpleItem ¶
SimpleItem implements Item.
func (SimpleItem) IsEmpty ¶
func (i SimpleItem) IsEmpty() bool
IsEmpty checks that the item has no fields.
func (SimpleItem) Set ¶
func (i SimpleItem) Set(name string, data []byte)
Set updates a field by name.
type SimplePool ¶
type SimplePool struct { New func() Item // contains filtered or unexported fields }
SimplePool implements Pool.
type Statement ¶
type Statement struct {
// contains filtered or unexported fields
}
Statement wraps an update and execs it.
func NewStatement ¶
NewStatement creates a new statement update.