Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultConfiguration = middleware.BaseConfiguration{ DefaultCache: &configurationtypes.DefaultCache{ TTL: configurationtypes.Duration{ Duration: 10 * time.Second, }, }, LogLevel: "info", } DevDefaultConfiguration = middleware.BaseConfiguration{ API: configurationtypes.API{ BasePath: "/souin-api", Prometheus: configurationtypes.APIEndpoint{ Enable: true, }, Souin: configurationtypes.APIEndpoint{ Enable: true, }, }, DefaultCache: &configurationtypes.DefaultCache{ Regex: configurationtypes.Regex{ Exclude: "/excluded", }, TTL: configurationtypes.Duration{ Duration: 5 * time.Second, }, }, LogLevel: "debug", } )
Functions ¶
func NewHTTPCacheFilter ¶
func NewHTTPCacheFilter() web.FilterChain
Types ¶
type CustomWriter ¶
type CustomWriter struct { Buf *bytes.Buffer Rw http.ResponseWriter Req *http.Request Headers http.Header // contains filtered or unexported fields }
CustomWriter handles the response and provide the way to cache the value
func (*CustomWriter) Header ¶
func (r *CustomWriter) Header() http.Header
Header will write the response headers
func (*CustomWriter) Send ¶
func (r *CustomWriter) Send() (int, error)
Send delays the response to handle Cache-Status
func (*CustomWriter) Write ¶
func (r *CustomWriter) Write(b []byte) (int, error)
Write will write the response body
func (*CustomWriter) WriteHeader ¶
func (r *CustomWriter) WriteHeader(code int)
WriteHeader will write the response headers
type SouinBeegoMiddleware ¶
type SouinBeegoMiddleware struct {
*middleware.SouinBaseHandler
}
SouinBeegoMiddleware declaration.
func NewHTTPCache ¶
func NewHTTPCache(c middleware.BaseConfiguration) *SouinBeegoMiddleware
Click to show internal directories.
Click to hide internal directories.