fetch

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package fetch is used to fetch resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Authorization is the authorization header to use.
	Authorization string

	// HTTPClient is the http client to use.
	HTTPClient *http.Client

	// Logger is the logger to use.
	Logger model.Logger

	// UserAgent is the user agent to use.
	UserAgent string
}

Client is a client for fetching resources.

func (*Client) Fetch

func (c *Client) Fetch(
	ctx context.Context, URL string,
) ([]byte, error)

Fetch fetches the specified resource and returns it.

func (*Client) FetchAndVerify

func (c *Client) FetchAndVerify(
	ctx context.Context, URL, SHA256Sum string,
) ([]byte, error)

FetchAndVerify fetches and verifies a specific resource.

Jump to

Keyboard shortcuts

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