cache

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyResponse

func CopyResponse(resp *http.Response) *http.Response

func CreateCacheKey

func CreateCacheKey(req *http.Request) string

Types

type Cache

type Cache interface {
	Get(key string) *http.Response
	Set(key string, value *http.Response)
	Delete(key string)
	Clear()
	ClearAllKeysWithPrefix(prefix string)
	Close()
}

func NewCache

func NewCache(ttl, cleanWindow time.Duration, maxCacheSizeMB int) (Cache, error)

func NewNopCache

func NewNopCache() Cache

Jump to

Keyboard shortcuts

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