model

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dimension

type Dimension struct {
	Order *int
	// contains filtered or unexported fields
}

Dimension struct wraps the Dimension dataset API model defined in dp-api-clients, for extra functionality

func NewDimension

func NewDimension(dimension *dataset.Dimension) *Dimension

NewDimension creates a new DB wrapped Dimension from an api dimension

func (*Dimension) CodeListID

func (d *Dimension) CodeListID() string

CodeListID returns the code list ID linked by this dimension

func (*Dimension) DbModel

func (d *Dimension) DbModel() *db.Dimension

DbModel returns a DB representation of the Dimension model

func (*Dimension) GetName

func (d *Dimension) GetName(instanceID string) string

GetName return the name or type of Dimension e.g. sex, geography time etc.

func (*Dimension) Validate

func (d *Dimension) Validate() error

Validate validates tha Dimension is not nil and that there are values for DimensionID and Option

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

Instance struct to hold instance information by wrapping DB Instance model

func NewInstance

func NewInstance(instance *dataset.Instance) *Instance

NewInstance creates a new Instance struct from an API Instance model

func (*Instance) AddDimension

func (i *Instance) AddDimension(d *Dimension)

AddDimension add a dimension distinct type/name to the instance.

func (*Instance) DbModel

func (i *Instance) DbModel() *db.Instance

DbModel returns the DB model of an instance struct

func (*Instance) Validate

func (i *Instance) Validate() error

Validate validates that the instance is not nil and has an ID

Jump to

Keyboard shortcuts

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