http

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: Apache-2.0 Imports: 12 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(ctx context.Context, req *http.Request) (*http.Response, error)
}

Client interface of a HTTP client.

type OptionFunc

type OptionFunc func(*TracedClient) error

OptionFunc definition for configuring the client in a functional way.

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.

type TracedClient

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

TracedClient defines a 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(ctx context.Context, req *http.Request) (*http.Response, error)

Do executes a HTTP request with integrated tracing and tracing propagation downstream.

Jump to

Keyboard shortcuts

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