debug

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: Apache-2.0 Imports: 9 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(opts ...Option) *http.Server

NewService initializes a new debug service.

Types

type Option

type Option func(o *Options)

Option defines a single option function.

func Address

func Address(a string) Option

Address provides a function to set the address option.

func CorsAllowCredentials added in v1.14.0

func CorsAllowCredentials(allow bool) Option

CorsAllowCredentials provides a function to set the CorsAllowAllowCredential option.

func CorsAllowedHeaders added in v1.14.0

func CorsAllowedHeaders(headers []string) Option

CorsAllowedHeaders provides a function to set the CorsAllowedHeaders option.

func CorsAllowedMethods added in v1.14.0

func CorsAllowedMethods(methods []string) Option

CorsAllowedMethods provides a function to set the CorsAllowedMethods option.

func CorsAllowedOrigins added in v1.14.0

func CorsAllowedOrigins(origins []string) Option

CorsAllowedOrigins provides a function to set the CorsAllowedOrigin option.

func Health

func Health(h func(http.ResponseWriter, *http.Request)) Option

Health provides a function to set the health option.

func Logger

func Logger(l log.Logger) Option

Logger provides a function to set the logger option.

func Name

func Name(n string) Option

Name provides a function to set the name option.

func Pprof

func Pprof(p bool) Option

Pprof provides a function to set the pprof option.

func Ready

func Ready(r func(http.ResponseWriter, *http.Request)) Option

Ready provides a function to set the ready option.

func Token

func Token(t string) Option

Token provides a function to set the token option.

func Version

func Version(v string) Option

Version provides a function to set the version option.

func Zpages

func Zpages(z bool) Option

Zpages provides a function to set the zpages option.

type Options

type Options struct {
	Logger               log.Logger
	Name                 string
	Version              string
	Address              string
	Token                string
	Pprof                bool
	Zpages               bool
	Health               func(http.ResponseWriter, *http.Request)
	Ready                func(http.ResponseWriter, *http.Request)
	CorsAllowedOrigins   []string
	CorsAllowedMethods   []string
	CorsAllowedHeaders   []string
	CorsAllowCredentials bool
}

Options defines the available options for this package.

Jump to

Keyboard shortcuts

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