downloads

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatasetClient

type DatasetClient interface {
	GetVersion(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, collectionID, datasetID, edition, version string) (m dataset.Version, err error)
}

DatasetClient is an interface to represent methods called to action on the dataset api

type Downloader

type Downloader struct {
	FilterCli  FilterClient
	DatasetCli DatasetClient
	ImageCli   ImageClient
}

Downloader is a struct that contains the clients to request metadata about the downloads

func (Downloader) Get

func (d Downloader) Get(ctx context.Context, p Parameters, fileType FileType) (Model, error)

Get requests the required metadata using a client depending on the provided paramters

type FileType added in v1.10.0

type FileType int

FileType - iota enum of possible file types that can be download

const (
	TypeDatasetVersion FileType = iota
	TypeFilterOutput
	TypeImage
)

Possible values for a FileType of a download. It can only be one of the following:

type FilterClient

type FilterClient interface {
	GetOutput(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, collectionID, filterOutputID string) (m filter.Model, err error)
}

FilterClient is an interface to represent methods called to action on the filter api

type ImageClient added in v1.10.0

type ImageClient interface {
	GetImage(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, imageID string) (m image.Image, err error)
}

ImageClient is an interface to represent methods called to action on the image api

type Info

type Info struct {
	Public  string
	Private string
}

Info contains the public and private URLs to download file, of a generic type (filter, dataset version, image, ...)

type Model

type Model struct {
	Available   map[string]Info
	IsPublished bool
}

Model is a struct that contains all the required information to download a file. Available is a map of available downloads for the model.

func (Model) IsPublicLinkAvailable

func (m Model) IsPublicLinkAvailable(variant string) bool

IsPublicLinkAvailable return true if public URI for the requested extension is available and the object is published

type Parameters

type Parameters struct {
	UserAuthToken        string
	ServiceAuthToken     string
	DownloadServiceToken string
	CollectionID         string
	FilterOutputID       string
	DatasetID            string
	Edition              string
	Version              string
	ImageID              string
	Variant              string
	Name                 string
	Ext                  string
}

Parameters is the union of required paramters to perform all downloads

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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