localcache

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: Apache-2.0 Imports: 7 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 struct {
	// contains filtered or unexported fields
}

Cache is a simple unbounded disk cache and is safe for concurrency.

func NewCache

func NewCache(root string) *Cache

NewCache creates a new cache.

func (*Cache) Clear

func (c *Cache) Clear() error

Clear clears the cache.

func (*Cache) Delete

func (c *Cache) Delete(key string) error

Delete deletes a key/value pair.

func (*Cache) Get

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

Get gets a key's value by returning an io.ReadCloser that should be closed when done.

func (*Cache) Keys

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

Keys returns the keys in sorted order.

func (*Cache) Put

func (c *Cache) Put(key string, value io.Reader) (retErr error)

Put puts a key/value pair in the cache and reads the value from an io.Reader.

Jump to

Keyboard shortcuts

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