Documentation ¶
Index ¶
- func NewGormRedis[T cachelayer.Table[I], I cachelayer.IDType](prefix, table, idField string, db *gorm.DB, red *redis.Client, ...) *cachelayer.RedisCache[T, I]
- func NewGormRedisFull[T cachelayer.Table[I], I cachelayer.IDType](prefix, table, idField string, db *gorm.DB, red *redis.Client, ...) cachelayer.FullCache[T, I]
- type Gorm
- func (s *Gorm[T, I]) Close() error
- func (s *Gorm[T, I]) Create(r *T) error
- func (s *Gorm[T, I]) DB() *gorm.DB
- func (s *Gorm[T, I]) Delete(ids ...I) (int64, error)
- func (s *Gorm[T, I]) Get(id I) (T, bool, error)
- func (s *Gorm[T, I]) GetBy(index cachelayer.Index) (T, bool, error)
- func (s *Gorm[T, I]) List(ids ...I) ([]T, error)
- func (s *Gorm[T, I]) ListAll() ([]T, error)
- func (s *Gorm[T, I]) ListBy(index cachelayer.Index, orderBys cachelayer.OrderBys) ([]T, error)
- func (s *Gorm[T, I]) Save(r *T) error
- func (s *Gorm[T, I]) Update(id I, values interface{}) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGormRedis ¶
func NewGormRedis[T cachelayer.Table[I], I cachelayer.IDType](prefix, table, idField string, db *gorm.DB, red *redis.Client, ttl time.Duration) *cachelayer.RedisCache[T, I]
func NewGormRedisFull ¶
func NewGormRedisFull[T cachelayer.Table[I], I cachelayer.IDType](prefix, table, idField string, db *gorm.DB, red *redis.Client, ttl time.Duration) cachelayer.FullCache[T, I]
Types ¶
type Gorm ¶
type Gorm[T cachelayer.Table[I], I cachelayer.IDType] struct { // contains filtered or unexported fields }
func (*Gorm[T, I]) ListBy ¶
func (s *Gorm[T, I]) ListBy(index cachelayer.Index, orderBys cachelayer.OrderBys) ([]T, error)
Click to show internal directories.
Click to hide internal directories.