handlers

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientError

type ClientError interface {
	error
	Code() int
}

ClientError implements error interface with additional code method

type DatasetDownloads added in v1.9.0

type DatasetDownloads interface {
	Get(ctx context.Context, p downloads.Parameters) (downloads.Model, error)
}

type Download

type Download struct {
	DatasetDownloads     DatasetDownloads
	S3Content            S3Content
	ServiceAuthToken     string
	DownloadServiceToken string
	SecretKey            string
	IsPublishing         bool
}

Info represents the configuration for a download handler

func (Download) Do

func (d Download) Do(extension, serviceAuthToken, downloadServiceToken string) http.HandlerFunc

Do handle download dataset file requests. If the dataset is published and a public download link is available then the request is redirected to the existing public link. If the dataset is published but a public link does not exist then the requested file is streamed from the content store and written to response body. Authenticated requests will always allow access to the private, whether or not the version is published.

type IdentityClient

type IdentityClient interface {
	CheckRequest(*http.Request, string, string)
}

IdentityClient is an interface to represent methods called to action on the identity api

type S3Content added in v1.9.0

type S3Content interface {
	StreamAndWrite(ctx context.Context, filename string, w io.Writer) error
}

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