Documentation ¶
Index ¶
- func FormatBool(value bool) string
- func FormatBytes(value []byte) string
- func FormatFloat32(value float32) string
- func FormatFloat64(value float64) string
- func FormatInt32(value int32) string
- func FormatInt64(value int64) string
- func FormatUint32(value uint32) string
- func FormatUint64(value uint64) string
- func ParseBool(val string) (bool, error)
- func ParseBytes(val string) ([]byte, error)
- func ParseFloat32(val string) (float32, error)
- func ParseFloat64(val string) (float64, error)
- func ParseInt32(val string) (int32, error)
- func ParseInt64(val string) (int64, error)
- func ParseUint32(val string) (uint32, error)
- func ParseUint64(val string) (uint64, error)
- type ChangedFielder
- type ListOptions
- type RedisKVStore
- func (s *RedisKVStore) Create(key string, value string) error
- func (s *RedisKVStore) Delete(key string) error
- func (s *RedisKVStore) Get(key string) (string, error)
- func (s *RedisKVStore) GetAll(keys []string, options *ListOptions) (map[string]string, error)
- func (s *RedisKVStore) List(selector string, options *ListOptions) (map[string]string, error)
- func (s *RedisKVStore) Update(key string, value string) error
- type RedisMapStore
- func (s *RedisMapStore) Create(key string, value interface{}, properties ...string) error
- func (s *RedisMapStore) Delete(key string) error
- func (s *RedisMapStore) Get(key string) (interface{}, error)
- func (s *RedisMapStore) GetAll(keys []string, options *ListOptions) ([]interface{}, error)
- func (s *RedisMapStore) GetFields(key string, fields ...string) (interface{}, error)
- func (s *RedisMapStore) List(selector string, options *ListOptions) ([]interface{}, error)
- func (s *RedisMapStore) SetBase(base interface{}, tagName string)
- func (s *RedisMapStore) SetDecoder(decoder StringStringMapDecoder)
- func (s *RedisMapStore) SetEncoder(encoder StringStringMapEncoder)
- func (s *RedisMapStore) Update(key string, value interface{}, properties ...string) error
- type RedisSetStore
- func (s *RedisSetStore) Add(key string, values ...string) error
- func (s *RedisSetStore) Contains(key string, value string) (res bool, err error)
- func (s *RedisSetStore) Delete(key string) error
- func (s *RedisSetStore) Get(key string) (res []string, err error)
- func (s *RedisSetStore) GetAll(keys []string, options *ListOptions) (map[string][]string, error)
- func (s *RedisSetStore) List(selector string, options *ListOptions) (map[string][]string, error)
- func (s *RedisSetStore) Remove(key string, values ...string) error
- type StringStringMapDecoder
- type StringStringMapEncoder
- type Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatFloat32 ¶
FormatFloat32 does what its name suggests
func FormatFloat64 ¶
FormatFloat64 does what its name suggests
func ParseBytes ¶
ParseBytes does what its name suggests
func ParseFloat32 ¶
ParseFloat32 does what its name suggests
func ParseFloat64 ¶
ParseFloat64 does what its name suggests
func ParseUint32 ¶
ParseUint32 does what its name suggests
func ParseUint64 ¶
ParseUint64 does what its name suggests
Types ¶
type ChangedFielder ¶
type ChangedFielder interface {
ChangedFields() []string
}
ChangedFielder interface is used to see what fields to update
type ListOptions ¶
ListOptions are options for all list commands
type RedisKVStore ¶
type RedisKVStore struct {
// contains filtered or unexported fields
}
RedisKVStore stores arbitrary data in Redis
func NewRedisKVStore ¶
func NewRedisKVStore(client *redis.Client, prefix string) *RedisKVStore
NewRedisKVStore creates a new RedisKVStore
func (*RedisKVStore) Create ¶
func (s *RedisKVStore) Create(key string, value string) error
Create a new record, prepending the prefix to the key if necessary
func (*RedisKVStore) Delete ¶
func (s *RedisKVStore) Delete(key string) error
Delete an existing record, prepending the prefix to the key if necessary
func (*RedisKVStore) Get ¶
func (s *RedisKVStore) Get(key string) (string, error)
Get one result, prepending the prefix to the key if necessary
func (*RedisKVStore) GetAll ¶
func (s *RedisKVStore) GetAll(keys []string, options *ListOptions) (map[string]string, error)
GetAll returns all results for the given keys, prepending the prefix to the keys if necessary
func (*RedisKVStore) List ¶
func (s *RedisKVStore) List(selector string, options *ListOptions) (map[string]string, error)
List all results matching the selector, prepending the prefix to the selector if necessary
type RedisMapStore ¶
type RedisMapStore struct {
// contains filtered or unexported fields
}
RedisMapStore stores structs as HMaps in Redis
func NewRedisMapStore ¶
func NewRedisMapStore(client *redis.Client, prefix string) *RedisMapStore
NewRedisMapStore returns a new RedisMapStore that talks to the given Redis client and respects the given prefix
func (*RedisMapStore) Create ¶
func (s *RedisMapStore) Create(key string, value interface{}, properties ...string) error
Create a new record, prepending the prefix to the key if necessary, optionally setting only the given properties
func (*RedisMapStore) Delete ¶
func (s *RedisMapStore) Delete(key string) error
Delete an existing record, prepending the prefix to the key if necessary
func (*RedisMapStore) Get ¶
func (s *RedisMapStore) Get(key string) (interface{}, error)
Get one result, prepending the prefix to the key if necessary
func (*RedisMapStore) GetAll ¶
func (s *RedisMapStore) GetAll(keys []string, options *ListOptions) ([]interface{}, error)
GetAll returns all results for the given keys, prepending the prefix to the keys if necessary
func (*RedisMapStore) GetFields ¶
func (s *RedisMapStore) GetFields(key string, fields ...string) (interface{}, error)
GetFields for a record, prepending the prefix to the key if necessary
func (*RedisMapStore) List ¶
func (s *RedisMapStore) List(selector string, options *ListOptions) ([]interface{}, error)
List all results matching the selector, prepending the prefix to the selector if necessary
func (*RedisMapStore) SetBase ¶
func (s *RedisMapStore) SetBase(base interface{}, tagName string)
SetBase sets the base struct for automatically encoding and decoding to and from Redis format
func (*RedisMapStore) SetDecoder ¶
func (s *RedisMapStore) SetDecoder(decoder StringStringMapDecoder)
SetDecoder sets the decoder to convert structs from Redis format
func (*RedisMapStore) SetEncoder ¶
func (s *RedisMapStore) SetEncoder(encoder StringStringMapEncoder)
SetEncoder sets the encoder to convert structs to Redis format
type RedisSetStore ¶
type RedisSetStore struct {
// contains filtered or unexported fields
}
RedisSetStore stores sets in Redis
func NewRedisSetStore ¶
func NewRedisSetStore(client *redis.Client, prefix string) *RedisSetStore
NewRedisSetStore creates a new RedisSetStore
func (*RedisSetStore) Add ¶
func (s *RedisSetStore) Add(key string, values ...string) error
Add one or more values to the set, prepending the prefix to the key if necessary
func (*RedisSetStore) Contains ¶
func (s *RedisSetStore) Contains(key string, value string) (res bool, err error)
Contains returns wheter the set contains a given value, prepending the prefix to the key if necessary
func (*RedisSetStore) Delete ¶
func (s *RedisSetStore) Delete(key string) error
Delete the entire set
func (*RedisSetStore) Get ¶
func (s *RedisSetStore) Get(key string) (res []string, err error)
Get one result, prepending the prefix to the key if necessary
func (*RedisSetStore) GetAll ¶
func (s *RedisSetStore) GetAll(keys []string, options *ListOptions) (map[string][]string, error)
GetAll returns all results for the given keys, prepending the prefix to the keys if necessary
func (*RedisSetStore) List ¶
func (s *RedisSetStore) List(selector string, options *ListOptions) (map[string][]string, error)
List all results matching the selector, prepending the prefix to the selector if necessary
type StringStringMapDecoder ¶
StringStringMapDecoder is used to decode a map[string]string to a struct
type StringStringMapEncoder ¶
type StringStringMapEncoder func(input interface{}, properties ...string) (map[string]string, error)
StringStringMapEncoder encodes the given properties of the input to a map[string]string for storage in Redis
type Time ¶
Time is a wrapper around time.Time that marshals and unmarshals to the time.RFC3339Nano format
func (Time) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface
func (*Time) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface