downloads

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 12 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, downloadServiceAuthToken, collectionID, datasetID, edition, version string) (m dataset.Version, err error)
	GetInstance(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, instanceID, ifMatch string) (m dataset.Instance, eTag string, err error)
	Checker(ctx context.Context, check *healthcheck.CheckState) 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, variant string) (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 FilesClient added in v1.16.1

type FilesClient interface {
	GetFile(ctx context.Context, path string, authToken string) (files.FileMetaData, error)
	Checker(ctx context.Context, state *healthcheck.CheckState) error
}

FilesClient is interface to the files api

type FilterClient

type FilterClient interface {
	GetOutput(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, collectionID, filterOutputID string) (m filter.Model, err error)
	Checker(ctx context.Context, check *healthcheck.CheckState) 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 {
	GetDownloadVariant(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, imageID, variant string) (m image.ImageDownload, err error)
	Checker(ctx context.Context, check *healthcheck.CheckState) error
}

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

type Model

type Model struct {
	IsPublished     bool
	Public          string
	PrivateS3Path   string
	PrivateFilename string
}

Model is a struct that contains all the required information to download a file.

func (Model) IsPublicLinkAvailable

func (m Model) IsPublicLinkAvailable() 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
	InstanceID           string
	DatasetID            string
	Edition              string
	Version              string
	ImageID              string
	Variant              string
	Filename             string
}

Parameters is the union of required parameters 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