models

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Version docType = iota
	Dataset
)

List of possible document types

View Source
const (
	CreatedState          = "created"
	SubmittedState        = "submitted"
	CompletedState        = "completed"
	EditionConfirmedState = "edition-confirmed"
	AssociatedState       = "associated"
	PublishedState        = "published"
	DetachedState         = "detached"
	FailedState           = "failed"
)

A list of reusable states across application

Variables

This section is empty.

Functions

func CheckState

func CheckState(doc docType, state string) error

CheckState checks state against a whitelist of valid states

Types

type DimensionObject

type DimensionObject struct {
	HRef  string `json:"href"`
	ID    string `json:"id"`
	Label string `json:"label"`
}

DimensionObject represents the unique dimension option data relevant to the observation

type FilterSubmitted added in v0.7.0

type FilterSubmitted struct {
	FilterID   string `avro:"filter_output_id"`
	InstanceID string `avro:"instance_id"`
	DatasetID  string `avro:"dataset_id"`
	Edition    string `avro:"edition"`
	Version    string `avro:"version"`
}

FilterSubmitted is the structure of each event consumed.

type Observation

type Observation struct {
	Dimensions  map[string]*DimensionObject `json:"dimensions,omitempty"`
	Metadata    map[string]string           `json:"metadata,omitempty"`
	Observation string                      `json:"observation"`
}

Observation represents an object containing a single observation and its equivalent metadata

type ObservationLinks struct {
	DatasetMetadata *dataset.Link `json:"dataset_metadata,omitempty"`
	Self            *dataset.Link `json:"self,omitempty"`
	Version         *dataset.Link `json:"version,omitempty"`
}

ObservationLinks represents a link object to list of links relevant to the observation

type ObservationsDoc

type ObservationsDoc struct {
	Dimensions        map[string]Option    `json:"dimensions"`
	Limit             int                  `json:"limit"`
	Links             *ObservationLinks    `json:"links"`
	Observations      []Observation        `json:"observations"`
	Offset            int                  `json:"offset"`
	TotalObservations int                  `json:"total_observations"`
	UnitOfMeasure     string               `json:"unit_of_measure,omitempty"`
	UsageNotes        *[]dataset.UsageNote `json:"usage_notes,omitempty"`
}

ObservationsDoc represents information (observations) relevant to a version

func CreateObservationsDoc

func CreateObservationsDoc(obsAPIURL, rawQuery string, versionDoc *dataset.Version, datasetDetails dataset.DatasetDetails, observations []Observation, queryParameters map[string]string, offset, limit int) *ObservationsDoc

CreateObservationsDoc manages the creation of metadata across dataset and version docs

type Option

type Option struct {
	LinkObject *dataset.Link `json:"option,omitempty"`
}

Option represents an object containing a list of link objects that refer to the code url for that dimension option

Jump to

Keyboard shortcuts

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