diskcache

package
v0.0.0-...-775d0ad Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoExpiration stops the diskcache from removing items after a given time.
	NoExpiration time.Duration = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskCache

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

DiskCache stores responses in files on disk.

func New

func New(path string, age time.Duration) *DiskCache

New returns a new DiskCache. If age is 0, the cache won't get deleted.

func (*DiskCache) Get

func (c *DiskCache) Get(key string) ([]byte, error)

Get a cached response dump.

func (*DiskCache) Set

func (c *DiskCache) Set(key string, dump []byte) error

Set a response dump.

Jump to

Keyboard shortcuts

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