Documentation
¶
Index ¶
- Constants
- type AreaTypes
- type Areas
- type CantabularError
- type CensusObservations
- type DatasetJSONLinks
- type Datastore
- type Dimensions
- func (h *Dimensions) GetAll(w http.ResponseWriter, r *http.Request)
- func (h *Dimensions) GetBaseVariable(w http.ResponseWriter, r *http.Request)
- func (h *Dimensions) GetBlockedAreaCount(w http.ResponseWriter, r *http.Request)
- func (h *Dimensions) GetCategorisations(w http.ResponseWriter, r *http.Request)
- func (h *Dimensions) GetDescription(w http.ResponseWriter, r *http.Request)
- func (h *Dimensions) GetDimensionCategories(w http.ResponseWriter, r *http.Request)
- type Error
- type GetFilterDimensionOptionsItem
- type GetObservationResponse
- type GetObservationsResponse
- type ObservationDimension
- type PopulationTypeMetadata
- type PopulationTypes
Constants ¶
const ( MaxVariableError = "Maximum variables at MSOA and above is 5" MaxVariableGraphqlError = "Maximum variables in query is 5" )
const DATASET_TYPE_MICRODATA = "microdata"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AreaTypes ¶ added in v1.3.2
type AreaTypes struct {
// contains filtered or unexported fields
}
AreaTypes handles requests sent to the /population-types/{population-type}/area-types set of routes
func NewAreaTypes ¶ added in v1.3.2
func NewAreaTypes(cfg *config.Config, r responder, c cantabularClient, d datasetAPIClient) *AreaTypes
NewAreaTypes returns a new AreaTypes handler set
func (*AreaTypes) Get ¶ added in v1.3.2
func (h *AreaTypes) Get(w http.ResponseWriter, r *http.Request)
Get is the handler for GET /population-types/{population-type}/area-types
func (*AreaTypes) GetParentAreaCount ¶ added in v1.11.0
func (h *AreaTypes) GetParentAreaCount(w http.ResponseWriter, r *http.Request)
GetParentAreaCount is the handler for /population-types/{population-type}/area-types/{area-type}/parents
func (*AreaTypes) GetParents ¶ added in v1.3.2
func (h *AreaTypes) GetParents(w http.ResponseWriter, r *http.Request)
GetParents is the handler for /population-types/{population-type}/area-types/{area-type}/parents
type Areas ¶ added in v1.2.0
type Areas struct {
// contains filtered or unexported fields
}
Areas handles requests to /area-types
type CantabularError ¶ added in v1.26.0
type CantabularError string
type CensusObservations ¶ added in v1.25.0
type CensusObservations struct {
// contains filtered or unexported fields
}
func NewCensusObservations ¶ added in v1.25.0
func NewCensusObservations(cfg *config.Config, r responder, c cantabularClient) *CensusObservations
NewCensusObservations returns a new census observations
func (*CensusObservations) Get ¶ added in v1.25.0
func (c *CensusObservations) Get(w http.ResponseWriter, r *http.Request)
type DatasetJSONLinks ¶ added in v1.25.0
type Datastore ¶ added in v1.22.0
type Datastore interface {
GetDefaultDatasetMetadata(ctx context.Context, populationType string) (*datastore.DefaultDatasetMetadata, error)
PutDefaultDatasetMetadata(ctx context.Context, metadata datastore.DefaultDatasetMetadata) error
GetDefaultDatasetPopulationTypes(ctx context.Context) ([]string, error)
}
type Dimensions ¶ added in v1.8.0
type Dimensions struct {
// contains filtered or unexported fields
}
func NewDimensions ¶ added in v1.8.0
func NewDimensions(cfg *config.Config, r responder, c cantabularClient, d datasetAPIClient) *Dimensions
NewDimensions returns a new AreaTypes handler set
func (*Dimensions) GetAll ¶ added in v1.8.0
func (h *Dimensions) GetAll(w http.ResponseWriter, r *http.Request)
GetAll is the handler for GET /population-types/{population-type}/dimensions
func (*Dimensions) GetBaseVariable ¶ added in v1.13.0
func (h *Dimensions) GetBaseVariable(w http.ResponseWriter, r *http.Request)
GetBase returns the base variables for a given categorisation
func (*Dimensions) GetBlockedAreaCount ¶ added in v1.22.0
func (h *Dimensions) GetBlockedAreaCount(w http.ResponseWriter, r *http.Request)
func (*Dimensions) GetCategorisations ¶ added in v1.9.0
func (h *Dimensions) GetCategorisations(w http.ResponseWriter, r *http.Request)
GetCategorisations is the handler for GET /population-types/{population-type}/dimensions/{dimension}/categoristations
func (*Dimensions) GetDescription ¶ added in v1.21.0
func (h *Dimensions) GetDescription(w http.ResponseWriter, r *http.Request)
GetDescription is the handler for GET /population-types/{population-type}/dimensions-description
func (*Dimensions) GetDimensionCategories ¶ added in v1.21.0
func (h *Dimensions) GetDimensionCategories(w http.ResponseWriter, r *http.Request)
GetDimensionCategories is the handler for GET/population-types/{population-type}/dimension-categories?dims=xxx
type Error ¶ added in v1.2.0
type Error struct {
// contains filtered or unexported fields
}
Error is the packages error type
func (Error) LogData ¶ added in v1.2.0
LogData satisfies the dataLogger interface which is used to recover log data from an error
func (Error) Message ¶ added in v1.2.0
Message satisfies the messager interface which is used to specify a response to be sent to the caller in place of the error text for a given error. This is useful when you don't want sensitive information or implementation details being exposed to the caller which could be used to find exploits in our API
type GetFilterDimensionOptionsItem ¶ added in v1.25.0
type GetObservationResponse ¶ added in v1.25.0
type GetObservationResponse struct {
Dimensions []ObservationDimension `bson:"dimensions" json:"dimensions"`
Observation float32 `bson:"observation" json:"observation"`
}
type GetObservationsResponse ¶ added in v1.25.0
type GetObservationsResponse struct {
Observations []GetObservationResponse `bson:"observations" json:"observations"`
Links DatasetJSONLinks `json:"links"`
TotalObservations int `json:"total_observations"`
BlockedAreas int `json:"blocked_areas"`
TotalAreas int `json:"total_areas"`
AreasReturned int `json:"areas_returned"`
}
type ObservationDimension ¶ added in v1.25.0
type PopulationTypeMetadata ¶ added in v1.22.0
type PopulationTypeMetadata struct {
MongoClient Datastore
// contains filtered or unexported fields
}
func NewMetadata ¶ added in v1.24.0
func NewMetadata(cfg *config.Config, r responder, d Datastore) *PopulationTypeMetadata
NewMetadata returns a new Metadata Handler
func (*PopulationTypeMetadata) Get ¶ added in v1.22.0
func (m *PopulationTypeMetadata) Get(w http.ResponseWriter, r *http.Request)
func (*PopulationTypeMetadata) Put ¶ added in v1.22.0
func (m *PopulationTypeMetadata) Put(w http.ResponseWriter, r *http.Request)
type PopulationTypes ¶
type PopulationTypes struct {
// contains filtered or unexported fields
}
func NewPopulationTypes ¶
func NewPopulationTypes(cfg *config.Config, r responder, c cantabularClient, d datasetAPIClient, m Datastore) *PopulationTypes
func (*PopulationTypes) Get ¶
func (h *PopulationTypes) Get(w http.ResponseWriter, r *http.Request)
func (*PopulationTypes) GetAll ¶ added in v1.24.0
func (h *PopulationTypes) GetAll(w http.ResponseWriter, req *http.Request)