model

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

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"`
}

type Dimension

type Dimension struct {
	Name         string   `bson:"name"          json:"name"`
	Options      []string `bson:"options"       json:"options"`
	DimensionURL string   `bson:"dimension_url" json:"dimension_url,omitempty"`
	IsAreaType   bool     `bson:"is_area_type"  json:"is_area_type"`
}

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 {
	CSV  *FileInfo `bson:"csv,omitempty"   json:"csv,omitempty"`
	CSVW *FileInfo `bson:"csvw,omitempty"  json:"csvw,omitempty"`
	TXT  *FileInfo `bson:"txt,omitempty"   json:"txt,omitempty"`
	XLS  *FileInfo `bson:"xls,omitempty"   json:"xls,omitempty"`
}

type Event

type Event struct {
	Timestamp time.Time `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"`
	Links             Links               `bson:"links"                        json:"links"`
	FilterOutput      *FilterOutput       `bson:"filter_output,omitempty"      json:"filter_output,omitempty"`
	Events            []Event             `bson:"events"                       json:"events"`
	UniqueTimestamp   primitive.Timestamp `bson:"unique_timestamp"             json:"-"`
	LastUpdated       time.Time           `bson:"last_updated"                 json:"-"`
	ETag              string              `bson:"etag"                         json:"-"`
	InstanceID        string              `bson:"instance_id"                  json:"instance_id"`
	Dimensions        []Dimension         `bson:"dimensions"                   json:"dimensions"`
	Dataset           Dataset             `bson:"dataset"                      json:"dataset"`
	Published         bool                `bson:"published"                    json:"published"`
	DisclosureControl *DisclosureControl  `bson:"disclosure_control,omitempty" json:"disclosure_control,omitempty"`
	Type              string              `bson:"type"                         json:"type"`
	PopulationType    string              `bson:"population_type"              json:"population_type"`
}

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.

type FilterOutput

type FilterOutput struct {
	ID        string    `bson:"id,omitempty"   json:"id,omitempty"`
	State     string    `bson:"state,omitempty"   json:"state,omitempty"`
	Downloads Downloads `bson:"downloads,omitempty"   json:"downloads,omitempty"`
}
type FilterOutputLinks struct {
	Links
	FilterBlueprint Link `json:"filter_blueprint"`
}

type JobState

type JobState struct {
	InstanceID       string  `json:"instance_id"`
	DimensionListUrl string  `json:"dimension_list_url"`
	FilterID         string  `json:"filter_id"`
	Events           []Event `json:"events"`
}
type Link struct {
	HREF string `bson:"href"           json:"href"`
	ID   string `bson:"id,omitempty"   json:"id,omitempty"`
}
type Links struct {
	Version Link `bson:"version" json:"version"`
	Self    Link `bson:"self"    json:"self"`
}

type PutFilter

type PutFilter struct {
	Events         []Event `bson:"events"                       json:"events"`
	Dataset        Dataset `bson:"dataset"                      json:"dataset"`
	PopulationType string  `bson:"population_type"              json:"population_type"`
}

PutFilter holds details for PUT filter response

Jump to

Keyboard shortcuts

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