ratelimit

package
v1.0.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

func OnRulesUpdate

func OnRulesUpdate(rules []*Rule)

OnRulesUpdate update rule

Types

type Config

type Config struct {
	Resources []*pkgs.Resource `json:"resources,omitempty" yaml:"resources,omitempty"`
	Rules     []*Rule          `json:"rules,omitempty" yaml:"rules,omitempty"`
	LogPath   string           `json:"logPath,omitempty" yaml:"logPath,omitempty"`
}

Config rate limit config

func GetMockedRateLimitConfig

func GetMockedRateLimitConfig() *Config

type Filter

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

Filter is http filter instance

func (*Filter) Decode

type FilterFactory

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

FilterFactory is http filter instance

func (*FilterFactory) Apply

func (factory *FilterFactory) Apply() error

func (*FilterFactory) Config

func (factory *FilterFactory) Config() interface{}

func (*FilterFactory) PrepareFilterChain

func (factory *FilterFactory) PrepareFilterChain(ctx *contexthttp.HttpContext, chain filter.FilterChain) error

type Plugin

type Plugin struct {
}

Plugin is http filter plugin.

func (*Plugin) CreateFilterFactory

func (p *Plugin) CreateFilterFactory() (filter.HttpFilterFactory, error)

func (*Plugin) Kind

func (p *Plugin) Kind() string

type Rule

type Rule struct {
	ID       int64     `json:"id,omitempty" yaml:"id,omitempty"`
	FlowRule flow.Rule `json:"flowRule,omitempty" yaml:"flowRule,omitempty"`
	Enable   bool      `json:"enable,omitempty" yaml:"enable,omitempty"`
}

Rule api group 's rate-limit rule

Jump to

Keyboard shortcuts

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