example_plugin

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() plugin.Handler

Types

type Config

type Config struct {
	AllowedOrigins []string `json:"allowed_origins"`
	RateLimit      int      `json:"rate_limit"`
	AuthHeader     string   `json:"auth_header"`
	Debug          bool     `json:"debug"`
}

type ExamplePlugin

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

func (*ExamplePlugin) Cleanup

func (p *ExamplePlugin) Cleanup() error

func (*ExamplePlugin) Name

func (p *ExamplePlugin) Name() string

Required plugin interface methods

func (*ExamplePlugin) Priority

func (p *ExamplePlugin) Priority() int

func (*ExamplePlugin) ProcessRequest

func (p *ExamplePlugin) ProcessRequest(ctx context.Context, req *http.Request) *plugin.Result

ProcessRequest handles incoming requests

func (*ExamplePlugin) ProcessResponse

func (p *ExamplePlugin) ProcessResponse(ctx context.Context, resp *http.Response) *plugin.Result

ProcessResponse handles outgoing responses

type Logger

type Logger interface {
	Info(msg string, fields ...interface{})
	Error(msg string, fields ...interface{})
}

type RateLimitData

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

RateLimitData tracks rate limiting data

Jump to

Keyboard shortcuts

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