api

package
v1.62.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const IsBasedOn = "is_based_on"

Variables

View Source
var MaxIDs = func() int {
	return maxIDs
}

MaxIDs returns the maximum number of IDs acceptable in a list

Functions

This section is empty.

Types

type API

type API interface {
	CreateDatasetAPI(string, *mux.Router, store.DataStore) *DatasetAPI
}

API provides an interface for the routes

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 {
	Router *mux.Router

	EnablePrePublishView bool

	MaxRequestOptions int
	// contains filtered or unexported fields
}

DatasetAPI manages importing filters against a dataset

func Setup added in v1.22.0

func Setup(ctx context.Context, cfg *config.Configuration, router *mux.Router, dataStore store.DataStore, urlBuilder *url.Builder, downloadGenerators map[models.DatasetType]DownloadsGenerator, datasetPermissions, permissions AuthHandler) *DatasetAPI

Setup creates 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
}

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 TODO: Refactor this to reduce the complexity

type VersionDetails

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

VersionDetails contains the details that uniquely identify a version resource

Jump to

Keyboard shortcuts

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