Documentation ¶
Overview ¶
Package storage contains helper functions & structs for high-level work with Redis
Index ¶
- Constants
- type Client
- func (storage *Client) AddToSet(key string, values ...[]byte) error
- func (storage *Client) Cardinality(key string) (int, error)
- func (storage *Client) Delete(keys ...string) (int, error)
- func (storage *Client) Expire(key string, ttl interface{}) error
- func (storage *Client) FieldExist(key, field string) (bool, error)
- func (storage *Client) Get(key string) ([]byte, error)
- func (storage *Client) GetAllFromSet(key string) ([][]byte, error)
- func (storage *Client) GetField(key, field string) ([]byte, error)
- func (storage *Client) GetFields(keyAndFields ...string) (map[string][]byte, error)
- func (storage *Client) GetValues(key string) ([][]byte, error)
- func (storage *Client) Increment(key string, delta int) (int, error)
- func (storage *Client) IncrementField(key, field string, delta int) (int, error)
- func (storage *Client) IsMemberOfSet(key string, value []byte) (bool, error)
- func (storage *Client) Keys(template string) ([]string, error)
- func (storage *Client) MultiGet(keys ...string) ([][]byte, error)
- func (storage *Client) Publish(key string, value []byte) error
- func (storage *Client) RemoveFields(keyAndFields ...string) error
- func (storage *Client) RemoveFromSet(key string, values ...[]byte) error
- func (storage *Client) Set(key string, value []byte) error
- func (storage *Client) SetField(key, field string, value []byte) error
- func (storage *Client) SetFields(key string, hash map[string]interface{}) error
- func (storage *Client) StoreUnionSet(key string, keys ...string) (int, error)
- type Configuration
- type Iterator
- type Option
- type Setter
- type TTL
Constants ¶
View Source
const ( START = "0" SCAN = "SCAN" SSCAN = "SSCAN" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { KeyTTL interface{} // Common key time-to-live, if set affects every key used in storage Namespace string // contains filtered or unexported fields }
func (*Client) Cardinality ¶
Cardinality see SCARD
func (*Client) FieldExist ¶
FieldExist see HEXISTS
func (*Client) GetAllFromSet ¶
GetAllFromSet see SMEMBERS
func (*Client) IncrementField ¶
IncrementField see HINCRBY
func (*Client) IsMemberOfSet ¶
IsMemberOfSet see SISMEMBER
func (*Client) Keys ¶
Keys see SCAN, it does not use KEYS because it recommended by Redis team https://redis.io/commands/keys
func (*Client) RemoveFields ¶
RemoveFields see HDEL
func (*Client) RemoveFromSet ¶
RemoveFromSet see SREM
type Configuration ¶
type Configuration struct { KeyTTL interface{} // Common key time-to-live, if set affects every key used in storage Namespace string Pool *redis.Pool Connection redis.Conn }
func ENV ¶
func ENV(prefix string) Configuration
ENV returns storage configuration from env variables
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
func NewIterator ¶
type Option ¶
type Option func(*Iterator)
func WithBatchSize ¶
func WithCursor ¶
func WithStorage ¶
func WithTemplate ¶
Click to show internal directories.
Click to hide internal directories.