Documentation
¶
Index ¶
- Constants
- func NewPlugin(logger *logger.Logger) types.Plugin
- type DemoResponseWriter
- type ResponseCache
- func (p *ResponseCache) Destroy()
- func (p *ResponseCache) GetConfig() types.PluginConf
- func (p *ResponseCache) HandleRequest(req *http.Request, res http.ResponseWriter) (bool, error)
- func (p *ResponseCache) HandleResponse(req *http.Request, w http.ResponseWriter) http.ResponseWriter
- func (p *ResponseCache) Priority() int
- func (p *ResponseCache) ValidateAndSetConfig(conf types.PluginConf) error
Constants ¶
View Source
const ( URIKEY = "uri" HOSTKEY = "host" METHODKEY = "method" DefaultTTL = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DemoResponseWriter ¶
type DemoResponseWriter struct {
*types.BaseResponseWriter
// contains filtered or unexported fields
}
func (*DemoResponseWriter) WriteHeader ¶
func (w *DemoResponseWriter) WriteHeader(statusCode int)
type ResponseCache ¶
type ResponseCache struct {
// contains filtered or unexported fields
}
TODO: fixme: The underlying cache is destroyed when plugin is updated. So on configuration updates, the cache is lost. Should this cache be taken out of the plugin instance and be part of httprouter or some global cache manager?
func (*ResponseCache) Destroy ¶
func (p *ResponseCache) Destroy()
func (*ResponseCache) GetConfig ¶
func (p *ResponseCache) GetConfig() types.PluginConf
func (*ResponseCache) HandleRequest ¶
func (p *ResponseCache) HandleRequest(req *http.Request, res http.ResponseWriter) (bool, error)
func (*ResponseCache) HandleResponse ¶
func (p *ResponseCache) HandleResponse(req *http.Request, w http.ResponseWriter) http.ResponseWriter
func (*ResponseCache) Priority ¶
func (p *ResponseCache) Priority() int
func (*ResponseCache) ValidateAndSetConfig ¶
func (p *ResponseCache) ValidateAndSetConfig(conf types.PluginConf) error
Click to show internal directories.
Click to hide internal directories.