httpclix

package
v1.45.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default(opts ...httpcli.Option) *httpcli.Client

func DefaultMiddlewares added in v1.45.0

func DefaultMiddlewares() []httpcli.Middleware

func Log

func Log(logger log.Logger) httpcli.Middleware

func LogConfigToContext

func LogConfigToContext(
	ctx context.Context,
	logRequestBody bool,
	logResponseBody bool,
	opts ...LogOption,
) context.Context

func Metrics

func Metrics(storage *http_metrics.ClientStorage) httpcli.Middleware

func RequestId

func RequestId() httpcli.Middleware

Types

type ClientBalancer added in v1.45.0

type ClientBalancer struct {
	*httpcli.Client
	// contains filtered or unexported fields
}

func DefaultWithBalancer added in v1.45.0

func DefaultWithBalancer(initialHosts []string, opts ...Option) *ClientBalancer

func NewClientBalancer added in v1.45.0

func NewClientBalancer(initialHosts []string, opts ...Option) *ClientBalancer

func (*ClientBalancer) Delete added in v1.45.0

func (c *ClientBalancer) Delete(method string) *httpcli.RequestBuilder

func (*ClientBalancer) Execute added in v1.45.0

func (c *ClientBalancer) Execute(ctx context.Context, builder *httpcli.RequestBuilder) (*httpcli.Response, error)

func (*ClientBalancer) Get added in v1.45.0

func (c *ClientBalancer) Get(method string) *httpcli.RequestBuilder

func (*ClientBalancer) Patch added in v1.45.0

func (c *ClientBalancer) Patch(method string) *httpcli.RequestBuilder

func (*ClientBalancer) Post added in v1.45.0

func (c *ClientBalancer) Post(method string) *httpcli.RequestBuilder

func (*ClientBalancer) Put added in v1.45.0

func (c *ClientBalancer) Put(method string) *httpcli.RequestBuilder

func (*ClientBalancer) Upgrade added in v1.45.0

func (c *ClientBalancer) Upgrade(hosts []string)

type ClientTracer added in v1.38.0

type ClientTracer struct {
	// contains filtered or unexported fields
}

func NewClientTracer added in v1.38.0

func NewClientTracer(clientStorage *metrics.ClientStorage, endpoint string) *ClientTracer

func (*ClientTracer) ClientTrace added in v1.38.0

func (cli *ClientTracer) ClientTrace() *httptrace.ClientTrace

func (*ClientTracer) ResponseReceived added in v1.38.0

func (cli *ClientTracer) ResponseReceived()

type LogOption added in v1.36.0

type LogOption func(*logConfig)

func LogDump added in v1.36.0

func LogDump(dumpRequest bool, dumpResponse bool) LogOption

func LogHeaders added in v1.36.0

func LogHeaders(requestHeaders bool, responseHeaders bool) LogOption

type Option added in v1.45.0

type Option func(c *clientBalancerOptions)

func WithClient added in v1.45.0

func WithClient(cli *http.Client) Option

func WithClientOptions added in v1.45.0

func WithClientOptions(opts ...httpcli.Option) Option

WithClientOptions appends passed opts to clientOpts

func WithHttpsSchema added in v1.45.0

func WithHttpsSchema() Option

Jump to

Keyboard shortcuts

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