http

package
v0.74.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package http provides a client with included tracing capabilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Do(req *http.Request) (*http.Response, error)
}

Client interface of an HTTP client.

type OptionFunc

type OptionFunc func(*TracedClient) error

OptionFunc definition for configuring the client in a functional way.

func WithCheckRedirect added in v0.74.0

func WithCheckRedirect(cr func(req *http.Request, via []*http.Request) error) OptionFunc

WithCheckRedirect option for setting the WithCheckRedirect for the client.

func WithCircuitBreaker added in v0.74.0

func WithCircuitBreaker(name string, set circuitbreaker.Setting) OptionFunc

WithCircuitBreaker option for setting up a circuit breaker.

func WithTimeout added in v0.74.0

func WithTimeout(timeout time.Duration) OptionFunc

WithTimeout option for adjusting the timeout of the connection.

func WithTransport added in v0.74.0

func WithTransport(rt http.RoundTripper) OptionFunc

WithTransport option for setting the WithTransport for the client.

type TracedClient

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

TracedClient defines an HTTP client with tracing integrated.

func New

func New(oo ...OptionFunc) (*TracedClient, error)

New creates a new HTTP client.

func (*TracedClient) Do

func (tc *TracedClient) Do(req *http.Request) (*http.Response, error)

Do execute an HTTP request with integrated tracing and tracing propagation downstream.

Directories

Path Synopsis
encoding
json
Package json provides helper functions to handle requests and responses.
Package json provides helper functions to handle requests and responses.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