httphandler

package
v0.0.1-rc9 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(serverMux *http.ServeMux, configs ...Config)

Types

type Config

type Config struct {
	Path     string
	Server   Server
	Cookie   *Cookie
	Delay    *Delay
	Slow     *Slow
	Redirect *Redirect
}
type Cookie struct {
	Names      []string
	HttpOnly   bool
	Secure     bool
	Customizer func(cookie *http.Cookie)
}

Cookie configuration

type Delay

type Delay struct {
	MaxDuration time.Duration
}

Delay configuration

type Payload

type Payload struct {
	Base64 string      `json:"base64,omitempty"`
	Json   interface{} `json:"json,omitempty"`
}

type Redirect

type Redirect struct {
	Max uint
}

Redirect configuration for redirects

type Server

type Server struct {
	MaxRequestBody    int64
	BaseUrl           *url.URL
	ManagementBaseUrl *url.URL
	TrustedAddresses  []*net.IPNet
}

type Slow

type Slow struct {
	MaxDuration time.Duration
}

Slow configuration

Jump to

Keyboard shortcuts

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