Versions in this module Expand all Collapse all v1 v1.0.0 Aug 18, 2023 Changes in this version + func AfterCreate(cache *Gorm2Cache) func(db *gorm.DB) + func AfterDelete(cache *Gorm2Cache) func(db *gorm.DB) + func AfterQuery(cache *Gorm2Cache) func(db *gorm.DB) + func AfterUpdate(cache *Gorm2Cache) func(db *gorm.DB) + func BeforeQuery(cache *Gorm2Cache) func(db *gorm.DB) + func NewRedisConfigWithClient(client *redis.Client) *config.RedisConfig + func NewRedisConfigWithOptions(options *redis.Options) *config.RedisConfig + type Gorm2Cache struct + Config *config.CacheConfig + InstanceId string + Logger config.LoggerInterface + func NewGorm2Cache(cacheConfig *config.CacheConfig) (*Gorm2Cache, error) + func (c *Gorm2Cache) AttachToDB(db *gorm.DB) + func (c *Gorm2Cache) BatchGetPrimaryCache(ctx context.Context, tableName string, primaryKeys []string) ([]string, error) + func (c *Gorm2Cache) BatchInvalidatePrimaryCache(ctx context.Context, tableName string, primaryKeys []string) error + func (c *Gorm2Cache) BatchPrimaryKeyExists(ctx context.Context, tableName string, primaryKeys []string) (bool, error) + func (c *Gorm2Cache) BatchSetPrimaryKeyCache(ctx context.Context, tableName string, kvs []util.Kv) error + func (c *Gorm2Cache) GetHitCount() int64 + func (c *Gorm2Cache) GetSearchCache(ctx context.Context, tableName string, sql string, vars ...any) (string, error) + func (c *Gorm2Cache) IncrHitCount() + func (c *Gorm2Cache) Init() error + func (c *Gorm2Cache) Initialize(db *gorm.DB) (err error) + func (c *Gorm2Cache) InvalidateAllPrimaryCache(ctx context.Context, tableName string) error + func (c *Gorm2Cache) InvalidatePrimaryCache(ctx context.Context, tableName string, primaryKey string) error + func (c *Gorm2Cache) InvalidateSearchCache(ctx context.Context, tableName string) error + func (c *Gorm2Cache) Name() string + func (c *Gorm2Cache) ResetCache() error + func (c *Gorm2Cache) ResetHitCount() + func (c *Gorm2Cache) SearchKeyExists(ctx context.Context, tableName string, SQL string, vars ...any) (bool, error) + func (c *Gorm2Cache) SetSearchCache(ctx context.Context, cacheValue string, tableName string, sql string, ...) error