Documentation ¶
Index ¶
- Variables
- func NewMongoRedis[T scache.Table[I], I scache.IDType](prefix, database, collection, idField string, db *mongo.Client, ...) *scache.RedisCache[T, I]
- func NewMongoRedisFull[T scache.Table[I], I scache.IDType](prefix, database, collection, idField string, db *mongo.Client, ...) *scache.FullRedisCache[T, I]
- type Mongo
- func (s *Mongo[T, I]) Close() error
- func (s *Mongo[T, I]) Create(t *T) error
- func (s *Mongo[T, I]) DB() *mongo.Client
- func (s *Mongo[T, I]) Delete(ids ...I) (int64, error)
- func (s *Mongo[T, I]) Get(id I) (T, error)
- func (s *Mongo[T, I]) GetBy(index scache.Index) (T, error)
- func (s *Mongo[T, I]) List(ids ...I) ([]T, error)
- func (s *Mongo[T, I]) ListAll() ([]T, error)
- func (s *Mongo[T, I]) ListBy(index scache.Index, orderBys scache.OrderBys) ([]T, error)
- func (s *Mongo[T, I]) ListByUniqueInts(field string, values []int64) ([]T, error)
- func (s *Mongo[T, I]) ListByUniqueStrs(field string, values []string) ([]T, error)
- func (s *Mongo[T, I]) Save(t *T) error
- func (s *Mongo[T, I]) Update(id I, values interface{}) (int64, error)
- type RedisMongo
- func (s *RedisMongo[T, I]) ClearCache(id I, indexes scache.Indexes) error
- func (s *RedisMongo[T, I]) Close() error
- func (s *RedisMongo[T, I]) Create(t *T) error
- func (s *RedisMongo[T, I]) Delete(ids ...I) (int64, error)
- func (s *RedisMongo[T, I]) Get(id I) (T, bool, error)
- func (s *RedisMongo[T, I]) GetBy(index scache.Index) (T, bool, error)
- func (s *RedisMongo[T, I]) List(ids ...I) ([]T, error)
- func (s *RedisMongo[T, I]) ListBy(index scache.Index, initOrders scache.OrderBys) ([]T, error)
- func (s *RedisMongo[T, I]) Save(t *T) error
- func (s *RedisMongo[T, I]) Update(id I, values interface{}) (int64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var MongoOpTimeout = 600 * time.Second
Functions ¶
func NewMongoRedis ¶
Types ¶
type Mongo ¶
func (*Mongo[T, I]) ListByUniqueInts ¶
func (*Mongo[T, I]) ListByUniqueStrs ¶
type RedisMongo ¶
type RedisMongo[T scache.Table[I], I string] struct { *scache.CacheBase[T, I] // contains filtered or unexported fields }
func NewRedisMongo ¶
func (*RedisMongo[T, I]) ClearCache ¶
func (s *RedisMongo[T, I]) ClearCache(id I, indexes scache.Indexes) error
func (*RedisMongo[T, I]) Close ¶
func (s *RedisMongo[T, I]) Close() error
func (*RedisMongo[T, I]) Create ¶
func (s *RedisMongo[T, I]) Create(t *T) error
func (*RedisMongo[T, I]) Delete ¶
func (s *RedisMongo[T, I]) Delete(ids ...I) (int64, error)
func (*RedisMongo[T, I]) Get ¶
func (s *RedisMongo[T, I]) Get(id I) (T, bool, error)
func (*RedisMongo[T, I]) GetBy ¶
func (s *RedisMongo[T, I]) GetBy(index scache.Index) (T, bool, error)
func (*RedisMongo[T, I]) List ¶
func (s *RedisMongo[T, I]) List(ids ...I) ([]T, error)
func (*RedisMongo[T, I]) Save ¶
func (s *RedisMongo[T, I]) Save(t *T) error
func (*RedisMongo[T, I]) Update ¶
func (s *RedisMongo[T, I]) Update(id I, values interface{}) (int64, error)
Update values type: map[string]interface{} , eg:map[string]interface{}{"addr.country": "uae", "tags.0.name": "gg"}
Click to show internal directories.
Click to hide internal directories.