localcache

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default group = group{}

Functions

This section is empty.

Types

type LocalCacheConfig

type LocalCacheConfig struct {
	Expiration      int         `mapstructure:"expiration" json:"expiration" yaml:"expiration"`                  // 过期时间,如果为0,则永不过期
	CleanupInterval int         `mapstructure:"cleanup-interval" json:"cleanupInterval" yaml:"cleanup-interval"` // 清理间隔,如果为0,则不执行自动清理
	Persistence     Persistance `mapstructure:"persistance" json:"persistance" yaml:"persistance"`               // 持久化
}

func (LocalCacheConfig) Load

func (lc LocalCacheConfig) Load()

type Persistance

type Persistance struct {
	Enable              bool   `mapstructure:"enable" json:"enable" yaml:"enable"`                                            // 是否启用
	PersistanceOnChange bool   `mapstructure:"persistance_on_change" json:"persistanceOnChange" yaml:"persistance_on_change"` // 数据发生改变时保存
	File                string `mapstructure:"file" json:"file" yaml:"file"`                                                  // 文件路径
	Spec                string `mapstructure:"spec" json:"spec" yaml:"spec"`                                                  // 持久化定时调度表达式,"0 */1 * * * *"
	ShowPersistanceLog  bool   `mapstructure:"show_persistance_log" json:"showPersistanceLog" yaml:"show_persistance_log"`    // 是否记录持久化的日志
}

Jump to

Keyboard shortcuts

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