filter

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Init filter

func RegistryFilter

func RegistryFilter(filter Filter)

Types

type Chain

type Chain struct {
	Filters  []Filter
	Index    int
	Exchange *Exchange
	Route    config.Route
}

Chain struct

func NewChain

func NewChain(resp http.ResponseWriter, req *http.Request, route config.Route) *Chain

func (*Chain) DoFilter

func (c *Chain) DoFilter()

type Exchange

type Exchange struct {
	Resp      http.ResponseWriter
	Req       *http.Request
	Ctx       context.Context
	Attr      map[string]interface{}
	Err       error
	Completed bool
	Written   sync.Once
}

Exchange struct

func (*Exchange) Error

func (e *Exchange) Error(err error)

type Filter

type Filter interface {
	Init()
	Name() string
	Filter(exchange *Exchange, c interface{}) error
}

Filter interface

type ProxyConfig

type ProxyConfig struct {
	URI string `asn1:"url"`
}

type ResourceConfig

type ResourceConfig struct {
	Root string
}

type RewriteConfig

type RewriteConfig struct {
	Regex       string
	Replacement string
}

Jump to

Keyboard shortcuts

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