downloader

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: Apache-2.0, BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(log *logger.Logger, ipfsGateway string)

Init initializes default downloader

Types

type Downloader

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

Downloader struct to store currently being downloaded files and othe things.

func GetDefaultDownloader

func GetDefaultDownloader() *Downloader

GetDefaultDownloader returns default downloader

func New

func New(log *logger.Logger, ipfsGateway string) *Downloader

New is a downloader constructor

func (*Downloader) DownloadAndStore

func (d *Downloader) DownloadAndStore(hash hashing.HashValue, uri string, cache registry.BlobCache, completedChanOpt ...chan bool) error

DownloadAndStore downloads and stores data. Accepted URIs are: http://<url of the contents> (e.g. http://some.place.lt/some/contents.txt) https://<url of the contents> (e.g. https://some.place.lt/some/contents.txt) ipfs://<cid of the contents> (e.g. ipfs://QmeyMc1i9KLqqyqYCksDZiwntxwuiz5Z1hbLBrHvAXyjMZ)

Jump to

Keyboard shortcuts

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