http

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Downloader

type Downloader struct {
	LivenessCheck    time.Duration `envconfig:"LIVENESS_CHECK" default:"5m" required:"true"`
	ProbeTimeout     time.Duration `envconfig:"PROBE_TIMEOUT" default:"60m" required:"true"`
	HTTPTimeout      time.Duration `envconfig:"HTTP_TIMEOUT" default:"10s" required:"true"`
	TransportTimeout time.Duration `envconfig:"TRANSPORT_TIMEOUT" default:"5s" required:"true"`
	HTTPClient       *http.Client  `ignored:"true"`
}

Downloader

func NewDownloader

func NewDownloader(withHeaders http.Header) (*Downloader, error)

Configure the provider with environment variables

func (*Downloader) Doc

func (d *Downloader) Doc(w io.Writer)

func (*Downloader) Get

func (d *Downloader) Get(ctx context.Context, u string) (*http.Response, error)

func (*Downloader) Usage

func (d *Downloader) Usage()

func (*Downloader) WaitOnline

func (d *Downloader) WaitOnline(ctx context.Context, u string) error

WaitOnline check if the service is online, every tick; it returns when the service is up StartProbe only returns when the provider is reachable or in case of context cancelation

Jump to

Keyboard shortcuts

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