http

package
v0.73.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 16 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 CheckRedirect added in v0.68.0

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

CheckRedirect option for setting the CheckRedirect for the client.

func CircuitBreaker

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

CircuitBreaker option for setting up a circuit breaker.

func Timeout

func Timeout(timeout time.Duration) OptionFunc

Timeout option for adjusting the timeout of the connection.

func Transport added in v0.45.0

func Transport(rt http.RoundTripper) OptionFunc

Transport option for setting the Transport 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