httpclient

package
v0.35.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadFile

func DownloadFile(path *paths.Path, URL string, queryParameter string, label string, downloadCB rpc.DownloadProgressCB, config *downloader.Config, options ...downloader.DownloadOptions) (returnedError error)

DownloadFile downloads a file from a URL into the specified path. An optional config and options may be passed (or nil to use the defaults). A DownloadProgressCB callback function must be passed to monitor download progress. If a not empty queryParameter is passed, it is appended to the URL for analysis purposes.

func GetDownloaderConfig

func GetDownloaderConfig() (*downloader.Config, error)

GetDownloaderConfig returns the downloader configuration based on current settings.

func New

func New() (*http.Client, error)

New returns a default http client for use in the arduino-cli

func NewWithConfig

func NewWithConfig(config *Config) *http.Client

NewWithConfig creates a http client for use in the arduino-cli, with a given configuration

Types

type Config

type Config struct {
	UserAgent string
	Proxy     *url.URL
}

Config is the configuration of the http client

Jump to

Keyboard shortcuts

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