Documentation
¶
Index ¶
- Constants
- func RectifyKeywords(keywords []string, keywordsLimit int) []string
- func ValidateTopics(topics []string) []string
- type CMDData
- type ContentPublished
- type DatasetDetails
- type Description
- type ReleaseDateChange
- type ReleaseDateDetails
- type SearchDataImport
- type VersionDetails
- type ZebedeeData
Constants ¶
const (
ReleaseDataType = "release"
)
Variables ¶
This section is empty.
Functions ¶
func RectifyKeywords ¶ added in v0.5.0
RectifyKeywords sanitises a slice of keywords, splitting any that contain commas into seperate keywords and trimming any whitespace. It also optionally takes a limit which truncates the keywords to the desired amount. This value can be -1 for no truncation.
func ValidateTopics ¶ added in v0.11.0
Types ¶
type CMDData ¶ added in v0.7.0
type CMDData struct {
UID string `json:"uid"`
URI string `json:"uri"`
VersionDetails VersionDetails `json:"version"`
DatasetDetails DatasetDetails `json:"datasetdetails"`
}
CMDData provides model for datasetAPI metadata response
type ContentPublished ¶
type ContentPublished struct {
URI string `avro:"uri"`
DataType string `avro:"data_type"`
CollectionID string `avro:"collection_id"`
JobID string `avro:"job_id"`
SearchIndex string `avro:"search_index"`
TraceID string `avro:"trace_id"`
}
ContentPublished provides an avro structure for a Content Published event
type DatasetDetails ¶ added in v0.7.0
type DatasetDetails struct {
CanonicalTopic string `json:"canonical_topic,omitempty"`
DatasetID string `json:"dataset_id,omitempty"`
Description string `json:"description"`
Edition string `json:"edition,omitempty"`
Keywords []string `json:"keywords,omitempty"`
Subtopics []string `json:"subtopics,omitempty"`
Title string `json:"title"`
URI string `json:"uri,omitempty"`
}
DatasetDetails represents a DatasetDetails for an edition within a dataset
type Description ¶
type Description struct {
Cancelled bool `json:"cancelled,omitempty"`
CDID string `json:"cdid"`
DatasetID string `json:"datasetId"`
Edition string `json:"edition"`
Finalised bool `json:"finalised,omitempty"`
Keywords []string `json:"keywords,omitempty"`
MetaDescription string `json:"metaDescription"`
ProvisionalDate string `json:"provisionalDate,omitempty"`
CanonicalTopic string `json:"canonicalTopic,omitempty"`
Published bool `json:"published,omitempty"`
ReleaseDate string `json:"releaseDate"`
Summary string `json:"summary"`
Title string `json:"title"`
Topics []string `json:"secondaryTopics,omitempty"`
Language string `json:"language,omitempty"`
Survey string `json:"survey,omitempty"`
}
type ReleaseDateChange ¶ added in v0.14.0
type ReleaseDateChange struct {
ChangeNotice string `json:"changeNotice"`
Date string `json:"previousDate"`
}
ReleaseDateChange represent a date change of a release
type ReleaseDateDetails ¶ added in v0.14.0
type ReleaseDateDetails struct {
ChangeNotice string `avro:"change_notice"`
Date string `avro:"previous_date"`
}
ReleaseDateChange represent a date change of a release
type SearchDataImport ¶
type SearchDataImport struct {
UID string `avro:"uid"`
URI string `avro:"uri"`
Edition string `avro:"edition"`
DataType string `avro:"data_type"`
JobID string `avro:"job_id"`
SearchIndex string `avro:"search_index"`
CDID string `avro:"cdid"`
DatasetID string `avro:"dataset_id"`
Keywords []string `avro:"keywords"`
MetaDescription string `avro:"meta_description"`
ReleaseDate string `avro:"release_date"`
Summary string `avro:"summary"`
Title string `avro:"title"`
Topics []string `avro:"topics"`
TraceID string `avro:"trace_id"`
DateChanges []ReleaseDateDetails `avro:"date_changes"`
Cancelled bool `avro:"cancelled"`
Finalised bool `avro:"finalised"`
ProvisionalDate string `avro:"provisional_date"`
CanonicalTopic string `avro:"canonical_topic"`
Published bool `avro:"published"`
Language string `avro:"language"`
Survey string `avro:"survey"`
}
SearchDataImport provides event data for a search data import
func MapVersionMetadataToSearchDataImport ¶ added in v0.7.0
func MapVersionMetadataToSearchDataImport(cmdData CMDData) SearchDataImport
MapDatasetVersionToSearchDataImport performs default mapping of datasetAPI data to a version metadata struct.
func MapZebedeeDataToSearchDataImport ¶ added in v0.5.0
func MapZebedeeDataToSearchDataImport(zebedeeData ZebedeeData, keywordsLimit int) SearchDataImport
MapZebedeeDataToSearchDataImport Performs default mapping of zebedee data to a SearchDataImport struct. It also optionally takes a limit which truncates the keywords to the desired amount. This value can be -1 for no truncation.
type VersionDetails ¶ added in v0.7.0
type VersionDetails struct {
ReleaseDate string `json:"release_date,omitempty"`
}
Version represents a version for an edition within a dataset
type ZebedeeData ¶
type ZebedeeData struct {
UID string `json:"uid"`
URI string `json:"uri"`
DataType string `json:"type"`
Description Description `json:"description"`
DateChanges []ReleaseDateChange `json:"dateChanges,omitempty"`
}
ZebedeeData provides model for zebedee publisheddata response