gcache

package
v0.0.0-...-93b0e25 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelDisable = option.LevelDisable
	LevelModel   = option.LevelModel
	LevelSearch  = option.LevelSearch
	MinExpires   = option.MinExpires
	MaxExpires   = option.MaxExpires
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultOption

type DefaultOption = option.DefaultOption

DefaultOption .

type Plugin

type Plugin interface {
	//清库
	FlushDB() error
	//删除模型缓存
	DeleteModel(model interface{}, primarys ...interface{}) error
	//删除查询缓存
	DeleteSearch(model interface{}) error
	//insert select update delete 都会跳过缓存处理
	SkipCache() *gorm.DB

	//join 和 子查询, 需要传入模型。
	CreateRelative(...interface{}) *gorm.DB
	SetRelative(*gorm.DB, ...interface{}) *gorm.DB

	//tag
	CreateTag(...interface{}) *gorm.DB
	SetTag(*gorm.DB, ...interface{}) *gorm.DB
	Debug()
}

Plugin .

func AttachDB

func AttachDB(db *gorm.DB, opt *option.DefaultOption, rds redis.Cmdable) Plugin

AttachDB .

Directories

Path Synopsis
nolint
nolint

Jump to

Keyboard shortcuts

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