demo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPlugin

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

Types

type DemoPlugin

type DemoPlugin struct {
	// contains filtered or unexported fields
}

func (*DemoPlugin) Destroy

func (p *DemoPlugin) Destroy()

func (*DemoPlugin) GetConfig

func (p *DemoPlugin) GetConfig() types.PluginConf

func (*DemoPlugin) HandleRequest

func (p *DemoPlugin) HandleRequest(req *http.Request, _ http.ResponseWriter) (bool, error)

func (*DemoPlugin) HandleResponse

func (p *DemoPlugin) HandleResponse(_ *http.Request, w http.ResponseWriter) http.ResponseWriter

func (*DemoPlugin) Priority

func (p *DemoPlugin) Priority() int

func (*DemoPlugin) ValidateAndSetConfig

func (p *DemoPlugin) ValidateAndSetConfig(conf types.PluginConf) error

type DemoResponseWriter

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

func (*DemoResponseWriter) Hijack

func (w *DemoResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)

To make sure the plugin works with websocket

func (*DemoResponseWriter) Write

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

Override Write to modify response body if needed

func (*DemoResponseWriter) WriteHeader

func (w *DemoResponseWriter) WriteHeader(statusCode int)

Override WriteHeader to modify response headers

Jump to

Keyboard shortcuts

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