cache

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2018 License: MIT Imports: 6 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 {
	sync.Mutex
	// contains filtered or unexported fields
}

Cache represents the cache.

func New

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

New creates a new cache.

func (*Cache) Close

func (c *Cache) Close() error

Close the cache.

func (*Cache) Delete

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

Delete delets a cache value.

func (*Cache) Flush

func (c *Cache) Flush() error

Flush flushes the cache.

func (*Cache) Get

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

Get gets a value from the cache and returns it or a error.

func (*Cache) Set

func (c *Cache) Set(key string, value []byte) error

Set sets a value and return a error if any.

Jump to

Keyboard shortcuts

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