model

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Completed = "completed"
	Submitted = "submitted"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockedOptions

type BlockedOptions struct {
	BlockedOptions []string `bson:"blocked_options" json:"blocked_options"`
	BlockedCount   int      `bson:"blocked_count"   json:"blocked_count"`
}

type Dataset

type Dataset struct {
	ID              string `bson:"id"               json:"id"`
	Edition         string `bson:"edition"          json:"edition"`
	Version         int    `bson:"version"          json:"version"`
	LowestGeography string `bson:"lowest_geography" json:"lowest_geography"`
	ReleaseDate     string `bson:"release_date"     json:"release_date"`
	Title           string `bson:"title"            json:"title"`
}

type Dimension

type Dimension struct {
	Name                  string   `bson:"name"                             json:"name"`
	ID                    string   `bson:"id"                               json:"id"`
	Label                 string   `bson:"label"                            json:"label"`
	DefaultCategorisation string   `bson:"default_categorisation,omitempty" json:"default_categorisation,omitempty"`
	Options               []string `bson:"options"                          json:"options"`
	IsAreaType            *bool    `bson:"is_area_type"                     json:"is_area_type,omitempty"`
	FilterByParent        string   `bson:"filter_by_parent,omitempty"       json:"filter_by_parent,omitempty"`
	QualityStatementText  string   `bson:"quality_statement_text,omitempty" json:"quality_statement_text,omitempty"`
	QualitySummaryURL     string   `bson:"quality_summary_url,omitempty"    json:"quality_summary_url,omitempty"`
}

type DisclosureControl

type DisclosureControl struct {
	Status         string         `bson:"status"          json:"status"`
	Dimension      string         `bson:"dimension"       json:"dimension"`
	BlockedOptions BlockedOptions `bson:"blocked_options" json:"blocked_options"`
}

type Downloads

type Downloads struct {
	XLS  *FileInfo `bson:"xls,omitempty"   json:"xls,omitempty"`
	XLSX *FileInfo `bson:"xlsx,omitempty"  json:"xlsx,omitempty"`
	CSV  *FileInfo `bson:"csv,omitempty"   json:"csv,omitempty"`
	TXT  *FileInfo `bson:"txt,omitempty"   json:"txt,omitempty"`
	CSVW *FileInfo `bson:"csvw,omitempty"  json:"csvw,omitempty"`
}

Downloads holds download information for various file types. Items are in a specific order and should not be changed (xlsx, csv, txt, csvw)

type Event

type Event struct {
	Timestamp string `bson:"timestamp" json:"timestamp"`
	Name      string `bson:"name"      json:"name"`
}

type FileInfo

type FileInfo struct {
	HREF    string `bson:"href"    json:"href"`
	Size    string `bson:"size"    json:"size"`
	Public  string `bson:"public"  json:"public"`
	Private string `bson:"private" json:"private"`
	Skipped bool   `bson:"skipped" json:"skipped"`
}

func (*FileInfo) IsNotFullyPopulated

func (fi *FileInfo) IsNotFullyPopulated() error

type Filter

type Filter struct {
	ID                string              `bson:"filter_id"                    json:"filter_id"`
	InstanceID        string              `bson:"instance_id"                  json:"instance_id"`
	Dataset           Dataset             `bson:"dataset"                      json:"dataset"`
	Published         bool                `bson:"published"                    json:"published"`
	Custom            bool                `bson:"custom"                       json:"custom"`
	DisclosureControl *DisclosureControl  `bson:"disclosure_control,omitempty" json:"disclosure_control,omitempty"`
	Type              string              `bson:"type"                         json:"type"`
	PopulationType    string              `bson:"population_type"              json:"population_type"`
	Links             FilterLinks         `bson:"links"                        json:"links"`
	Dimensions        []Dimension         `bson:"dimensions"                   json:"dimensions,omitempty"`
	UniqueTimestamp   primitive.Timestamp `bson:"unique_timestamp"             json:"-"`
	LastUpdated       time.Time           `bson:"last_updated"                 json:"-"`
	ETag              string              `bson:"etag"                         json:"-"`
}

Filter holds details for a user filter journey

func (*Filter) Hash

func (f *Filter) Hash(extraBytes []byte) (string, error)

Hash generates a SHA-1 hash of the filter struct. SHA-1 is not cryptographically safe, but it has been selected for performance as we are only interested in uniqueness. ETag field value is ignored when generating a hash. An optional byte array can be provided to append to the hash. This can be used, for example, to calculate a hash of this instance and an update applied to it.

func (*Filter) HashDimensions added in v1.2.0

func (f *Filter) HashDimensions() (string, error)
type FilterLinks struct {
	Version    Link `bson:"version"    json:"version"`
	Self       Link `bson:"self"       json:"self"`
	Dimensions Link `bson:"dimensions" json:"dimensions"`
}

type FilterOutput

type FilterOutput struct {
	ID                string              `bson:"id,omitempty"                 json:"id,omitempty"`
	FilterID          string              `bson:"filter_id"                    json:"filter_id"`
	InstanceID        string              `bson:"instance_id"                  json:"instance_id"`
	Dataset           Dataset             `bson:"dataset"                      json:"dataset"`
	Published         bool                `bson:"published"                    json:"published"`
	Custom            bool                `bson:"custom"                       json:"custom"`
	State             string              `bson:"state,omitempty"              json:"state,omitempty"`
	Downloads         Downloads           `bson:"downloads,omitempty"          json:"downloads,omitempty"`
	Events            []Event             `bson:"events"                       json:"events"`
	Type              string              `bson:"type"                         json:"type"`
	PopulationType    string              `bson:"population_type"              json:"population_type"`
	DisclosureControl *DisclosureControl  `bson:"disclosure_control,omitempty" json:"disclosure_control,omitempty"`
	Links             FilterOutputLinks   `bson:"links"                        json:"links"`
	Dimensions        []Dimension         `bson:"dimensions"                   json:"dimensions"`
	UniqueTimestamp   primitive.Timestamp `bson:"unique_timestamp"             json:"-"`
	LastUpdated       time.Time           `bson:"last_updated"                 json:"-"`
	ETag              string              `bson:"etag"                         json:"-"`
}
type FilterOutputLinks struct {
	Version         Link `bson:"version" json:"version"`
	Self            Link `bson:"self"    json:"self"`
	FilterBlueprint Link `json:"filter_blueprint"`
}
type Link struct {
	HREF  string `bson:"href"            json:"href"`
	Label string `bson:"label,omitempty" json:"label,omitempty"`
	ID    string `bson:"id,omitempty"    json:"id,omitempty"`
}
type SubmitFilterLinks struct {
	Dimensions Link `bson:"dimensions" json:"dimensions"`
}

Jump to

Keyboard shortcuts

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