http

package
v0.0.0-...-f7b9b20 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(handler http.Handler, spanName string) http.Handler

func NewInterceptor

func NewInterceptor(
	spanName string,

) func(http.Handler) http.Handler

Types

type HttpClient

type HttpClient struct {
	Opts *Opts
	// contains filtered or unexported fields
}

func New

func New(
	optFuncs ...OptFunc,
) *HttpClient

func (*HttpClient) Do

func (c *HttpClient) Do(
	ctx context.Context,
	req *http.Request,
	spanName string,
) (
	*http.Response,
	error,
)

type OptFunc

type OptFunc func(*Opts)

func WithTimeout

func WithTimeout(timeout time.Duration) OptFunc

Configure timeout of the HTTP client

type Opts

type Opts struct {
	Timeout time.Duration
}

Jump to

Keyboard shortcuts

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