option

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: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelDisable = 0 //禁止
	LevelModel   = 1 //只缓存模型
	LevelSearch  = 2 //查询缓存
	MaxExpires   = 43200
	MinExpires   = 30
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultOption

type DefaultOption struct {
	Opt
}

DefaultOption .

func (*DefaultOption) Init

func (defOpt *DefaultOption) Init()

type ModelOption

type ModelOption struct {
	Opt
}

type Opt

type Opt struct {
	Expires         int  //默认120秒,30-43200
	Level           int  //默认LevelSearch,LevelDisable:关闭,LevelModel:模型缓存, LevelSearch:查询缓存
	AsyncWrite      bool //默认false, insert update delete 成功后是否异步更新缓存
	PenetrationSafe bool //默认false, 开启防穿透。
}

Opt .

func (*Opt) GenRandExpire

func (o *Opt) GenRandExpire() int

Jump to

Keyboard shortcuts

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