Documentation ¶
Index ¶
- func ApplyTracingToHTTPClient(cli *http.Client)
- func BasicAuthHandler(next http.Handler, cfg BasicAuthConfig) http.Handler
- func TracingMiddleware(handler http.Handler, opts ...otelhttp.Option) http.Handler
- func TracingMiddlewareFunc(handler http.HandlerFunc, opts ...otelhttp.Option) http.Handler
- type BasicAuthConfig
- type Config
- type HttpServer
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyTracingToHTTPClient ¶
ApplyTracingToHTTPClient propagate tracing.ID and X-Request-ID on exists http.Client.
func BasicAuthHandler ¶ added in v0.2.14
func BasicAuthHandler(next http.Handler, cfg BasicAuthConfig) http.Handler
func TracingMiddleware ¶
TracingMiddleware wraps the passed http.Handler, functioning like middleware, in a span named after the operation and with any provided Options.
func TracingMiddlewareFunc ¶
HTTPTracingMiddlewareFunc wraps the passed http.HandlerFunc, functioning like middleware, in a span named after the operation and with any provided Options.
Types ¶
type BasicAuthConfig ¶ added in v0.2.14
type Config ¶
type Config struct { Enabled bool `default:"false" usage:"allows to enable http server" example:"true"` Address string `default:":8080" validate:"required,hostname_port" usage:"HTTP server listen address" example:"localhost:9000"` Network string `default:"tcp" validate:"required" usage:"HTTP server listen network: tpc/udp" example:"tcp"` NoTrace bool `yaml:"no_trace" default:"false" usage:"allows to disable tracing for HTTP server" example:"false"` }
Config provides configuration for http server.
type HttpServer ¶ added in v0.2.13
type HttpServer struct { Config // contains filtered or unexported fields }
func (HttpServer) Enabled ¶ added in v0.2.13
func (s HttpServer) Enabled() bool
Enabled returns is service enabled.
func (HttpServer) Name ¶ added in v0.2.13
func (s HttpServer) Name() string
Name returns name of http server.
type Option ¶
type Option func(*HttpServer)
Option allows customizing http component settings.
func WithHandler ¶
WithHandler allows set custom http.Handler value.
func WithLogger ¶
func WithLogger(v logger.ExtendedLogger) Option
WithLogger allows set custom logger value.