middleware

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMiddlewareForRequest

func GetMiddlewareForRequest(middlewareConfigs []types.MiddlewareConfig, r *http.Request) []types.MiddlewareConfig

Types

type MiddlewareRunResult

type MiddlewareRunResult struct {
	Body       []byte
	Headers    map[string]string
	StatusCode int
}

func RunMiddleware

func RunMiddleware(
	exec mock.ExecFunc,
	readFile types.ReadFileFunc,
	configPath string,
	middlewareConfigs []types.MiddlewareConfig,
	responseBody []byte,
	responseHeaders map[string]string,
	responseStatusCode int,
	request *http.Request,
	endpointParams map[string]string,
	vars map[string]string,
) (*MiddlewareRunResult, error)

Jump to

Keyboard shortcuts

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