Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Downloader ¶
type Downloader interface { // Download retrieves/creates the file requested in the http.Request , returning: // body - a reader with the contents of the file. This must be closed by the caller. // headers - should include Content-Type and Content-Disposition // status - the http status code - should be 200 unless there was an error // err - any error that occurred during processing Download(r *http.Request) (body io.ReadCloser, headers map[string]string, status int, err error) // Type returns the (conceptual) type of file downloaded - forms part of the request path handled by this Downloader Type() string // QueryParameters returns the names of query parameters required by this Downloader QueryParameters() []string }
Downloader defines the functions that are assigned to handle get requests
type DownloaderAPI ¶
type DownloaderAPI struct {
// contains filtered or unexported fields
}
DownloaderAPI manages requests to download files, calling the necessary backend services to fulfill the request
func StartDownloaderAPI ¶
func StartDownloaderAPI(ctx context.Context, cfg *config.Config, errorChan chan error, hc *healthcheck.HealthCheck, downloaders ...Downloader) *DownloaderAPI
StartDownloaderAPI manages all the routes configured to the downloader
Click to show internal directories.
Click to hide internal directories.