handler

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 39 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() buffer.Option
}

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

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

BodyContext exposes the current endpoint hcl.Body.

func (*Endpoint) BufferOptions

func (e *Endpoint) BufferOptions() buffer.Option

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        buffer.Option
	Context           *hclsyntax.Body
	ErrorTemplate     *errors.Template
	ErrorHandler      http.Handler
	IsErrorHandler    bool
	IsJob             bool
	LogHandlerKind    string
	LogPattern        string
	ReqBodyLimit      int64
	SendServerTimings bool
	ServerOpts        *server.Options

	Items     sequence.List
	Producers map[string]producer.Roundtrip
	Redirect  *producer.Redirect
	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, preferFn PreferSPAfn, errorTpl *errors.Template, srvOpts *server.Options, modifier []hcl.Body) (*File, error)

func (*File) HasResponse

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

func (*File) ServeHTTP

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

func (*File) String

func (f *File) String() string

type Health

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

func NewHealthCheck

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

func (*Health) ServeHTTP

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

func (*Health) String

func (h *Health) String() string

type PreferSPAfn

type PreferSPAfn func(string) bool

func NewPreferSpaFn

func NewPreferSpaFn(bootstrapFiles []string, docRoot string) PreferSPAfn

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 *hclsyntax.Body, allowWS bool, logger *logrus.Entry) *Proxy

func (*Proxy) RoundTrip

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

type ResultPanic

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

func (ResultPanic) Error

func (r ResultPanic) Error() string

type Spa

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

func NewSpa

func NewSpa(ctx *hcl.EvalContext, config *config.Spa, srvOpts *server.Options, modifier []hcl.Body) (*Spa, error)

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