handler

package
Version: v0.0.0-...-14ba4b0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultHealthPath = "/healthz"

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessControl

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

func NewAccessControl

func NewAccessControl(protected http.Handler, list accesscontrol.List) *AccessControl

func (*AccessControl) Child

func (a *AccessControl) Child() http.Handler

func (*AccessControl) ServeHTTP

func (a *AccessControl) ServeHTTP(rw http.ResponseWriter, req *http.Request)

func (*AccessControl) String

func (a *AccessControl) String() string

type Endpoint

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

func NewEndpoint

func NewEndpoint(opts *EndpointOptions, log *logrus.Entry, modifier []hcl.Body) *Endpoint

func (*Endpoint) Options

func (e *Endpoint) Options() *server.Options

func (*Endpoint) RequestLimit

func (e *Endpoint) RequestLimit() int64

func (*Endpoint) ServeHTTP

func (e *Endpoint) ServeHTTP(rw http.ResponseWriter, req *http.Request)

func (*Endpoint) String

func (e *Endpoint) String() string

String interface maps to the access log handler field.

type EndpointLimit

type EndpointLimit interface {
	RequestLimit() int64
}

type EndpointOptions

type EndpointOptions struct {
	Context        hcl.Body
	Error          *errors.Template
	LogHandlerKind string
	LogPattern     string
	ReqBodyLimit   int64
	ReqBufferOpts  eval.BufferOption
	ServerOpts     *server.Options

	Proxies  producer.Roundtrips
	Redirect *producer.Redirect
	Requests producer.Roundtrips
	Response *producer.Response
}

type Error

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

func NewErrorHandler

func NewErrorHandler(kindsHandler map[string]http.Handler, errTpl *errors.Template) *Error

func (*Error) ServeHTTP

func (e *Error) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type ErrorWrapper

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

ErrorWrapper logs httputil.ReverseProxy internals with our own logrus.Entry.

func (*ErrorWrapper) Write

func (e *ErrorWrapper) Write(p []byte) (n int, err error)

type File

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

func NewFile

func NewFile(docRoot string, srvOpts *server.Options, modifier []hcl.Body) (*File, error)

func (*File) HasResponse

func (f *File) HasResponse(req *http.Request) bool

func (*File) Options

func (f *File) Options() *server.Options

func (*File) ServeHTTP

func (f *File) ServeHTTP(rw http.ResponseWriter, req *http.Request)

func (*File) String

func (f *File) String() string

func (*File) Template

func (f *File) Template() *errors.Template

type HasResponse

type HasResponse interface {
	HasResponse(req *http.Request) bool
}

type Health

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

func NewHealthCheck

func NewHealthCheck(path string, shutdownCh chan struct{}) *Health

func (*Health) Match

func (h *Health) Match(req *http.Request) bool

func (*Health) ServeHTTP

func (h *Health) ServeHTTP(rw http.ResponseWriter, _ *http.Request)

func (*Health) String

func (h *Health) String() string

type Proxy

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

Proxy wraps a httputil.ReverseProxy to apply additional configuration context and have control over the roundtrip configuration.

func NewProxy

func NewProxy(backend http.RoundTripper, ctx hcl.Body, logger *logrus.Entry) *Proxy

func (*Proxy) RoundTrip

func (p *Proxy) RoundTrip(req *http.Request) (*http.Response, error)

type Spa

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

func NewSpa

func NewSpa(bootstrapFile string, srvOpts *server.Options, modifier []hcl.Body) (*Spa, error)

func (*Spa) Options

func (s *Spa) Options() *server.Options

func (*Spa) ServeHTTP

func (s *Spa) ServeHTTP(rw http.ResponseWriter, req *http.Request)

func (*Spa) String

func (s *Spa) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL