rule

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Empty = []Middleware{}

Functions

func NewAppendPath

func NewAppendPath(begin, end string) struct {
	Args any    `json:"args"`
	Type string `json:"type"`
}

func NewReplacePath

func NewReplacePath(search string, replace string, times int) struct {
	Args any    `json:"args"`
	Type string `json:"type"`
}

Types

type AppendPath

type AppendPath struct {
	Begin string `json:"begin"`
	End   string `json:"end"`
}

func (*AppendPath) Process

func (p *AppendPath) Process(next http.Handler) http.Handler

type BuilderFunc

type BuilderFunc func(raw json.RawMessage) (Middleware, error)

type Middleware

type Middleware interface {
	Process(next http.Handler) http.Handler
}

type RegisterFunc

type RegisterFunc func(map[string]BuilderFunc) error

func RegisterAppendPath

func RegisterAppendPath() RegisterFunc

func RegisterReplacePath

func RegisterReplacePath() RegisterFunc

type ReplacePath

type ReplacePath struct {
	Search  string `json:"search"`
	Replace string `json:"replace"`
	Times   int    `json:"times"`
}

func (*ReplacePath) Process

func (p *ReplacePath) Process(next http.Handler) http.Handler

Jump to

Keyboard shortcuts

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