http

package
v1.126.6 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Unlicense Imports: 21 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPort = errors.New("invalid port")

ErrInvalidPort for HTTP.

Functions

func NewClient

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

NewClient for HTTP.

func NewRoundTripper added in v1.105.0

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

NewRoundTripper for HTTP.

func ServerHandlers added in v1.120.0

func ServerHandlers() []negroni.Handler

ServerHandlers 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 *retry.Config) ClientOption

WithClientRetry for HTTP.

func WithClientRoundTripper added in v1.50.0

func WithClientRoundTripper(rt http.RoundTripper) ClientOption

WithClientRoundTripper for HTTP.

func WithClientTracer added in v1.52.0

func WithClientTracer(tracer htracer.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 {
	Security  security.Config `yaml:"security" json:"security" toml:"security"`
	Port      string          `yaml:"port" json:"port" toml:"port"`
	Retry     retry.Config    `yaml:"retry" json:"retry" toml:"retry"`
	UserAgent string          `yaml:"user_agent" json:"user_agent" toml:"user_agent"`
}

Config for HTTP.

type Server added in v1.47.0

type Server struct {
	Mux *runtime.ServeMux
	// contains filtered or unexported fields
}

Server for HTTP.

func NewServer

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

NewServer for HTTP.

func (*Server) Start added in v1.70.0

func (s *Server) Start() error

Start the server.

func (*Server) Stop added in v1.70.0

func (s *Server) Stop(ctx context.Context) error

Stop the server.

type ServerParams added in v1.52.0

type ServerParams struct {
	fx.In

	Shutdowner fx.Shutdowner
	Config     *Config
	Logger     *zap.Logger
	Tracer     tracer.Tracer
	Meter      metric.Meter
	Handlers   []negroni.Handler
}

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