handlers

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: MIT Imports: 29 Imported by: 1

Documentation

Overview

Package handlers is a generated GoMock package.

Package handlers is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFeedback

func AddFeedback(auth smtp.Auth, mailAddr, to, from, rendererURL string, isPositive bool) http.HandlerFunc

AddFeedback handles a users feedback request and sends a message to slack

func CreateFilterID

func CreateFilterID(c FilterClient, dc DatasetClient, cfg config.Config) http.HandlerFunc

CreateFilterID controls the creating of a filter idea when a new user journey is requested

func EditionsList

func EditionsList(dc DatasetClient, zc ZebedeeClient, rend RenderClient, cfg config.Config) http.HandlerFunc

EditionsList will load a list of editions for a filterable dataset

func FeedbackThanks

func FeedbackThanks(rendererURL string) http.HandlerFunc

FeedbackThanks loads the Feedback Thank you page

func FilterableLanding

func FilterableLanding(dc DatasetClient, rend RenderClient, zc ZebedeeClient, cfg config.Config) http.HandlerFunc

FilterableLanding will load a filterable landing page

func GetFeedback

func GetFeedback(rendererURL string) http.HandlerFunc

GetFeedback handles the loading of a feedback page

func LegacyLanding

func LegacyLanding(zc ZebedeeClient, dc DatasetClient, rend RenderClient, cfg config.Config) http.HandlerFunc

LegacyLanding will load a zebedee landing page

func MetadataText

func MetadataText(dc DatasetClient, cfg config.Config) http.HandlerFunc

MetadataText generates a metadata text file

func VersionsList

func VersionsList(dc DatasetClient, rend RenderClient, cfg config.Config) http.HandlerFunc

VersionsList will load a list of versions for a filterable datase

Types

type ClientError

type ClientError interface {
	Error() string
	Code() int
}

ClientError is an interface that can be used to retrieve the status code if a client has errored

type DatasetClient

type DatasetClient interface {
	Get(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, datasetID string) (m dataset.DatasetDetails, err error)
	GetByPath(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, path string) (m dataset.DatasetDetails, err error)
	GetEditions(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, datasetID string) (m []dataset.Edition, err error)
	GetEdition(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, datasetID, edition string) (dataset.Edition, error)
	GetVersions(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceAuthToken, collectionID, datasetID, edition string) (m []dataset.Version, err error)
	GetVersion(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceAuthToken, collectionID, datasetID, edition, version string) (m dataset.Version, err error)
	GetVersionMetadata(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, id, edition, version string) (m dataset.Metadata, err error)
	GetDimensions(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, id, edition, version string) (m dataset.Dimensions, err error)
	GetOptions(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, id, edition, version, dimension string) (m dataset.Options, err error)
}

DatasetClient is an interface with methods required for a dataset client

type Feedback

type Feedback struct {
	Purpose          string `schema:"purpose"`
	Type             string `schema:"type"`
	URI              string `schema:":uri"`
	URL              string `schema:"url"`
	Description      string `schema:"description"`
	Name             string `schema:"name"`
	Email            string `schema:"email"`
	FeedbackFormType string `schema:"feedback-form-type"`
}

Feedback represents a user's feedback

type FilterClient

type FilterClient interface {
	CreateBlueprint(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, collectionID, datasetID, edition, version string, names []string) (string, error)
}

FilterClient is an interface with the methods required for a filter client

type MockClientError

type MockClientError struct {
	// contains filtered or unexported fields
}

MockClientError is a mock of ClientError interface

func NewMockClientError

func NewMockClientError(ctrl *gomock.Controller) *MockClientError

NewMockClientError creates a new mock instance

func (*MockClientError) Code

func (m *MockClientError) Code() int

Code mocks base method

func (*MockClientError) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockClientError) Error

func (m *MockClientError) Error() string

Error mocks base method

type MockClientErrorMockRecorder

type MockClientErrorMockRecorder struct {
	// contains filtered or unexported fields
}

MockClientErrorMockRecorder is the mock recorder for MockClientError

func (*MockClientErrorMockRecorder) Code

Code indicates an expected call of Code

func (*MockClientErrorMockRecorder) Error

Error indicates an expected call of Error

type MockDatasetClient

type MockDatasetClient struct {
	// contains filtered or unexported fields
}

MockDatasetClient is a mock of DatasetClient interface

func NewMockDatasetClient

func NewMockDatasetClient(ctrl *gomock.Controller) *MockDatasetClient

NewMockDatasetClient creates a new mock instance

func (*MockDatasetClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockDatasetClient) Get

func (m *MockDatasetClient) Get(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, datasetID string) (dataset.DatasetDetails, error)

Get mocks base method

func (*MockDatasetClient) GetByPath

