Documentation ¶
Index ¶
- func NewService(opts ...Option) *http.Server
- type Option
- func Address(a string) Option
- func CorsAllowCredentials(allow bool) Option
- func CorsAllowedHeaders(headers []string) Option
- func CorsAllowedMethods(methods []string) Option
- func CorsAllowedOrigins(origins []string) Option
- func Health(h func(http.ResponseWriter, *http.Request)) Option
- func Logger(l log.Logger) Option
- func Name(n string) Option
- func Pprof(p bool) Option
- func Ready(r func(http.ResponseWriter, *http.Request)) Option
- func Token(t string) Option
- func Version(v string) Option
- func Zpages(z bool) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
NewService initializes a new debug service.
Types ¶
type Option ¶
type Option func(o *Options)
Option defines a single option function.
func CorsAllowCredentials ¶ added in v1.14.0
CorsAllowCredentials provides a function to set the CorsAllowAllowCredential option.
func CorsAllowedHeaders ¶ added in v1.14.0
CorsAllowedHeaders provides a function to set the CorsAllowedHeaders option.
func CorsAllowedMethods ¶ added in v1.14.0
CorsAllowedMethods provides a function to set the CorsAllowedMethods option.
func CorsAllowedOrigins ¶ added in v1.14.0
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.
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.
Click to show internal directories.
Click to hide internal directories.