cache

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 6 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 interface {
	Set(data Expired) error
	Get(data Expired) error
}

type Expired

type Expired interface {
	CreatedAt() int64
	ExpiresIn() int16
}

Expired 过期的

type FileCache

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

func NewFileCache

func NewFileCache(path, file string) *FileCache

NewFileCache 文件缓存 path 缓存文件路径 file 文件名称

func (*FileCache) Get

func (cache *FileCache) Get(data Expired) error

Get 获取

func (*FileCache) Set

func (cache *FileCache) Set(data Expired) (err error)

Set 缓存

Jump to

Keyboard shortcuts

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