Versions in this module Expand all Collapse all v0 v0.2.0 Nov 19, 2024 v0.1.0 May 13, 2024 Changes in this version + const SizeKB + const SizeMB + var DefaultCacheConfig = CacheConfig + var DefaultCacheDuration = time.Duration(0) + var DefaultCachePrefix = "cache" + func Cache() echo.MiddlewareFunc + func CacheWithConfig(config CacheConfig) echo.MiddlewareFunc + func DefaultCacheKey(prefix string, req *http.Request) string + func DefaultCacheSkipper(c echo.Context) bool + func DefaultCanCacheResponseSkipper(c echo.Context) bool + type CacheConfig struct + CacheDuration time.Duration + CacheKey CacheKeyFunc + CachePrefix string + CanCacheResponse middleware.Skipper + Encoder Encoder + Metrics Metrics + Skipper middleware.Skipper + Store store.Store + type CacheKeyFunc func(prefix string, req *http.Request) string + type Encoder interface + type JSONEncoder struct + func (e *JSONEncoder) Marshal(r *Response) ([]byte, error) + func (e *JSONEncoder) Unmarshal(b []byte, v *Response) error + type Marshaler interface + Marshal func(r *Response) ([]byte, error) + type Metrics interface + CacheError func() + CacheHits func() + CacheLatency func(latency float64) + CacheMisses func() + CacheSize func(size float64) + type MsgpackEncoder struct + func (m *MsgpackEncoder) Marshal(r *Response) ([]byte, error) + func (m *MsgpackEncoder) Unmarshal(b []byte, v *Response) error + type Response struct + Body []byte + Headers http.Header + StatusCode int + func NewResponse(code int, header http.Header, body []byte) *Response + type Unmarshaler interface + Unmarshal func(b []byte, v *Response) error