http

package
v1.213.3 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 31 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

Module for fx.

Functions

func IsEnabled added in v1.143.2

func IsEnabled(cfg *Config) bool

IsEnabled for HTTP.

func Mux added in v1.202.0

func Mux(cfg *Config) http.MuxKind

Mux for config.

func NewClient

func NewClient(opts ...ClientOption) *http.Client

NewClient for HTTP.

func NewRoundTripper added in v1.105.0

func NewRoundTripper(opts ...ClientOption) http.RoundTripper

NewRoundTripper for HTTP.

func RegisterMetrics added in v1.154.7

func RegisterMetrics(cfg *metrics.Config, mux sh.ServeMux) error

RegisterMetrics for HTTP.

func Transport added in v1.137.0

func Transport() *http.Transport

Transport for HTTP.

Types

type ClientOption added in v1.50.0

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption for HTTP.

func WithClientBreaker added in v1.50.0

func WithClientBreaker() ClientOption

WithClientBreaker for HTTP.

func WithClientLogger added in v1.52.0

func WithClientLogger(logger *zap.Logger) ClientOption

WithClientLogger for HTTP.

func WithClientMetrics added in v1.65.0

func WithClientMetrics(meter metric.Meter) ClientOption

WithClientMetrics for HTTP.

func WithClientRetry added in v1.50.0

func WithClientRetry(cfg *r.Config) ClientOption

WithClientRetry for HTTP.

func WithClientRoundTripper added in v1.50.0

func WithClientRoundTripper(rt http.RoundTripper) ClientOption

WithClientRoundTripper for HTTP.

func WithClientTLS added in v1.180.0

func WithClientTLS(sec *st.Config) (ClientOption, error)

WithClientTLS for HTTP.

func WithClientTimeout added in v1.201.0

func WithClientTimeout(timeout string) ClientOption

WithClientTimeout for HTTP.

func WithClientTokenGenerator added in v1.204.0

func WithClientTokenGenerator(gen token.Generator) ClientOption

WithClientTokenGenerator for HTTP.

func WithClientTracer added in v1.52.0

func WithClientTracer(tracer trace.Tracer) ClientOption

WithClientTracer for HTTP.

func WithClientUserAgent added in v1.121.0

func WithClientUserAgent(userAgent string) ClientOption

WithUserAgent for HTTP.

type Config

type Config struct {
	*server.Config `yaml:",inline" json:",inline" toml:",inline"`
	Mux            string `yaml:"mux,omitempty" json:"mux,omitempty" toml:"mux,omitempty"`
}

Config for HTTP.

type Server added in v1.47.0

type Server struct {
	*server.Server
}

Server for HTTP.

func NewServer

func NewServer(params ServerParams) (*Server, error)

NewServer for HTTP.

type ServerParams added in v1.52.0

type ServerParams struct {
	fx.In

	Shutdowner fx.Shutdowner
	Mux        sh.ServeMux
	Config     *Config
	Logger     *zap.Logger
	Tracer     trace.Tracer
	Meter      metric.Meter
	UserAgent  env.UserAgent
	Limiter    *limiter.Limiter  `optional:"true"`
	Key        lm.KeyFunc        `optional:"true"`
	Handlers   []negroni.Handler `optional:"true"`
}

ServerParams for HTTP.

Directories

Path Synopsis
security
telemetry

Jump to

Keyboard shortcuts

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