http

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FinishSpan added in v0.31.0

func FinishSpan(sp opentracing.Span, code int)

FinishSpan finishes a HTTP span by providing a HTTP status code.

func Span added in v0.31.0

func Span(path, corID string, r *http.Request) (opentracing.Span, *http.Request)

Span starts a new HTTP span.

Types

type Client

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

Client interface of a HTTP client.

type OptionFunc added in v0.23.0

type OptionFunc func(*TracedClient) error

OptionFunc definition for configuring the client in a functional way.

func CircuitBreaker added in v0.23.0

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

CircuitBreaker option for setting up a circuit breaker.

func Timeout added in v0.23.0

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 added in v0.23.0

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