Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code struct {
ID string `json:"code"`
Label string `json:"label"`
Links *CodeLinks `json:"links"`
}
Code for a single dimensions type
func (*Code) UpdateLinks ¶
UpdateLinks updates the links for a code list
type CodeLinks ¶
type CodeLinks struct {
CodeList *Link `json:"code_list"`
Datasets *Link `json:"datasets"`
Self *Link `json:"self"`
}
CodeLinks contains links for a code resource
type CodeList ¶
type CodeList struct {
ID string `json:"-"`
Links *CodeListLink `json:"links,omitempty"`
}
CodeList containing links to all possible codes
func NewCodeList ¶
NewCodeList creates a new CodeList struct from a CodeList DB model
func (*CodeList) UpdateLinks ¶
UpdateLinks updates the links from
type CodeListLink ¶
type CodeListLink struct {
Self *Link `json:"self,omitempty"`
Editions *Link `json:"editions,omitempty"`
}
CodeListLink contains links for a code list resource
type CodeListResults ¶
type CodeListResults struct {
Items []CodeList `json:"items"`
Count int `json:"count"`
Offset int `json:"offset"`
Limit int `json:"limit"`
TotalCount int `json:"total_count"`
}
CodeListResults contains an array of code lists which can be paginated
func NewCodeListResults ¶
func NewCodeListResults(dbCodeLists []dbmodels.CodeList) *CodeListResults
NewCodeListResults creates a new CodeListResult struct from a CodeListResult DB model.
type CodeResults ¶
type CodeResults struct {
Items []Code `json:"items"`
Count int `json:"count"`
Offset int `json:"offset"`
Limit int `json:"limit"`
TotalCount int `json:"total_count"`
}
CodeResults contains an array of codes which can be paginated
func NewCodeResults ¶
func NewCodeResults(dbCodes []dbmodels.Code) *CodeResults
NewCodeResults creates a new CodeResult struct from a CodeResult DB model.
type Dataset ¶
type Dataset struct {
ID string
Links *DatasetLinks `json:"links"`
DimensionLabel string `json:"dimension_label"`
Editions []DatasetEdition `json:"editions"`
}
Dataset represents an individual model dataset
func NewDataset ¶
NewDataset creates a new Dataset struct from a database Dataset struct
func (*Dataset) UpdateLinks ¶
UpdateLinks updates the Dataset Self Link, and all the nested DatasetEdition links.
type DatasetEdition ¶
type DatasetEdition struct {
ID string
LatestVersion int
Links *DatasetEditionLinks `json:"links"`
}
func NewDatasetEdition ¶
func NewDatasetEdition(dbDatasetEdition *dbmodels.DatasetEdition) *DatasetEdition
NewDatasetEdition creates a new DatasetEdition struct from a database DatasetEdition
func (*DatasetEdition) UpdateLinks ¶
func (e *DatasetEdition) UpdateLinks(datasetAPIhost, codeListID, datasetID string) error
UpdateLinks updates the links for the DatasetEdition
type DatasetEditionLinks ¶
type DatasetLinks ¶
type DatasetLinks struct {
Self *Link `json:"self"`
}
DatasetLinks represents the links returned specifically for a dataset
type Datasets ¶
type Datasets struct {
Items []Dataset `json:"items"`
Count int `json:"count"`
Offset int `json:"offset"`
Limit int `json:"limit"`
TotalCount int `json:"total_count"`
}
Datasets represents the model returned from the api datasets endpoint
func NewDatasets ¶
NewDatasets creates a new Datasets struct from a database Datasets
func (*Datasets) UpdateLinks ¶
UpdateLinks updates the Dataset Links for all datasets in items.
type Edition ¶
type Edition struct {
ID string `json:"edition"`
Label string `json:"label"`
Links *EditionLinks `json:"links"`
}
Edition represents a single edition response model
func NewEdition ¶
NewEdition creates an Edition struct from a DB Edition model
func (*Edition) UpdateLinks ¶
UpdateLinks updates the EditionLinks in the Edition struct with the provided codeListID
type EditionLinks ¶
type EditionLinks struct {
Self *Link `json:"self"`
Editions *Link `json:"editions"`
Codes *Link `json:"codes"`
}
EditionLinks represents the links returned for a specific edition
type Editions ¶
type Editions struct {
Items []Edition `json:"items"`
Count int `json:"count"`
Offset int `json:"offset"`
Limit int `json:"limit"`
TotalCount int `json:"total_count"`
}
Editions represents the editions response model
func NewEditions ¶
NewEditions creates an Editions struct from a DB Editions model