handlers

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2020 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 ClientError

type ClientError interface {
	error
	Code() int
}

ClientError implements error interface with additional code method

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 Download

type Download struct {
	DatasetClient        DatasetClient
	VaultClient          VaultClient
	FilterClient         FilterClient
	S3Client             S3Client
	ServiceAuthToken     string
	DownloadServiceToken string
	SecretKey            string
	VaultPath            string
	IsPublishing         bool
}

Download represents the configuration for a download handler

func (Download) Do

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

Do handles the retrieval of a requested file, by first calling the datasetID to see if the version has a public link available and redirecting if so, otherwise it decrypts the private file on the fly (if it is published). Authenticated requests will always allow access to the private, whether or not the version is published.

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 IdentityClient

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

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

type S3Client

type S3Client interface {
	GetWithPSK(key string, psk []byte) (io.ReadCloser, error)
}

S3Client is an interface to represent methods called to retrieve from s3

type VaultClient

type VaultClient interface {
	ReadKey(path, key string) (string, error)
}

VaultClient is an interface to represent methods called to action upon vault

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