lrufilecache

package
v0.0.0-...-99bfb04 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 10 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(key string, ci CacheItem) bool
	Get(key string) (CacheItem, bool)
	Clear()
}

type CacheItem

type CacheItem struct {
	Headers http.Header `json:"headers"`
	Content []byte      `json:"-"`
}

type LRUFileCache

type LRUFileCache struct {
	Log Logger
	// contains filtered or unexported fields
}

func NewLRUFileCache

func NewLRUFileCache(fcapacity, mcapacity int, basepath string, logger Logger) *LRUFileCache

func (*LRUFileCache) Clear

func (c *LRUFileCache) Clear()

func (*LRUFileCache) Get

func (c *LRUFileCache) Get(uri string) (CacheItem, bool)

func (*LRUFileCache) LoadAll

func (c *LRUFileCache) LoadAll()

func (*LRUFileCache) OnDeleteFunc

func (c *LRUFileCache) OnDeleteFunc(key string, _ interface{})

func (*LRUFileCache) Set

func (c *LRUFileCache) Set(uri string, ci CacheItem) bool

type Logger

type Logger interface {
	Debug(msg string)
	Info(msg string)
	Warn(msg string)
	Error(msg string)
}

Jump to

Keyboard shortcuts

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