client

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package client make easy to use an http client

Index

Constants

View Source
const PrefixHTTP = "HTTP_"

PrefixHTTP is the env prefix of Config environment variables.

Variables

This section is empty.

Functions

func NewHTTPClient

func NewHTTPClient(tracer telemetry.Tracer, opts ...func(*http.Client)) *http.Client

NewHTTPClient crate a new *http.Client with Config fields set. If parent is present only config fields are changed.

Types

type Config

type Config struct {
	Timeout time.Duration `env:"TIMEOUT,required"`
}

Config of the http client.

func (Config) SetTimeout

func (c Config) SetTimeout(client *http.Client)

SetTimeout set request timeout.

Jump to

Keyboard shortcuts

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