download

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHttpClient

func NewHttpClient(opts ...HttpClientOption) *http.Client

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpCli *http.Client) *Client

func (*Client) Get

func (c *Client) Get(ctx context.Context, opts GetOptions) error

type GetOptions

type GetOptions struct {
	DownloadURL string
	Directory   string
	Filename    string
	Shasum      string
}

type HttpClientOption

type HttpClientOption func(*http.Client) *http.Client

func WithInsecureSkipVerify

func WithInsecureSkipVerify() HttpClientOption

func WithTimeout

func WithTimeout(timeout time.Duration) HttpClientOption

func WithUserAgent

func WithUserAgent(userAgent string) HttpClientOption

Jump to

Keyboard shortcuts

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