interceptor

package
v0.0.0-...-4c76c01 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidContentType = errors.New("form parameter encoding not supported, please change the hook to send JSON payloads")

ErrInvalidContentType is returned when the content-type is not a JSON body.

Functions

This section is empty.

Types

type Error

type Error interface {
	error
	Status() int
}

Error represents a handler error. It provides methods for a HTTP status code and embeds the built-in error interface.

type HTTPError

type HTTPError struct {
	Code int
	Err  error
}

HTTPError represents an error with an associated HTTP status code.

func (HTTPError) Error

func (se HTTPError) Error() string

Allows HTTPError to satisfy the error interface.

func (HTTPError) Status

func (se HTTPError) Status() int

Returns our HTTP status code.

type PagerDutyInterceptor

type PagerDutyInterceptor struct {
	Logger *zap.SugaredLogger
}

func (*PagerDutyInterceptor) Process

func (PagerDutyInterceptor) ServeHTTP

func (pdi PagerDutyInterceptor) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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