Documentation
¶
Index ¶
- func CanHandle(r *http.Request, re types.RetrieverResponsePropertiesInterface) bool
- func DefaultSouinPluginCallback(res http.ResponseWriter, req *http.Request, ...) (e error)
- func DefaultSouinPluginInitializerFromConfiguration(c configurationtypes.AbstractConfigurationInterface) *types.RetrieverResponseProperties
- func HasMutation(req *http.Request, rw http.ResponseWriter) bool
- type CustomWriter
- type SouinBasePlugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanHandle ¶
func CanHandle(r *http.Request, re types.RetrieverResponsePropertiesInterface) bool
CanHandle detect if the request can be handled by Souin
func DefaultSouinPluginCallback ¶
func DefaultSouinPluginCallback( res http.ResponseWriter, req *http.Request, retriever types.RetrieverResponsePropertiesInterface, rc coalescing.RequestCoalescingInterface, nextMiddleware func(w http.ResponseWriter, r *http.Request) error, ) (e error)
DefaultSouinPluginCallback is the default callback for plugins
func DefaultSouinPluginInitializerFromConfiguration ¶
func DefaultSouinPluginInitializerFromConfiguration(c configurationtypes.AbstractConfigurationInterface) *types.RetrieverResponseProperties
DefaultSouinPluginInitializerFromConfiguration is the default initialization for plugins
func HasMutation ¶
func HasMutation(req *http.Request, rw http.ResponseWriter) bool
Types ¶
type CustomWriter ¶
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 SouinBasePlugin ¶
type SouinBasePlugin struct {
Retriever types.RetrieverResponsePropertiesInterface
RequestCoalescing coalescing.RequestCoalescingInterface
MapHandler *api.MapHandler
}
SouinBasePlugin declaration.
func (*SouinBasePlugin) HandleInternally ¶
func (s *SouinBasePlugin) HandleInternally(r *http.Request) (bool, http.HandlerFunc)
HandleInternally handles the Souin custom endpoints
Click to show internal directories.
Click to hide internal directories.