Documentation ¶
Index ¶
- type CustomWriter
- type SouinBaseHandler
- func (s *SouinBaseHandler) HandleInternally(r *http.Request) (bool, http.HandlerFunc)
- func (s *SouinBaseHandler) ServeHTTP(rw http.ResponseWriter, baseRq *http.Request, next handlerFunc) error
- func (s *SouinBaseHandler) Upstream(customWriter *CustomWriter, rq *http.Request, next handlerFunc, ...) error
- type SouinWriterInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 NewCustomWriter ¶
func NewCustomWriter(rq *http.Request, rw http.ResponseWriter, b *bytes.Buffer) *CustomWriter
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 SouinBaseHandler ¶
type SouinBaseHandler struct { Configuration configurationtypes.AbstractConfigurationInterface Storers []types.Storer InternalEndpointHandlers *api.MapHandler ExcludeRegex *regexp.Regexp RegexpUrls regexp.Regexp SurrogateKeys configurationtypes.SurrogateKeys SurrogateKeyStorer providers.SurrogateInterface DefaultMatchedUrl configurationtypes.URL // contains filtered or unexported fields }
func NewHTTPCacheHandler ¶
func NewHTTPCacheHandler(c configurationtypes.AbstractConfigurationInterface) *SouinBaseHandler
func (*SouinBaseHandler) HandleInternally ¶
func (s *SouinBaseHandler) HandleInternally(r *http.Request) (bool, http.HandlerFunc)
func (*SouinBaseHandler) ServeHTTP ¶
func (s *SouinBaseHandler) ServeHTTP(rw http.ResponseWriter, baseRq *http.Request, next handlerFunc) error
func (*SouinBaseHandler) Upstream ¶
func (s *SouinBaseHandler) Upstream( customWriter *CustomWriter, rq *http.Request, next handlerFunc, requestCc *cacheobject.RequestCacheDirectives, cachedKey string, ) error
type SouinWriterInterface ¶
type SouinWriterInterface interface { http.ResponseWriter Send() (int, error) }
Click to show internal directories.
Click to hide internal directories.