Documentation

Index

Constants

View Source
const (
	// HeaderCacheControl as in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
	HeaderCacheControl = "Cache-Control"
	// HeaderExpires as in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires
	HeaderExpires = "Expires"
	// HeaderLastModified as in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified
	HeaderLastModified = "Last-Modified"
	// HeaderIfModifiedSince as in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since
	HeaderIfModifiedSince = "If-Modified-Since"
)

Variables

This section is empty.

Functions

func FormatTime

func FormatTime(t time.Time) string

FormatTime format time

func ParseTime

func ParseTime(raw string) time.Time

ParseTime parse time

Types

type CacheData

type CacheData struct {
	LastModified string
	Body         []byte
	Head         Head
}

CacheData cache data

type Head struct {
	StatusCode int
	Header     http.Header
}

Head ...

type Pragma

type Pragma struct {
	IfModifiedSince time.Time
	LastModified    time.Time
	NoCache         bool
	MaxAge          time.Duration
	Expires         time.Time
}

Pragma handle pragmatic information/directives for caching

func CreatePragma

func CreatePragma(header http.Header) *Pragma

CreatePragma to create new instance of CacheControl from request

func (*Pragma) Header

func (c *Pragma) Header() http.Header

Header set header

func (*Pragma) String

func (c *Pragma) String() string

type Store

type Store struct {
	*redis.Client
	DefaultMaxAge time.Duration
	PrefixKey     string
}

Store ...

func (*Store) Middleware

func (s *Store) Middleware(next echo.HandlerFunc) echo.HandlerFunc

Middleware ...

Source Files