simplefs

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: MIT Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Factory

func Factory(simplefsCfg core.CacheProvider, logger core.Logger, stale time.Duration) (core.Storer, error)

Factory 函数创建新的 Simplefs 实例。

Types

type Simplefs

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

Simplefs 提供程序类型。

func (*Simplefs) Delete

func (provider *Simplefs) Delete(key string)

Delete 方法将删除 Simplefs 提供程序中与 key 参数对应的响应(如果存在)。

func (*Simplefs) DeleteMany

func (provider *Simplefs) DeleteMany(key string)

DeleteMany 方法将删除 Simplefs 提供程序中与 regex key 参数对应的多个响应(如果存在)。

func (*Simplefs) Get

func (provider *Simplefs) Get(key string) []byte

Get 方法返回存储在 Simplefs 中与键对应的响应。

func (*Simplefs) GetMultiLevel

func (provider *Simplefs) GetMultiLevel(key string, req *http.Request, validator *core.Revalidator) (fresh *http.Response, stale *http.Response)

GetMultiLevel 尝试加载键并检查其中一个链接键是否为 fresh/stale 候选者。

func (*Simplefs) Init

func (provider *Simplefs) Init() error

Init 方法将在启动时初始化 Simplefs 提供程序。

func (*Simplefs) ListKeys

func (provider *Simplefs) ListKeys() []string

ListKeys 方法返回现有键的列表。

func (*Simplefs) MapKeys

func (provider *Simplefs) MapKeys(prefix string) map[string]string

MapKeys 方法返回带有键和值的 map。

func (*Simplefs) Name

func (provider *Simplefs) Name() string

Name 返回存储器的名称。

func (*Simplefs) Reset

func (provider *Simplefs) Reset() error

Reset 方法将重置或关闭提供程序。

func (*Simplefs) Set

func (provider *Simplefs) Set(key string, value []byte, duration time.Duration) error

Set 方法将响应存储在 Simplefs 提供程序中。

func (*Simplefs) SetMultiLevel

func (provider *Simplefs) SetMultiLevel(baseKey, variedKey string, value []byte, variedHeaders http.Header, etag string, duration time.Duration, realKey string) error

SetMultiLevel 将响应存储到 Simplefs 中,并更新映射键以存储元数据。

func (*Simplefs) Uuid

func (provider *Simplefs) Uuid() string

Uuid 返回唯一标识符。

Directories

Path Synopsis
caddy module

Jump to

Keyboard shortcuts

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