cache

package
v0.0.0-...-b60b3b5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2018 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndStore

func CheckAndStore(uri string, resp *http.Response)

CheckAndStore checks resp and then store it of specific uri.

func Clear

func Clear(d time.Duration)

Clear refresh cache box in d.

func Delete

func Delete(uri string)

Delete deletes an item of specific uri.

func Register

func Register(box Box)

Register registers a cache box in global.

Types

type Box

type Box interface {
	Get(uri string) Item
	Delete(uri string)
	CheckAndStore(uri string, resp *http.Response)
	Clear(d time.Duration)
}

Box stores http get response cache

type Item

type Item interface {
	Verify() bool
	WriteTo(rw http.ResponseWriter) (int, error)
}

Item represent a http get response cache

func Get

func Get(uri string) Item

Get gets an item of specific uri.

Directories

Path Synopsis
Package redis handlers http web cache.
Package redis handlers http web cache.

Jump to

Keyboard shortcuts

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