handler

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: MIT Imports: 31 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 BodyLimit

type BodyLimit interface {
	RequestLimit() int64
	BufferOptions() eval.BufferOption
}

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) BodyContext added in v1.7.0

func (e *Endpoint) BodyContext() hcl.Body

BodyContext exposes the current endpoint hcl.Body.

func (*Endpoint) BufferOptions

func (e *Endpoint) BufferOptions() eval.BufferOption

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 EndpointOptions

type EndpointOptions struct {
	APIName        string
	BufferOpts     eval.BufferOption
	Context        hcl.Body
	ErrorTemplate  *errors.Template
	ErrorHandler   http.Handler
	IsErrorHandler bool
	LogHandlerKind string
	LogPattern     string
	ReqBodyLimit   int64
	ServerOpts     *server.Options

	Proxies   producer.Roundtrip
	Redirect  *producer.Redirect
	Requests  producer.Roundtrip
	Sequences producer.Sequences
	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 File

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

func NewFile

func NewFile(docRoot, basePath string, errorTpl *errors.Template, 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 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
y or Y : Canonical URL