gormredis

package
v0.0.0-...-037b08c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGormRedis

func NewGormRedis[T scache.Table[I], I scache.IDType](prefix, table, idField string, db *gorm.DB, red *redis.Client, ttl time.Duration) *scache.RedisCache[T, I]

func NewGormRedisFull

func NewGormRedisFull[T scache.Table[I], I scache.IDType](prefix, table, idField string, db *gorm.DB, red *redis.Client, ttl time.Duration) scache.FullCache[T, I]

Types

type Gorm

type Gorm[T scache.Table[I], I scache.IDType] struct {
	// contains filtered or unexported fields
}

func (*Gorm[T, I]) Close

func (s *Gorm[T, I]) Close() error

func (*Gorm[T, I]) Create

func (s *Gorm[T, I]) Create(r *T) error

func (*Gorm[T, I]) DB

func (s *Gorm[T, I]) DB() *gorm.DB

func (*Gorm[T, I]) Delete

func (s *Gorm[T, I]) Delete(ids ...I) (int64, error)

func (*Gorm[T, I]) Get

func (s *Gorm[T, I]) Get(id I) (T, error)

func (*Gorm[T, I]) GetBy

func (s *Gorm[T, I]) GetBy(index scache.Index) (T, error)

func (*Gorm[T, I]) List

func (s *Gorm[T, I]) List(ids ...I) ([]T, error)

func (*Gorm[T, I]) ListAll

func (s *Gorm[T, I]) ListAll() ([]T, error)

func (*Gorm[T, I]) ListBy

func (s *Gorm[T, I]) ListBy(index scache.Index, initOrders scache.OrderBys) ([]T, error)

func (*Gorm[T, I]) ListByUniqueInts

func (s *Gorm[T, I]) ListByUniqueInts(field string, values []int64) ([]T, error)

ListIn list objs by index field in values

func (*Gorm[T, I]) ListByUniqueStrs

func (s *Gorm[T, I]) ListByUniqueStrs(field string, values []string) ([]T, error)

ListIn list objs by index field in values

func (*Gorm[T, I]) Save

func (s *Gorm[T, I]) Save(r *T) error

func (*Gorm[T, I]) Update

func (s *Gorm[T, I]) Update(id I, values interface{}) (int64, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL