download

package
v2.35.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(uri, destination string, mode os.FileMode, sha256sum []byte) (string, error)

Download function takes sha256sum as hex decoded byte something like hex.DecodeString("33daf4c03f86120fdfdc66bddf6bfff4661c7ca11c5d")

func InMemory

func InMemory(uri string) (io.ReadCloser, error)

InMemory takes a URL and returns a ReadCloser object to the downloaded file or the file itself if the URL is a file:// URL. In case of failure it returns the respective error.

Types

type RemoteFile

type RemoteFile struct {
	URI string
	// contains filtered or unexported fields
}

func NewRemoteFile

func NewRemoteFile(uri, sha256sum string) *RemoteFile

func (*RemoteFile) Download

func (r *RemoteFile) Download(bundlePath string, mode os.FileMode) (string, error)

func (*RemoteFile) GetSha256Sum

func (r *RemoteFile) GetSha256Sum() string

func (*RemoteFile) GetSourceFilename

func (r *RemoteFile) GetSourceFilename() (string, error)

Jump to

Keyboard shortcuts

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