http

package
v1.73.8 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2022 License: Unlicense Imports: 18 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(params ClientParams, opts ...ClientOption) *http.Client

NewClient 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(metrics *prometheus.ClientMetrics) ClientOption

WithClientMetrics for HTTP.

func WithClientRetry added in v1.50.0

func WithClientRetry() 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 opentracing.Tracer) ClientOption

WithClientTracer for HTTP.

type ClientParams

type ClientParams struct {
	Config *Config
}

ClientParams for HTTP.

type Config

type Config struct {
	Retry     retry.Config `yaml:"retry"`
	UserAgent string       `yaml:"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

NewServer for HTTP.

func (*Server) Start added in v1.70.0

func (s *Server) Start(listener net.Listener)

Start the server.

func (*Server) Stop added in v1.70.0

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

Stop the server.

type ServerParams added in v1.52.0

type ServerParams struct {
	fx.In

	Shutdowner fx.Shutdowner
	Config     *Config
	Logger     *zap.Logger
	Tracer     opentracing.Tracer
	Metrics    *prometheus.ServerMetrics
}

ServerParams for HTTP.

Directories

Path Synopsis
logger
zap
metrics
security
jwt
trace

Jump to

Keyboard shortcuts

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