pertoolratelimit

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const PluginName = "per_tool_rate_limiter"

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Plugin)

func WithClock

func WithClock(now func() time.Time) Option

type PerToolRateLimiterData

type PerToolRateLimiterData struct {
	Stage         string `json:"stage"`
	CounterKey    string `json:"counter_key"`
	Tool          string `json:"tool"`
	Dimension     string `json:"dimension"`
	Subject       string `json:"subject"`
	WindowMax     int    `json:"window_max"`
	WindowSeconds int    `json:"window_seconds"`
	CurrentCount  int    `json:"current_count"`
	Behavior      string `json:"behavior"`
	LimitExceeded bool   `json:"limit_exceeded"`
}

type Plugin

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

func New

func New(redisClient *redis.Client, adapters *adapter.Registry, opts ...Option) *Plugin

func (*Plugin) Execute

func (p *Plugin) Execute(ctx context.Context, in appplugins.ExecInput) (*appplugins.Result, error)

func (*Plugin) MandatoryStages

func (p *Plugin) MandatoryStages() []policy.Stage

func (*Plugin) MutatesMetadata added in v0.2.3

func (p *Plugin) MutatesMetadata() bool

func (*Plugin) MutatesRequestBody added in v0.2.3

func (p *Plugin) MutatesRequestBody() bool

func (*Plugin) MutatesResponseBody added in v0.2.3

func (p *Plugin) MutatesResponseBody() bool

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) SupportedModes

func (p *Plugin) SupportedModes() []policy.Mode

func (*Plugin) SupportedStages

func (p *Plugin) SupportedStages() []policy.Stage

func (*Plugin) ValidateConfig

func (p *Plugin) ValidateConfig(settings map[string]any) error

Jump to

Keyboard shortcuts

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