header

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	RawRoute *httprouter.Router //RawRoute field holds raw httprouter. multiplexer
	// contains filtered or unexported fields
}

Filter provides header filtering mechanism based on synthesis.AuthWrapper or response headers related to CORS or other security mechanisms. It acts as an overlay of httprouter..

func NewFilter

func NewFilter(authorizer ...rt_synthesis.AuthWrapper) *Filter

NewFilter generate new http filter instance associated to httprouter. instance. An authorizer function can be set to authorize/authenticate users. If nil authorizer given, authorization process for routes will be removed.

func (*Filter) DELETE

func (f *Filter) DELETE(resource string, authenticator rt_synthesis.AuthWrapper, handler httprouter.Handle)

func (*Filter) GET

func (f *Filter) GET(resource string, authenticator rt_synthesis.AuthWrapper, handler httprouter.Handle)

func (*Filter) OPTIONS

func (f *Filter) OPTIONS(resource string, _ httprouter.Handle)

func (*Filter) PATCH

func (f *Filter) PATCH(resource string, authenticator rt_synthesis.AuthWrapper, handler httprouter.Handle)

func (*Filter) POST

func (f *Filter) POST(resource string, authenticator rt_synthesis.AuthWrapper, handler httprouter.Handle)

func (*Filter) PUT

func (f *Filter) PUT(resource string, authenticator rt_synthesis.AuthWrapper, handler httprouter.Handle)

func (*Filter) Route

func (f *Filter) Route() *httprouter.Router

func (*Filter) ServeHTTP

func (f *Filter) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Filter) SetCustomHeader

func (f *Filter) SetCustomHeader(key string)

SetCustomHeader sets a custom header for the service endpoint

func (*Filter) SetDebug

func (f *Filter) SetDebug()

SetDebug permissively turn on debug flag

func (*Filter) SetOrigin

func (f *Filter) SetOrigin(origin string)

SetOrigin sets origin hostname for CORS restriction

Jump to

Keyboard shortcuts

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