models

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: MIT Imports: 1 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RectifyKeywords added in v0.5.0

func RectifyKeywords(keywords []string, keywordsLimit int) []string

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.

Types

type CMDData added in v0.7.0

type CMDData struct {
	UID            string         `json:"uid"`
	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"`
}

ContentPublished provides an avro structure for a Content Published event

type DatasetDetails added in v0.7.0

type DatasetDetails struct {
	Title       string   `json:"title"`
	Description string   `json:"description"`
	Keywords    []string `json:"keywords,omitempty"`
}

DatasetDetails represents a DatasetDetails for an edition within a dataset

type Description

type Description struct {
	CDID            string   `json:"cdid"`
	DatasetID       string   `json:"datasetId"`
	Edition         string   `json:"edition"`
	Keywords        []string `json:"keywords,omitempty"`
	MetaDescription string   `json:"metaDescription"`
	ReleaseDate     string   `json:"releaseDate"`
	Summary         string   `json:"summary"`
	Title           string   `json:"title"`
}

type SearchDataImport

type SearchDataImport struct {
	UID             string   `avro:"uid"`
	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"`
	TraceID         string   `avro:"trace_id"`
}

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"`
	DataType    string      `json:"type"`
	Description Description `json:"description"`
}

ZebedeeData provides model for zebedee publisheddata response

Jump to

Keyboard shortcuts

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