Documentation ¶
Index ¶
- Variables
- type BooleanKV
- type Counter
- type Counters
- type Database
- func (db *Database) BooleanKV(key string) *BooleanKV
- func (db *Database) Counters(key string) *Counters
- func (db *Database) DirectClient() *redis.Client
- func (db *Database) FlushAllKeysFromDatabase() error
- func (db *Database) Int32KV(key string) *Int32KV
- func (db *Database) Int64KV(key string) *Int64KV
- func (db *Database) Int64Set(key string) *Int64Set
- func (db *Database) ProtoHash(key string) *ProtoHash
- func (db *Database) ProtoKV(key string) *ProtoKV
- func (db *Database) ProtoList(key string) *ProtoList
- func (db *Database) PubSub(name string) *PubSub
- func (db *Database) StringKV(key string) *StringKV
- func (db *Database) StringsList(key string) *StringsList
- func (db *Database) StringsSet(key string) *StringsSet
- func (db *Database) TimeKV(key string) *TimeKV
- type Int32KV
- type Int64KV
- type Int64Set
- type MultiError
- type ProtoHash
- type ProtoHashInsert
- type ProtoKV
- type ProtoList
- type PubSub
- type PubSubSubscription
- type StringKV
- type StringsList
- type StringsSet
- type TimeKV
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoSuchEntity is returned from a Get operation when there is not a model // that matches the query ErrNoSuchEntity = fmt.Errorf("redis: no such entity") )
Functions ¶
This section is empty.
Types ¶
type BooleanKV ¶ added in v1.0.0
type BooleanKV struct {
// contains filtered or unexported fields
}
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
func (*Counter) IncrementBy ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database keeps a connection to a Redis server.
func (*Database) DirectClient ¶ added in v1.0.0
DirectClient returns the underlying client of go-redis to call advanced methods not exposed through this library. Please consider to add the functionality here after it's tested to improve all the users of the library.
func (*Database) FlushAllKeysFromDatabase ¶ added in v1.2.0
FlushAllKeysFromDatabase is exposed as a simple way for tests to reset the local database. It is not intended to be run in production. It will clean up all the keys of the whole database and leav an empty canvas to fill again.
func (*Database) PubSub ¶ added in v1.11.0
PubSub returns an entrypoint to a PubSub queue in redisIt can be used to publish and receive protobuf messages.
func (*Database) StringsList ¶ added in v1.9.1
func (db *Database) StringsList(key string) *StringsList
func (*Database) StringsSet ¶ added in v1.7.0
func (db *Database) StringsSet(key string) *StringsSet
type MultiError ¶
type MultiError []error
MultiError is returned from batch operations with the error of each operation. If a batch operation does not fails this will be nil too.
func (MultiError) Error ¶
func (merr MultiError) Error() string
Error returns the composed error message with all the individual ones.
func (MultiError) HasError ¶
func (merr MultiError) HasError() bool
HasError checks if there is really an error on the list or all of them are empty.
type ProtoHash ¶
type ProtoHash struct {
// contains filtered or unexported fields
}
func (*ProtoHash) GetMulti ¶
GetMulti fetchs a list of keys from the hash. Result should be a slice of proto.Message that will be filled with the results in the same order as the keys.
func (*ProtoHash) PrepareInsert ¶
func (hash *ProtoHash) PrepareInsert() *ProtoHashInsert
type ProtoHashInsert ¶
type ProtoHashInsert struct {
// contains filtered or unexported fields
}
func (*ProtoHashInsert) Commit ¶
func (insert *ProtoHashInsert) Commit() error
type ProtoKV ¶
type ProtoKV struct {
// contains filtered or unexported fields
}
ProtoKV interacts with a protobuf value key.
type ProtoList ¶ added in v1.7.0
type ProtoList struct {
// contains filtered or unexported fields
}
type PubSub ¶ added in v1.11.0
type PubSub struct {
// contains filtered or unexported fields
}
PubSub represents a connection to a redis PubSub. It can be used to publish and receive protobuf messages.
func (*PubSub) Publish ¶ added in v1.11.0
Publish sends a new message to the server. Only subscription connected at the same time will receive the message.
func (*PubSub) Subscribe ¶ added in v1.11.0
func (pubsub *PubSub) Subscribe() *PubSubSubscription
Subscribe opens a new connection to the server and starts downloading messages.
type PubSubSubscription ¶ added in v1.11.0
type PubSubSubscription struct {
// contains filtered or unexported fields
}
PubSubSubscription stores the state of an active connection to the server.
func (*PubSubSubscription) Close ¶ added in v1.11.0
func (sub *PubSubSubscription) Close()
Close exits the connection.
type StringsList ¶ added in v1.9.0
type StringsList struct {
// contains filtered or unexported fields
}
func (*StringsList) Add ¶ added in v1.9.0
func (list *StringsList) Add(values []string) error
func (*StringsList) GetAll ¶ added in v1.9.0
func (list *StringsList) GetAll() ([]string, error)
func (*StringsList) GetRange ¶ added in v1.9.0
func (list *StringsList) GetRange(start, end int64) ([]string, error)
func (*StringsList) Len ¶ added in v1.9.0
func (list *StringsList) Len() (int64, error)
func (*StringsList) Remove ¶ added in v1.10.0
func (list *StringsList) Remove(value string) error
type StringsSet ¶ added in v1.7.0
type StringsSet struct {
// contains filtered or unexported fields
}
func (*StringsSet) Add ¶ added in v1.7.0
func (set *StringsSet) Add(values ...string) error
func (*StringsSet) Len ¶ added in v1.8.0
func (set *StringsSet) Len() (int64, error)
func (*StringsSet) Members ¶ added in v1.7.0
func (set *StringsSet) Members() ([]string, error)
func (*StringsSet) Remove ¶ added in v1.7.0
func (set *StringsSet) Remove(values ...string) error
func (*StringsSet) SortAlpha ¶ added in v1.7.0
func (set *StringsSet) SortAlpha() ([]string, error)