cache

package
v0.0.0-...-96e313d Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AfterCreate

func AfterCreate(cache *TangCache) func(db *gorm.DB)

func AfterDelete

func AfterDelete(cache *TangCache) func(db *gorm.DB)

func AfterQuery

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

func AfterUpdate

func AfterUpdate(cache *TangCache) func(db *gorm.DB)

func BeforeQuery

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

Types

type TangCache

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

func NewTangCache

func NewTangCache(cacheConfig *config.CacheConfig) (*TangCache, error)

func (*TangCache) GetSearchCache

func (c *TangCache) GetSearchCache(ctx context.Context, tableName string, sql string, p reflect.Type, args ...interface{}) (interface{}, error)

func (*TangCache) Init

func (c *TangCache) Init() error

func (*TangCache) Initialize

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

func (*TangCache) InvalidateSearchCache

func (c *TangCache) InvalidateSearchCache(ctx context.Context, tableName string) error

func (*TangCache) Name

func (c *TangCache) Name() string

func (*TangCache) SetSearchCache

func (c *TangCache) SetSearchCache(ctx context.Context, tableName string, value interface{}, sql string, args ...interface{}) error

Jump to

Keyboard shortcuts

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