filecache

package
v0.0.0-...-98a29f8 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir_Exists

func Dir_Exists(path string) bool

func Sha1Hash

func Sha1Hash(text string) string

Types

type FileCache

type FileCache struct {
	sync.RWMutex
	Option
	// contains filtered or unexported fields
}

FileCache 是一个用于缓存文件内容的结构体

func New

func New(opt *Option) *FileCache

NewFileCache 创建一个新的 FileCache 实例

func (*FileCache) Add

func (e *FileCache) Add(key string, data string) error

GetFile 从缓存中获取文件内容,如果不存在,则读取文件并缓存

func (*FileCache) Count

func (e *FileCache) Count(key string) int

func (*FileCache) Data

func (e *FileCache) Data() map[string]map[string]int

func (*FileCache) Get

func (e *FileCache) Get(key string) map[string]int

func (*FileCache) Has

func (e *FileCache) Has(key string, v string) bool

type Option

type Option struct {
	Timeout   int64
	Path      string
	Extension string
}

Jump to

Keyboard shortcuts

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