Versions in this module Expand all Collapse all v1 v1.0.0 Aug 18, 2021 Changes in this version + var DefaultCollectionOptions = CollectionOptions + var DefaultPoolOptions = PoolOptions + func Interfaces(in interface{}) []interface + type Action struct + type Collection struct + func (c *Collection) Count() (int, error) + func (c *Collection) Delete(id string) (bool, error) + func (c *Collection) DeleteAll() (int, error) + func (c *Collection) Exists(id string) (bool, error) + func (c *Collection) FieldIndexKey(fieldName string) (string, error) + func (c *Collection) FieldNames() []string + func (c *Collection) FieldRedisNames() []string + func (c *Collection) Find(id string, model Model) error + func (c *Collection) FindAll(models interface{}) error + func (c *Collection) FindFields(id string, fieldNames []string, model Model) error + func (c *Collection) IndexKey() string + func (c *Collection) ModelKey(id string) string + func (c *Collection) Name() string + func (c *Collection) Save(model Model) error + func (c *Collection) SaveFields(fieldNames []string, model Model) error + func (collection *Collection) NewQuery() *Query + type CollectionOptions struct + FallbackMarshalerUnmarshaler MarshalerUnmarshaler + Index bool + Name string + func (options CollectionOptions) WithFallbackMarshalerUnmarshaler(fallback MarshalerUnmarshaler) CollectionOptions + func (options CollectionOptions) WithIndex(index bool) CollectionOptions + func (options CollectionOptions) WithName(name string) CollectionOptions + type MarshalerUnmarshaler interface + Marshal func(v interface{}) ([]byte, error) + Unmarshal func(data []byte, v interface{}) error + var GobMarshalerUnmarshaler MarshalerUnmarshaler = gobMarshalerUnmarshaler{} + var JSONMarshalerUnmarshaler MarshalerUnmarshaler = jsonMarshalerUnmarshaler{} + type Model interface + ModelID func() string + SetModelID func(string) + func Models(in interface{}) []Model + type ModelNotFoundError struct + Collection *Collection + Msg string + func (e ModelNotFoundError) Error() string + type Pool struct + func NewPool(address string) *Pool + func NewPoolWithOptions(options PoolOptions) *Pool + func (p *Pool) Close() error + func (p *Pool) NewCollection(model Model) (*Collection, error) + func (p *Pool) NewCollectionWithOptions(model Model, options CollectionOptions) (*Collection, error) + func (p *Pool) NewConn() redis.Conn + func (p *Pool) NewTransaction() *Transaction + type PoolOptions struct + Address string + Database int + IdleTimeout time.Duration + MaxActive int + MaxIdle int + Network string + Password string + Wait bool + func (options PoolOptions) WithAddress(address string) PoolOptions + func (options PoolOptions) WithDatabase(database int) PoolOptions + func (options PoolOptions) WithIdleTimeout(timeout time.Duration) PoolOptions + func (options PoolOptions) WithMaxActive(maxActive int) PoolOptions + func (options PoolOptions) WithMaxIdle(maxIdle int) PoolOptions + func (options PoolOptions) WithNetwork(network string) PoolOptions + func (options PoolOptions) WithPassword(password string) PoolOptions + func (options PoolOptions) WithWait(wait bool) PoolOptions + type Query struct + func (q *Query) Count() (int, error) + func (q *Query) Exclude(fields ...string) *Query + func (q *Query) Filter(filterString string, value interface{}) *Query + func (q *Query) IDs() ([]string, error) + func (q *Query) Include(fields ...string) *Query + func (q *Query) Limit(amount uint) *Query + func (q *Query) Offset(amount uint) *Query + func (q *Query) Order(fieldName string) *Query + func (q *Query) Run(models interface{}) error + func (q *Query) RunOne(model Model) error + func (q *Query) StoreIDs(destKey string) error + func (q Query) String() string + type RandomID struct + ID string + func (r *RandomID) ModelID() string + func (r *RandomID) SetModelID(id string) + type ReplyHandler func(reply interface{}) error + func NewScanBoolHandler(b *bool) ReplyHandler + func NewScanFloat64Handler(f *float64) ReplyHandler + func NewScanIntHandler(i *int) ReplyHandler + func NewScanModelHandler(fieldNames []string, model Model) ReplyHandler + func NewScanModelsHandler(collection *Collection, fieldNames []string, models interface{}) ReplyHandler + func NewScanStringHandler(s *string) ReplyHandler + func NewScanStringsHandler(strings *[]string) ReplyHandler + type Transaction struct + func (t *Transaction) Command(name string, args redis.Args, handler ReplyHandler) + func (t *Transaction) Count(c *Collection, count *int) + func (t *Transaction) Delete(c *Collection, id string, deleted *bool) + func (t *Transaction) DeleteAll(c *Collection, count *int) + func (t *Transaction) DeleteModelsBySetIDs(setKey string, collectionName string, handler ReplyHandler) + func (t *Transaction) Exec() error + func (t *Transaction) Exists(c *Collection, id string, exists *bool) + func (t *Transaction) ExtractIDsFromFieldIndex(setKey string, destKey string, min interface{}, max interface{}) + func (t *Transaction) ExtractIDsFromStringIndex(setKey, destKey, min, max string) + func (t *Transaction) Find(c *Collection, id string, model Model) + func (t *Transaction) FindAll(c *Collection, models interface{}) + func (t *Transaction) FindFields(c *Collection, id string, fieldNames []string, model Model) + func (t *Transaction) Save(c *Collection, model Model) + func (t *Transaction) SaveFields(c *Collection, fieldNames []string, model Model) + func (t *Transaction) Script(script *redis.Script, args redis.Args, handler ReplyHandler) + func (t *Transaction) Watch(model Model) error + func (t *Transaction) WatchKey(key string) error + func (tx *Transaction) Query(collection *Collection) *TransactionQuery + type TransactionQuery struct + func (q *TransactionQuery) Count(count *int) + func (q *TransactionQuery) Exclude(fields ...string) *TransactionQuery + func (q *TransactionQuery) Filter(filterString string, value interface{}) *TransactionQuery + func (q *TransactionQuery) IDs(ids *[]string) + func (q *TransactionQuery) Include(fields ...string) *TransactionQuery + func (q *TransactionQuery) Limit(amount uint) *TransactionQuery + func (q *TransactionQuery) Offset(amount uint) *TransactionQuery + func (q *TransactionQuery) Order(fieldName string) *TransactionQuery + func (q *TransactionQuery) Run(models interface{}) + func (q *TransactionQuery) RunOne(model Model) + func (q *TransactionQuery) StoreIDs(destKey string) + func (q TransactionQuery) String() string + type WatchError struct + func (e WatchError) Error() string