httpretriever

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MIT Imports: 8 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Retriever

type Retriever struct {
	// URL of your endpoint
	URL string

	// HTTP Method we should use (default: GET)
	Method string

	// Body of the request if needed (default: empty body)
	Body string

	// Header added to the request
	Header http.Header

	// Timeout we should wait before failing (default: 10 seconds)
	Timeout time.Duration
	// contains filtered or unexported fields
}

Retriever is a configuration struct for an HTTP endpoint retriever.

func (*Retriever) Retrieve

func (r *Retriever) Retrieve(ctx context.Context) ([]byte, error)

func (*Retriever) SetHTTPClient

func (r *Retriever) SetHTTPClient(client internal.HTTPClient)

SetHTTPClient is here if you want to override the default http.Client we are using. It is also used for the tests.

Jump to

Keyboard shortcuts

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