cache

package
v1.1.22 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HCacheControlKey       = "Cache-Control"
	HContentDispositionKey = "Content-Disposition"
	HContentTypeKey        = "Content-Type"
	HCacheKey              = "X-Cache"
	HLastModified          = "Last-Modified"
)

Variables

This section is empty.

Functions

func ReportCacheTime

func ReportCacheTime(start time.Time, cacheName string, op string, success bool)

Types

type Cache

type Cache interface {
	Read(cacheKey string) (*CacheContent, error)
	Write(cacheKey string, content *CacheContent) error
}

func NewFileSystemCache

func NewFileSystemCache() Cache

func NewInMemoryCache

func NewInMemoryCache() Cache

type CacheContent

type CacheContent struct {
	Content            []byte
	ContentType        string
	ContentDisposition string
	LastModified       time.Time
}

Jump to

Keyboard shortcuts

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