cache

package
v0.0.0-...-212a885 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache 缓存数据

func New

func New() *Cache

New 新建一个缓存

func (*Cache) Clear

func (m *Cache) Clear()

Clear 清空

func (*Cache) Each

func (m *Cache) Each(f func(key, value string) error) (err error)

Each 遍历每一个元素

func (*Cache) Get

func (m *Cache) Get(key string) (value string, ok bool)

Get 获取值

func (*Cache) Init

func (m *Cache) Init()

Init 初始化

func (*Cache) Load

func (m *Cache) Load(path string) (err error)

Load 加载缓存

func (*Cache) Save

func (m *Cache) Save(path string)

Save 保存

func (*Cache) Set

func (m *Cache) Set(key, value string, force ...bool)

Set 设置值 force 是否强制设置值

Jump to

Keyboard shortcuts

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