cache

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ContextKey = "cache"

Variables

This section is empty.

Functions

func AddToRequest

func AddToRequest(c QueryCache, fn http.HandlerFunc) http.HandlerFunc

func IsOnRequest

func IsOnRequest(r *http.Request) bool

func Middleware

func Middleware(c QueryCache) mux.MiddlewareFunc

func NewMemoryCache

func NewMemoryCache() memoryCache

Types

type QueryCache

type QueryCache interface {
	Save(method string, params interface{}, r interface{})
	Retrieve(method string, params interface{}) interface{}
	Count() int
	// contains filtered or unexported methods
}

QueryCache caches Query responses

func FromRequest

func FromRequest(r *http.Request) QueryCache

Jump to

Keyboard shortcuts

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