cache

package
v3.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheInterface

type CacheInterface interface {
	ServeCached(w http.ResponseWriter, r *http.Request, key string, handler RecacheHandler)
	DeleteCache(key string)
	Cache(key string, body io.Reader)
	Has(key string) bool
	Close()
}

func FromConfig

func FromConfig(c *config.CacheConfig) (cache CacheInterface, err error)

create cache from config structure

func NewFileCache

func NewFileCache() CacheInterface

func NewNullCache

func NewNullCache() CacheInterface

type FileCache

type FileCache struct {
}

func (*FileCache) Cache

func (self *FileCache) Cache(key string, body io.Reader)

func (*FileCache) Close

func (self *FileCache) Close()

func (*FileCache) DeleteCache

func (self *FileCache) DeleteCache(key string)

func (*FileCache) Has

func (self *FileCache) Has(key string) bool

func (*FileCache) ServeCached

func (self *FileCache) ServeCached(w http.ResponseWriter, r *http.Request, key string, handler RecacheHandler)

type NullCache

type NullCache struct {
}

func (*NullCache) Cache

func (self *NullCache) Cache(key string, body io.Reader)

func (*NullCache) Close

func (self *NullCache) Close()

func (*NullCache) DeleteCache

func (self *NullCache) DeleteCache(key string)

func (*NullCache) Has

func (self *NullCache) Has(key string) bool

func (*NullCache) ServeCached

func (self *NullCache) ServeCached(w http.ResponseWriter, r *http.Request, key string, handler RecacheHandler)

type RecacheHandler

type RecacheHandler func(io.Writer) error

recache markup to io.Writer

Jump to

Keyboard shortcuts

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