authority

package
v1.0.0-rc3 Latest Latest
Warning

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

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

Documentation

Index

Constants

Variables

View Source
var (
	// StrategyTypeName key int32 for StrategyType, value string
	StrategyTypeName = map[int32]string{
		0: "Whitelist",
		1: "Blacklist",
	}

	// StrategyTypeValue key string, value int32 for StrategyType
	StrategyTypeValue = map[string]int32{
		"Whitelist": 0,
		"Blacklist": 1,
	}

	// LimitTypeName key int32 for LimitType, value string
	LimitTypeName = map[int32]string{
		0: "IP",
		1: "App",
	}

	// LimitTypeValue key string, value int32 for LimitType
	LimitTypeValue = map[string]int32{
		"IP":  0,
		"App": 1,
	}
)

Functions

This section is empty.

Types

type AuthorityConfiguration

type AuthorityConfiguration struct {
	Rules []AuthorityRule `yaml:"authority_rules" json:"authority_rules"` // Rules the authority rule list
}

AuthorityConfiguration blacklist/whitelist config

type AuthorityRule

type AuthorityRule struct {
	Strategy StrategyType `yaml:"strategy" json:"strategy"` // Strategy the authority rule strategy
	Limit    LimitType    `yaml:"limit" json:"limit"`       // Limit the authority rule limit
	Items    []string     `yaml:"items" json:"items"`       // Items the authority rule items
}

AuthorityRule blacklist/whitelist rule

type Filter

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

func (*Filter) Decode

func (f *Filter) Decode(c *http.HttpContext) filter.FilterStatus

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 *http.HttpContext, chain filter.FilterChain) error

type LimitType

type LimitType int32

LimitType the authority rule limit enum

const (
	IP  LimitType = 0
	App LimitType = 1
)

LimitType limit type const

type Plugin

type Plugin struct {
}

AuthorityPlugin is http filter plugin.

func (*Plugin) CreateFilterFactory

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

func (*Plugin) Kind

func (p *Plugin) Kind() string

type StrategyType

type StrategyType int32

StrategyType the authority rule strategy enum

const (
	Whitelist StrategyType = 0
	Blacklist StrategyType = 1
)

StrategyType strategy type const

Jump to

Keyboard shortcuts

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