proxy

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeRegexpArray

func MakeRegexpArray(str string) ([]*regexp.Regexp, error)

MakeRegexpArray splits a comma separated list of regexps into an array of Regexp objects.

func MakeRegexpArrayOrDie

func MakeRegexpArrayOrDie(str string) []*regexp.Regexp

MakeRegexpArrayOrDie creates an array of regular expression objects from a string or exits.

func NewServer

func NewServer(o *options.ProxyOptions) (http.Handler, error)

NewServer creates and installs a new Server. 'filter', if non-nil, protects requests to the api only.

Types

type FilterServer

type FilterServer struct {
	// Only paths that match this regexp will be accepted
	AcceptPaths []*regexp.Regexp
	// Paths that match this regexp will be rejected, even if they match the above
	RejectPaths []*regexp.Regexp
	// Hosts are required to match this list of regexp
	AcceptHosts []*regexp.Regexp
	// Methods that match this regexp are rejected
	RejectMethods []*regexp.Regexp
	// contains filtered or unexported fields
}

FilterServer rejects requests which don't match one of the specified regular expressions

func (*FilterServer) HandlerFor

func (f *FilterServer) HandlerFor(delegate http.Handler) *FilterServer

HandlerFor makes a shallow copy of f which passes its requests along to the new delegate.

func (*FilterServer) ServeHTTP

func (f *FilterServer) ServeHTTP(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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