download

package
v0.14.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(ctx context.Context, endpoint string, opts ...Option) (b []byte, err error)

Download downloads a config.

func NewTFTPTransport added in v0.4.0

func NewTFTPTransport() http.RoundTripper

NewTFTPTransport returns an http.RoundTripper capable of handling the TFTP protocol.

Types

type Option

type Option func(*downloadOptions)

Option configures the download options.

func WithErrorOnEmptyResponse added in v0.8.0

func WithErrorOnEmptyResponse(e error) Option

WithErrorOnEmptyResponse provides specific error to return when response is empty.

func WithErrorOnNotFound added in v0.8.0

func WithErrorOnNotFound(e error) Option

WithErrorOnNotFound provides specific error to return when response has HTTP 404 error.

func WithFormat

func WithFormat(format string) Option

WithFormat specifies the source format. This ultimately will be a yaml but may be represented in different formats. For example, the config may be base64 encoded.

func WithHeaders

func WithHeaders(headers map[string]string) Option

WithHeaders specifies any http headers that are needed for downloading the config.

Jump to

Keyboard shortcuts

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