Versions in this module Expand all Collapse all v0 v0.0.1 Aug 1, 2019 Changes in this version + const CacheItemFileExtension + const CacheItemPrivate + const CacheItemPublic + const CacheStorageFile + const CacheStorageMemory + const VersionNo + func ExpandESI(resp *http.Response, esiTags []EsiTag, ...) (*http.Response, error) + func HTTPResponseFromBytes(b []byte) (*http.Response, error) + func HTTPResponseToBytes(r *http.Response) ([]byte, error) + func PrivateKeyFromRequest(r *http.Request, config *Config) string + func PublicKeyFromRequest(r *http.Request, config *Config) string + func WildcardCompare(original string, test string) bool + type Config struct + CacheFilePath string + CacheMaxSize map[string]map[string]int + CachePrivate bool + CacheStorageHandlers []string + CleanInterval int + InvalidateHeaders []string + ResponseMaxSize int + UseESI bool + VaryCookies []string + VaryHeaders []string + func GetDefaultConfig() Config + type EsiTag struct + Position int + URL string + func ParseESI(resp *http.Response) (*http.Response, []EsiTag, error) + type FileStorage struct + func (s *FileStorage) Delete() error + func (s *FileStorage) FetchResponse() (*http.Response, error) + func (s *FileStorage) GetSize() (int64, error) + func (s *FileStorage) GetTypeName() string + func (s *FileStorage) Init(key string, config *Config) + func (s *FileStorage) StoreResponse(r *http.Response) error + type Handler struct + CacheItems []Item + Config Config + func NewHandler(config Config, ...) Handler + func (b *Handler) Clean() + func (b *Handler) Clear() + func (b *Handler) Fetch(r *http.Request) *Item + func (b *Handler) Invalidate(req *http.Request) + func (b *Handler) OnRequest(req *http.Request) (*http.Response, error) + func (b *Handler) OnResponse(resp *http.Response) (*http.Response, error) + func (b *Handler) Store(resp *http.Response) (*Item, error) + type Item struct + Created time.Time + EsiTags []EsiTag + Hits int + InvalidateHeaders map[string][]string + Key string + LastHit time.Time + MaxAge int32 + Path string + Size int64 + Type string + func ItemFromResponse(resp *http.Response, config *Config) (Item, error) + func (i *Item) Clear() + func (i *Item) GetResponse() (*http.Response, error) + func (i *Item) GetStorageType() string + func (i *Item) HasExpired() bool + func (i *Item) LogAction(action string, desc string) + func (i *Item) MoveStorage(name string, config *Config) error + type MemoryStorage struct + func (s *MemoryStorage) Delete() error + func (s *MemoryStorage) FetchResponse() (*http.Response, error) + func (s *MemoryStorage) GetSize() (int64, error) + func (s *MemoryStorage) GetTypeName() string + func (s *MemoryStorage) Init(key string, config *Config) + func (s *MemoryStorage) StoreResponse(r *http.Response) error + type Storage interface + Delete func() error + FetchResponse func() (*http.Response, error) + GetSize func() (int64, error) + GetTypeName func() string + Init func(key string, config *Config) + StoreResponse func(r *http.Response) error + func GetStorageHandler(name string) Storage