gormredis

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2022 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 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]) 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, bool, error)

func (*Gorm[T, I]) GetBy

func (s *Gorm[T, I]) GetBy(index cachelayer.Index) (T, bool, 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 cachelayer.Index, orderBys cachelayer.OrderBys) ([]T, error)

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