cache

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AfterQuery

func AfterQuery(cache *GormCache) func(db *gorm.DB)

func BeforeQuery

func BeforeQuery(cache *GormCache) func(db *gorm.DB)

func NewRedisConfigWithClient

func NewRedisConfigWithClient(client *redis.Client) *config.RedisConfig

Types

type GormCache

type GormCache struct {
	Config     *config.CacheConfig
	Logger     config.LoggerInterface
	InstanceId string
	// contains filtered or unexported fields
}

func NewGormCache

func NewGormCache(cacheConfig *config.CacheConfig) (*GormCache, error)

func (*GormCache) GetSearchCache

func (c *GormCache) GetSearchCache(ctx context.Context, tableName string, sql string, vars ...interface{}) (string, error)

func (*GormCache) Init

func (c *GormCache) Init() error

func (*GormCache) Initialize

func (c *GormCache) Initialize(db *gorm.DB) (err error)

func (*GormCache) Name

func (c *GormCache) Name() string

func (*GormCache) SetSearchCache

func (c *GormCache) SetSearchCache(ctx context.Context, cacheValue string, ttl int64, tableName string,
	sql string, vars ...interface{}) error

Jump to

Keyboard shortcuts

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