...
Package leveldbcache
import "github.com/gregjones/httpcache/leveldbcache"
- Overview
- Index
Package leveldbcache provides an implementation of httpcache.Cache that
uses github.com/syndtr/goleveldb/leveldb
In the call graph viewer below, each node
is a function belonging to this package
and its children are the functions it
calls—perhaps dynamically.
The root nodes are the entry points of the
package: functions that may be called from
outside the package.
There may be non-exported or anonymous
functions among them if they are called
dynamically from another package.
Click a node to visit that function's source code.
From there you can visit its callers by
clicking its declaring func
token.
Functions may be omitted if they were
determined to be unreachable in the
particular programs or tests that were
analyzed.
type Cache struct {
}
Cache is an implementation of httpcache.Cache with leveldb storage
func New(path string) (*Cache, error)
New returns a new Cache that will store leveldb in path
func NewWithDB(db *leveldb.DB) *Cache
NewWithDB returns a new Cache using the provided leveldb as underlying
storage.
func (*Cache) Delete
func (c *Cache) Delete(key string)
Delete removes the response with key from the cache
func (*Cache) Get
func (c *Cache) Get(key string) (resp []byte, ok bool)
Get returns the response corresponding to key if present
func (*Cache) Set
func (c *Cache) Set(key string, resp []byte)
Set saves a response to the cache as key