download

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Args = flag.NewFlagSet("download", flag.ExitOnError)

Args is a flagset that needs to be exported so that it can be written to the main program help

View Source
var URL = Args.String("url", "", "The url of the download server.")
View Source
var Usage = `` /* 1412-byte string literal not displayed */

Usage text that will be displayed as command line help text when using the `help download` command

Functions

func Download

func Download(args []string, configPath string) error

Download function downloads files from the SDA by using the download's service APIs

func GetDatasets added in v0.1.3

func GetDatasets(baseURL, token string) ([]string, error)

func GetURLsFile

func GetURLsFile(urlsFilePath string) (urlsList []string, err error)

GetURLsFile reads the urls_list.txt file and returns the urls of the files in a list

Types

type File added in v0.1.3

type File struct {
	FileID                    string `json:"fileId"`
	DatasetID                 string `json:"datasetId"`
	DisplayFileName           string `json:"displayFileName"`
	FilePath                  string `json:"filePath"`
	FileName                  string `json:"fileName"`
	FileSize                  int    `json:"fileSize"`
	DecryptedFileSize         int    `json:"decryptedFileSize"`
	DecryptedFileChecksum     string `json:"decryptedFileChecksum"`
	DecryptedFileChecksumType string `json:"decryptedFileChecksumType"`
	FileStatus                string `json:"fileStatus"`
	CreatedAt                 string `json:"createdAt"`
	LastModified              string `json:"lastModified"`
}

File struct represents the file metadata

func GetFilesInfo added in v0.1.3

func GetFilesInfo(baseURL, dataset, pubKeyBase64, token string) ([]File, error)

GetFilesInfo gets the files of the dataset by using the dataset ID

Jump to

Keyboard shortcuts

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