func (m *MockDatasetClient) GetByPath(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, path string) (dataset.DatasetDetails, error)

GetByPath mocks base method

func (*MockDatasetClient) GetDimensions

func (m *MockDatasetClient) GetDimensions(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, id, edition, version string) (dataset.Dimensions, error)

GetDimensions mocks base method

func (*MockDatasetClient) GetEdition

func (m *MockDatasetClient) GetEdition(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, datasetID, edition string) (dataset.Edition, error)

GetEdition mocks base method

func (*MockDatasetClient) GetEditions

func (m *MockDatasetClient) GetEditions(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, datasetID string) ([]dataset.Edition, error)

GetEditions mocks base method

func (*MockDatasetClient) GetOptions

func (m *MockDatasetClient) GetOptions(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, id, edition, version, dimension string) (dataset.Options, error)

GetOptions mocks base method

func (*MockDatasetClient) GetVersion

func (m *MockDatasetClient) GetVersion(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceAuthToken, collectionID, datasetID, edition, version string) (dataset.Version, error)

GetVersion mocks base method

func (*MockDatasetClient) GetVersionMetadata

func (m *MockDatasetClient) GetVersionMetadata(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, id, edition, version string) (dataset.Metadata, error)

GetVersionMetadata mocks base method

func (*MockDatasetClient) GetVersions

func (m *MockDatasetClient) GetVersions(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceAuthToken, collectionID, datasetID, edition string) ([]dataset.Version, error)

GetVersions mocks base method

type MockDatasetClientMockRecorder

type MockDatasetClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockDatasetClientMockRecorder is the mock recorder for MockDatasetClient

func (*MockDatasetClientMockRecorder) Get

func (mr *MockDatasetClientMockRecorder) Get(ctx, userAuthToken, serviceAuthToken, collectionID, datasetID interface{}) *gomock.Call

Get indicates an expected call of Get

func (*MockDatasetClientMockRecorder) GetByPath

func (mr *MockDatasetClientMockRecorder) GetByPath(ctx, userAuthToken, serviceAuthToken, collectionID, path interface{}) *gomock.Call

GetByPath indicates an expected call of GetByPath

func (*MockDatasetClientMockRecorder) GetDimensions

func (mr *MockDatasetClientMockRecorder) GetDimensions(ctx, userAuthToken, serviceAuthToken, collectionID, id, edition, version interface{}) *gomock.Call

GetDimensions indicates an expected call of GetDimensions

func (*MockDatasetClientMockRecorder) GetEdition

func (mr *MockDatasetClientMockRecorder) GetEdition(ctx, userAuthToken, serviceAuthToken, collectionID, datasetID, edition interface{}) *gomock.Call

GetEdition indicates an expected call of GetEdition

func (*MockDatasetClientMockRecorder) GetEditions

func (mr *MockDatasetClientMockRecorder) GetEditions(ctx, userAuthToken, serviceAuthToken, collectionID, datasetID interface{}) *gomock.Call

GetEditions indicates an expected call of GetEditions

func (*MockDatasetClientMockRecorder) GetOptions

func (mr *MockDatasetClientMockRecorder) GetOptions(ctx, userAuthToken, serviceAuthToken, collectionID, id, edition, version, dimension interface{}) *gomock.Call

GetOptions indicates an expected call of GetOptions

func (*MockDatasetClientMockRecorder) GetVersion

func (mr *MockDatasetClientMockRecorder) GetVersion(ctx, userAuthToken, serviceAuthToken, downloadServiceAuthToken, collectionID, datasetID, edition, version interface{}) *gomock.Call

GetVersion indicates an expected call of GetVersion

func (*MockDatasetClientMockRecorder) GetVersionMetadata

func (mr *MockDatasetClientMockRecorder) GetVersionMetadata(ctx, userAuthToken, serviceAuthToken, collectionID, id, edition, version interface{}) *gomock.Call

GetVersionMetadata indicates an expected call of GetVersionMetadata

func (*MockDatasetClientMockRecorder) GetVersions

func (mr *MockDatasetClientMockRecorder) GetVersions(ctx, userAuthToken, serviceAuthToken, downloadServiceAuthToken, collectionID, datasetID, edition interface{}) *gomock.Call

GetVersions indicates an expected call of GetVersions

type MockFilterClient

type MockFilterClient struct {
	// contains filtered or unexported fields
}

MockFilterClient is a mock of FilterClient interface

func NewMockFilterClient

func NewMockFilterClient(ctrl *gomock.Controller) *MockFilterClient

NewMockFilterClient creates a new mock instance

func (*MockFilterClient) CreateBlueprint

func (m *MockFilterClient) CreateBlueprint(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, collectionID, datasetID, edition, version string, names []string) (string, error)

CreateBlueprint mocks base method

func (*MockFilterClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

type MockFilterClientMockRecorder

type MockFilterClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockFilterClientMockRecorder is the mock recorder for MockFilterClient

func (*MockFilterClientMockRecorder) CreateBlueprint

func (mr *MockFilterClientMockRecorder) CreateBlueprint(ctx, userAuthToken, serviceAuthToken, downloadServiceToken, collectionID, datasetID, edition, version, names interface{}) *gomock.Call

CreateBlueprint indicates an expected call of CreateBlueprint

type MockRenderClient

type MockRenderClient struct {
	// contains filtered or unexported fields
}

MockRenderClient is a mock of RenderClient interface

func NewMockRenderClient

func NewMockRenderClient(ctrl *gomock.Controller) *MockRenderClient

NewMockRenderClient creates a new mock instance

func (*MockRenderClient) Do

func (m *MockRenderClient) Do(arg0 string, arg1 []byte) ([]byte, error)

Do mocks base method

func (*MockRenderClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

type MockRenderClientMockRecorder

type MockRenderClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockRenderClientMockRecorder is the mock recorder for MockRenderClient

func (*MockRenderClientMockRecorder) Do

func (mr *MockRenderClientMockRecorder) Do(arg0, arg1 interface{}) *gomock.Call

Do indicates an expected call of Do

type MockZebedeeClient

type MockZebedeeClient struct {
	// contains filtered or unexported fields
}

MockZebedeeClient is a mock of ZebedeeClient interface

func NewMockZebedeeClient

func NewMockZebedeeClient(ctrl *gomock.Controller) *MockZebedeeClient

NewMockZebedeeClient creates a new mock instance

func (*MockZebedeeClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockZebedeeClient) Get

func (m *MockZebedeeClient) Get(ctx context.Context, userAccessToken, path string) ([]byte, error)

Get mocks base method

func (*MockZebedeeClient) GetBreadcrumb

func (m *MockZebedeeClient) GetBreadcrumb(ctx context.Context, userAccessToken, path string) ([]data.Breadcrumb, error)

GetBreadcrumb mocks base method

func (*MockZebedeeClient) GetDataset

func (m *MockZebedeeClient) GetDataset(ctx context.Context, userAccessToken, path string) (data.Dataset, error)

GetDataset mocks base method

func (*MockZebedeeClient) GetDatasetLandingPage

func (m *MockZebedeeClient) GetDatasetLandingPage(ctx context.Context, userAccessToken, path string) (data.DatasetLandingPage, error)

GetDatasetLandingPage mocks base method

func (*MockZebedeeClient) Healthcheck

func (m *MockZebedeeClient) Healthcheck() (string, error)

Healthcheck mocks base method

type MockZebedeeClientMockRecorder

type MockZebedeeClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockZebedeeClientMockRecorder is the mock recorder for MockZebedeeClient

func (*MockZebedeeClientMockRecorder) Get

func (mr *MockZebedeeClientMockRecorder) Get(ctx, userAccessToken, path interface{}) *gomock.Call

Get indicates an expected call of Get

func (*MockZebedeeClientMockRecorder) GetBreadcrumb

func (mr *MockZebedeeClientMockRecorder) GetBreadcrumb(ctx, userAccessToken, path interface{}) *gomock.Call

GetBreadcrumb indicates an expected call of GetBreadcrumb

func (*MockZebedeeClientMockRecorder) GetDataset

func (mr *MockZebedeeClientMockRecorder) GetDataset(ctx, userAccessToken, path interface{}) *gomock.Call

GetDataset indicates an expected call of GetDataset

func (*MockZebedeeClientMockRecorder) GetDatasetLandingPage

func (mr *MockZebedeeClientMockRecorder) GetDatasetLandingPage(ctx, userAccessToken, path interface{}) *gomock.Call

GetDatasetLandingPage indicates an expected call of GetDatasetLandingPage

func (*MockZebedeeClientMockRecorder) Healthcheck

func (mr *MockZebedeeClientMockRecorder) Healthcheck() *gomock.Call

Healthcheck indicates an expected call of Healthcheck

type RenderClient

type RenderClient interface {
	Do(string, []byte) ([]byte, error)
}

RenderClient is an interface with methods for require for rendering a template

type ZebedeeClient

type ZebedeeClient interface {
	GetBreadcrumb(ctx context.Context, userAccessToken, path string) ([]data.Breadcrumb, error)
	Get(ctx context.Context, userAccessToken, path string) ([]byte, error)
	GetDatasetLandingPage(ctx context.Context, userAccessToken, path string) (data.DatasetLandingPage, error)
	GetDataset(ctx context.Context, userAccessToken, path string) (data.Dataset, error)
}

ZebedeeClient is an interface for zebedee client

Jump to

Keyboard shortcuts

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