rulematch

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RegexMatcher

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

func NewRegexMatcher

func NewRegexMatcher(ruleService RuleService) *RegexMatcher

func (RegexMatcher) Match

func (m RegexMatcher) Match(ctx context.Context, reqMethod string, reqURL *url.URL) (*rule.Rule, error)

type RouteMatcher

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

func NewRouteMatcher

func NewRouteMatcher(ruleService RuleService) *RouteMatcher

func (RouteMatcher) Match

func (r RouteMatcher) Match(req *http.Request) (*rule.Rule, error)

type RuleMatcher

type RuleMatcher interface {
	Match(req *http.Request) (*rule.Rule, error)
}

type RuleService

type RuleService interface {
	GetAllConfigs(ctx context.Context) ([]rule.Ruleset, error)
}

type Ware

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

func New

func New(log log.Logger, next http.Handler, matcher RuleMatcher) *Ware

func (Ware) Info

func (m Ware) Info() *middleware.MiddlewareInfo

func (*Ware) ServeHTTP

func (m *Ware) ServeHTTP(rw http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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