responsecache

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URIKEY     = "uri"
	HOSTKEY    = "host"
	METHODKEY  = "method"
	DefaultTTL = 30 * time.Second
)

Variables

This section is empty.

Functions

func NewPlugin

func NewPlugin(logger *logger.Logger) types.Plugin

Types

type DemoResponseWriter

type DemoResponseWriter struct {
	*types.BaseResponseWriter
	// contains filtered or unexported fields
}

func (*DemoResponseWriter) Write

func (w *DemoResponseWriter) Write(data []byte) (int, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL