Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAndInitialiseDatasetAPI ¶
func CreateAndInitialiseDatasetAPI(ctx context.Context, cfg config.Configuration, hc *healthcheck.HealthCheck, dataStore store.DataStore, urlBuilder *url.Builder, errorChan chan error, downloadGenerator DownloadsGenerator, auditor Auditor, datasetPermissions AuthHandler, permissions AuthHandler)
CreateAndInitialiseDatasetAPI create a new DatasetAPI instance based on the configuration provided, apply middleware and starts the HTTP server.
Types ¶
type AuthHandler ¶
type AuthHandler interface {
Require(required auth.Permissions, handler http.HandlerFunc) http.HandlerFunc
}
AuthHandler provides authorisation checks on requests
type DatasetAPI ¶
type DatasetAPI struct {
EnablePrePublishView bool
Router *mux.Router
// contains filtered or unexported fields
}
DatasetAPI manages importing filters against a dataset
func NewDatasetAPI ¶
func NewDatasetAPI(ctx context.Context, cfg config.Configuration, router *mux.Router, dataStore store.DataStore, urlBuilder *url.Builder, downloadGenerator DownloadsGenerator, auditor Auditor, datasetPermissions AuthHandler, permissions AuthHandler) *DatasetAPI
NewDatasetAPI create a new Dataset API instance and register the API routes based on the application configuration.
type DownloadsGenerator ¶
type DownloadsGenerator interface {
Generate(ctx context.Context, datasetID, instanceID, edition, version string) error
}
DownloadsGenerator pre generates full file downloads for the specified dataset/edition/version
type PublishCheck ¶
type PublishCheck struct {
Datastore store.Storer
Auditor audit.AuditorService
}
PublishCheck Checks if an version has been published
func (*PublishCheck) Check ¶
func (d *PublishCheck) Check(handle func(http.ResponseWriter, *http.Request), action string) http.HandlerFunc
Check wraps a HTTP handle. Checks that the state is not published
type VersionDetails ¶
type VersionDetails struct {
// contains filtered or unexported fields
}
VersionDetails contains the details that uniquely identify a version resource