middleware

package
v0.0.0-...-f08e3d1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VCAPRequestIDKey    = "vcap_request_id"
	APIVersion          = "api_version"
	RequestReceivedTime = "request_received_time"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator struct {
	Scopes    []string
	Validator validator
}

func NewAuthenticator

func NewAuthenticator(validator validator, scopes ...string) Authenticator

func (Authenticator) Error

func (ware Authenticator) Error(w http.ResponseWriter, code int, message string) bool

func (Authenticator) ServeHTTP

func (ware Authenticator) ServeHTTP(w http.ResponseWriter, req *http.Request, context stack.Context) bool

type CORS

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

func NewCORS

func NewCORS(origin string) CORS

func (CORS) ServeHTTP

func (ware CORS) ServeHTTP(w http.ResponseWriter, req *http.Request, context stack.Context) bool

type DatabaseAllocator

type DatabaseAllocator struct {
	DB    *sql.DB
	Trace bool
}

func NewDatabaseAllocator

func NewDatabaseAllocator(sqlDB *sql.DB, trace bool) DatabaseAllocator

func (DatabaseAllocator) ServeHTTP

func (ware DatabaseAllocator) ServeHTTP(w http.ResponseWriter, req *http.Request, context stack.Context) bool

type RequestCounter

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

func NewRequestCounter

func NewRequestCounter(matcher routeMatcher) RequestCounter

func (RequestCounter) ServeHTTP

func (ware RequestCounter) ServeHTTP(w http.ResponseWriter, req *http.Request, context stack.Context) bool

type RequestLogging

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

func NewRequestLogging

func NewRequestLogging(logger lager.Logger, clock clock) RequestLogging

func (RequestLogging) ServeHTTP

func (r RequestLogging) ServeHTTP(response http.ResponseWriter, request *http.Request, context stack.Context) bool

Jump to

Keyboard shortcuts

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