diskcache

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

diskcache

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadDir  = errors.New("invalid directory")
	ErrBadSize = errors.New("cache size must be greater then zero")

	ErrNotFound = errors.New("not found")

	ErrTooLarge = errors.New("file size must be less or equal cache size")
)

Functions

This section is empty.

Types

type Cache

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

func New

func New(dir string, sz int64) (*Cache, error)

func (*Cache) Get

func (c *Cache) Get(key string) (io.ReadCloser, error)

func (*Cache) Keys

func (c *Cache) Keys() []string

func (*Cache) Put

func (c *Cache) Put(key string, data []byte) error

type Item

type Item struct {
	Key  string
	Size int64
	Path string
}

Jump to

Keyboard shortcuts

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