senseobjdef

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDataHeight = 500
)

Non iota constants

Variables

View Source
var (
	// DefaultListboxDef object definitions for listbox
	DefaultListboxDef = ObjectDef{
		DataDef{DataDefListObject, "/qListObject"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{DataTypeListObject, "/qListObjectDef", DefaultDataHeight},
				},
			}},
		},
		&Select{SelectTypeListObjectValues, "/qListObjectDef"},
	}

	// DefaultFilterpane object definitions for
	DefaultFilterpane = ObjectDef{
		DataDef{DataDefNoData, ""},
		nil,
		nil,
	}

	// DefaultBarchart object definitions for barchart
	DefaultBarchart = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{DataTypeHyperCubeReducedData, "/qHyperCubeDef", DefaultDataHeight},
				},
			}},
		},
		&Select{SelectTypeHypercubeValues, "/qHyperCubeDef"},
	}

	// DefaultScatterplot object definitions for scatterplot
	DefaultScatterplot = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				[]*Constraint{&Constraint{
					Path:     "/qHyperCube/qSize/qcy",
					Value:    ">1000",
					Required: true,
				}},
				[]GetDataRequests{
					{
						Type: DataTypeHyperCubeBinnedData,
						Path: "/qHyperCubeDef",
					},
				},
			}},
			{DataCore{
				Requests: []GetDataRequests{
					{
						DataTypeHyperCubeData,
						"/qHyperCubeDef",
						1000,
					},
				},
			}},
		},
		&Select{SelectTypeHypercubeValues, "/qHyperCubeDef"},
	}

	// DefaultMap object definitions for map
	DefaultMap = ObjectDef{
		DataDef{DataDefHyperCube, "/qUndoExclude/gaLayers/[0]/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		&Select{SelectTypeHypercubeValues, "/qUndoExclude/gaLayers/0/qHyperCubeDef"},
	}

	// DefaultCombochart object definitions for combochart
	DefaultCombochart = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		&Select{SelectTypeHypercubeValues, "/qHyperCubeDef"},
	}

	// DefaultTable object definitions for table
	DefaultTable = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						DataTypeHyperCubeDataColumns,
						"/qHyperCubeDef",
						40,
					},
				},
			}},
		},
		&Select{SelectTypeHypercubeColumnValues, "/qHyperCubeDef"},
	}

	// DefaultPivotTable object definitions for pivot-table
	DefaultPivotTable = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		&Select{SelectTypeHypercubeValues, "/qHyperCubeDef"},
	}

	// DefaultLinechart object definitions for linechart
	DefaultLinechart = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				[]*Constraint{
					&Constraint{
						Path:     "/preferContinuousAxis",
						Value:    "=true",
						Required: false,
					},
					&Constraint{
						Path:     "/qHyperCube/qDimensionInfo/[0]/qTags",
						Value:    "~$numeric",
						Required: false,
					},
				},
				[]GetDataRequests{
					{
						Type: DataTypeHyperCubeContinuousData,
						Path: "/qHyperCubeDef",
					},
				},
			}}, {DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeHyperCubeReducedData,
						Path: "/qHyperCubeDef",
					},
				},
			}},
		},
		&Select{SelectTypeHypercubeValues, "/qHyperCubeDef"},
	}

	// DefaultPiechart object definitions for piechart
	DefaultPiechart = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		&Select{SelectTypeHypercubeValues, "/qHyperCubeDef"},
	}

	// DefaultTreemap object definitions for treemap
	DefaultTreemap = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		&Select{SelectTypeHypercubeValues, "/qHyperCubeDef"},
	}

	// DefaultMekkoChart object definitions for mekkochart
	DefaultMekkoChart = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		&Select{SelectTypeHypercubeValues, "/qHyperCubeDef"},
	}

	// DefaultTextImage object definitions for text-image
	DefaultTextImage = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		nil,
	}

	// DefaultKpi object definitions for kpi
	DefaultKpi = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		nil,
	}

	// DefaultGauge object definitions for gauge
	DefaultGauge = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		nil,
	}

	// DefaultBoxplot object definitions for boxplot
	DefaultBoxplot = ObjectDef{
		DataDef{DataDefHyperCube, "/qUndoExclude/box/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeHyperCubeData,
						Path: "/qUndoExclude/box/qHyperCubeDef",
					},
					{
						Type: DataTypeHyperCubeStackData,
						Path: "/qUndoExclude/outliers/qHyperCubeDef",
					},
				},
			}},
		},
		&Select{SelectTypeHypercubeValues, "/qUndoExclude/box/qHyperCubeDef"},
	}

	// DefaultDistributionplot object definitions for distributionplot
	DefaultDistributionplot = ObjectDef{
		DataDef{DataDefHyperCube, "/qUndoExclude/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeHyperCubeStackData,
						Path: "/qUndoExclude/qHyperCubeDef",
					},
				},
			}},
		},
		&Select{SelectTypeHypercubeValues, "/qUndoExclude/qHyperCubeDef"},
	}

	// DefaultHistogram object definitions for histogram
	DefaultHistogram = ObjectDef{
		DataDef{DataDefHyperCube, "/qUndoExclude/box/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeHyperCubeData,
						Path: "/qUndoExclude/box/qHyperCubeDef",
					},
				},
			}},
		},
		&Select{SelectTypeHypercubeValues, "/qUndoExclude/box/qHyperCubeDef"},
	}

	// DefaultWaterfallChart object definitions for waterfallchart
	DefaultWaterfallChart = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		nil,
	}

	// DefaultQlikFunnelChartExt object definitions for qlik-funnel-chart-ext
	DefaultQlikFunnelChartExt = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		&Select{
			Type: SelectTypeHypercubeValues,
			Path: "/qHyperCubeDef",
		},
	}

	// DefaultQlikSankeyChartExt object definitions for qlik-sankey-chart-ext
	DefaultQlikSankeyChartExt = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		&Select{
			Type: SelectTypeHypercubeValues,
			Path: "/qHyperCubeDef",
		},
	}

	// Default object definitions for qlik-word-cloud
	DefaultQlikWordCloud = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		&Select{
			Type: SelectTypeHypercubeValues,
			Path: "/qHyperCubeDef",
		},
	}

	DefaultQlikRadarChart = ObjectDef{
		DataDef{
			Type: DataDefHyperCube,
			Path: "/qHyperCube",
		},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		&Select{
			Type: SelectTypeHypercubeValues,
			Path: "/qHyperCubeDef",
		},
	}

	DefaultQlikBulletChart = ObjectDef{
		DataDef{
			Type: DataDefHyperCube,
			Path: "/qHyperCube",
		},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		nil,
	}

	DefaultBulletChart = ObjectDef{
		DataDef{
			Type: DataDefHyperCube,
			Path: "/qHyperCube",
		},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		&Select{
			Type: SelectTypeHypercubeValues,
			Path: "/qHyperCubeDef",
		},
	}

	DefaultQlikBarplusChart = ObjectDef{
		DataDef{
			Type: DataDefHyperCube,
			Path: "/qHyperCube",
		},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		&Select{
			Type: SelectTypeHypercubeValues,
			Path: "/qHyperCubeDef",
		},
	}

	DefaultQlikMultiKPIChart = ObjectDef{
		DataDef{
			Type: DataDefHyperCube,
			Path: "/qHyperCube",
		},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		nil,
	}

	DefaultQlikNetworkChart = ObjectDef{
		DataDef{
			Type: DataDefHyperCube,
			Path: "/qHyperCube",
		},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		&Select{
			Type: SelectTypeHypercubeValues,
			Path: "/qHyperCubeDef",
		},
	}

	DefaultQlikHeatmapChart = ObjectDef{
		DataDef{
			Type: DataDefHyperCube,
			Path: "/qHyperCube",
		},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		nil,
	}

	DefaultSNOrgChart = ObjectDef{
		DataDef: DataDef{
			Type: DataDefHyperCube,
			Path: "/qHyperCube",
		},
		Data: []Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		Select: &Select{
			Type: SelectTypeHypercubeValues,
			Path: "/qHyperCubeDef",
		},
	}

	DefaultSheet = ObjectDef{
		DataDef: DataDef{
			Type: DataDefNoData,
		},
		Data: []Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		Select: nil,
	}

	DefaultOdagToolbarNavpoint = ObjectDef{
		DataDef{
			Type: DataDefHyperCube,
			Path: "/qHyperCubeDef",
		},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		&Select{
			Type: SelectTypeHypercubeValues,
			Path: "/qHyperCubeDef",
		},
	}

	DefaultActionButton = ObjectDef{
		DataDef: DataDef{
			Type: DataDefNoData,
		},
		Data: []Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		Select: nil,
	}

	DefaultContainer = ObjectDef{
		DataDef: DataDef{
			Type: DataDefNoData,
		},
		Data:   nil,
		Select: nil,
	}

	DefaultQlikShareButton = ObjectDef{
		DataDef: DataDef{
			Type: DataDefNoData,
		},
		Data: []Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		Select: nil,
	}

	DefaultQlikVariableInput = ObjectDef{
		DataDef: DataDef{
			Type: DataDefNoData,
		},
		Data: []Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		Select: nil,
	}

	DefaultQlikAnimator = ObjectDef{
		DataDef: DataDef{
			Type: DataDefHyperCube,
			Path: "/qHyperCube",
		},
		Data: []Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		Select: nil,
	}

	DefaultQlikDatePicker = ObjectDef{
		DataDef: DataDef{
			Type: DataDefListObject,
			Path: "/qListObject",
		},
		Data: []Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		Select: nil,
	}

	DefaultSNVideoPlayer = ObjectDef{
		DataDef: DataDef{
			Type: DataDefNoData,
		},
		Data: []Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		Select: nil,
	}

	DefaultSNGridChart = ObjectDef{
		DataDef: DataDef{
			Type: DataDefHyperCube,
			Path: "/qHyperCube",
		},
		Data: []Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type:   DataTypeHyperCubeTreeData,
						Path:   "/qHyperCubeDef",
						Height: 50,
					},
				},
			}},
		},
		Select: nil,
	}

	// DefaultSNTable object definitions for sn-table
	DefaultSNTable = ObjectDef{
		DataDef{DataDefHyperCube, "/qHyperCube"},
		[]Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						DataTypeHyperCubeData,
						"/qHyperCubeDef",
						100,
					},
				},
			}},
		},
		&Select{SelectTypeHypercubeColumnValues, "/qHyperCubeDef"},
	}

	// DefaultSNShape object definitions for sn-shape
	DefaultSNShape = ObjectDef{
		DataDef: DataDef{
			Type: DataDefNoData,
		},
		Data: []Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		Select: nil,
	}

	// DefaultSNText object definitions for sn-text
	DefaultSNText = ObjectDef{
		DataDef: DataDef{
			Type: DataDefNoData,
		},
		Data: []Data{
			{DataCore{
				Requests: []GetDataRequests{
					{
						Type: DataTypeLayout,
					},
				},
			}},
		},
		Select: nil,
	}

	// DefaultSNPivotTable
	DefaultSNPivotTable = ObjectDef{
		DataDef: DataDef{
			Type: DataDefHyperCube,
			Path: "/qHyperCube",
		},
		Data: []Data{
			{
				DataCore{
					Requests: []GetDataRequests{
						{
							Type: DataTypeLayout,
						},
					},
				},
			},
		},
	}

	// DefaultLayoutContainer, container type with all "children" visible
	DefaultLayoutContainer = ObjectDef{
		DataDef{DataDefNoData, ""},
		nil,
		nil,
	}

	DefaultTabbedContainer = ObjectDef{
		DataDef{DataDefNoData, ""},
		nil,
		nil,
	}

	DefaultObjectDefs = ObjectDefs{
		"listbox":               &DefaultListboxDef,
		"filterpane":            &DefaultFilterpane,
		"barchart":              &DefaultBarchart,
		"scatterplot":           &DefaultScatterplot,
		"map":                   &DefaultMap,
		"combochart":            &DefaultCombochart,
		"table":                 &DefaultTable,
		"pivot-table":           &DefaultPivotTable,
		"linechart":             &DefaultLinechart,
		"piechart":              &DefaultPiechart,
		"treemap":               &DefaultTreemap,
		"text-image":            &DefaultTextImage,
		"kpi":                   &DefaultKpi,
		"gauge":                 &DefaultGauge,
		"boxplot":               &DefaultBoxplot,
		"distributionplot":      &DefaultDistributionplot,
		"histogram":             &DefaultHistogram,
		"waterfallchart":        &DefaultWaterfallChart,
		"qlik-funnel-chart-ext": &DefaultQlikFunnelChartExt,
		"qlik-sankey-chart-ext": &DefaultQlikSankeyChartExt,
		"qlik-word-cloud":       &DefaultQlikWordCloud,
		"mekkochart":            &DefaultMekkoChart,
		"qlik-radar-chart":      &DefaultQlikRadarChart,
		"qlik-bullet-chart":     &DefaultQlikBulletChart,
		"bulletchart":           &DefaultBulletChart,
		"qlik-barplus-chart":    &DefaultQlikBarplusChart,
		"qlik-multi-kpi":        &DefaultQlikMultiKPIChart,
		"qlik-network-chart":    &DefaultQlikNetworkChart,
		"qlik-heatmap-chart":    &DefaultQlikHeatmapChart,
		"sn-org-chart":          &DefaultSNOrgChart,
		"sheet":                 &DefaultSheet,
		"odag-toolbar-navpoint": &DefaultOdagToolbarNavpoint,
		"action-button":         &DefaultActionButton,
		"container":             &DefaultContainer,
		"qlik-share-button":     &DefaultQlikShareButton,
		"qlik-variable-input":   &DefaultQlikVariableInput,
		"qlik-animator":         &DefaultQlikAnimator,
		"qlik-date-picker":      &DefaultQlikDatePicker,
		"sn-video-player":       &DefaultSNVideoPlayer,
		"sn-grid-chart":         &DefaultSNGridChart,
		"sn-table":              &DefaultSNTable,
		"sn-shape":              &DefaultSNShape,
		"sn-text":               &DefaultSNText,
		"sn-pivot-table":        &DefaultSNPivotTable,
		"sn-layout-container":   &DefaultLayoutContainer,
		"sn-tabbed-container":   &DefaultTabbedContainer,
	}
)

Functions

This section is empty.

Types

type Constraint

type Constraint struct {
	// Path to value to evaluate
	Path helpers.DataPath `json:"path"`
	// Value constraint definition, first character must be <,>,= or !
	// followed by number or the words true/false
	Value ConstraintValue `json:"value"`
	// Required require constraint to evaluate, error if evaluation fails
	Required bool `json:"required,omitempty"`
	// contains filtered or unexported fields
}

Constraint defining if to send get data requests

func (*Constraint) Evaluate

func (constraint *Constraint) Evaluate(data json.RawMessage) (bool, error)

Evaluate constraint value in data

func (*Constraint) Validate

func (constraint *Constraint) Validate() error

Validate constraint

type ConstraintValue

type ConstraintValue string

ConstraintValue value to evaluate. First character needs to be one of [<,>,=,!], followed by a number or one of the words [true,false]

type Data

type Data struct {
	DataCore
}

func (*Data) UnmarshalJSON added in v0.6.8

func (d *Data) UnmarshalJSON(arg []byte) error

UnmarshalJSON unmarshal Data

type DataCore added in v0.6.8

type DataCore struct {
	// Constraints constraint defining if to send requests
	Constraints []*Constraint `json:"constraints,omitempty"`
	// Requests List of data requests to send
	Requests []GetDataRequests `json:"requests,omitempty"`
}

Data Get data definitions

type DataDef

type DataDef struct {
	// Type of data
	Type DataDefType `json:"type"`
	// Path to data carrier
	Path helpers.DataPath `json:"path,omitempty"`
}

DataDef type of data and path to data carrier

type DataDefType

type DataDefType int

DataDefType type of data definition, e.g. ListObject or HyperCube

const (
	// DataDefUnknown unknown data definition type
	DataDefUnknown DataDefType = iota
	// DataDefListObject ListObject data carrier
	DataDefListObject
	// DataDefHyperCube HyperCube data carrier
	DataDefHyperCube
	// DataDefNoData object contains no data carrier
	DataDefNoData
)

When adding DataDefType, also: * add entry in dataDefTypeEnum

func (DataDefType) MarshalJSON

func (d DataDefType) MarshalJSON() ([]byte, error)

MarshalJSON marshal DataFuncType

func (DataDefType) String

func (d DataDefType) String() string

String representation of DataDefType

func (*DataDefType) UnmarshalJSON

func (d *DataDefType) UnmarshalJSON(arg []byte) error

UnmarshalJSON unmarshal DataDefType

type DataType

type DataType int

DataType Get Data function type

const (
	// DataTypeLayout get data from layout
	DataTypeLayout DataType = iota
	// DataTypeListObject get data from listobject data
	DataTypeListObject
	// HyperCubeData get data from hypercube
	DataTypeHyperCubeData
	// DataTypeHyperCubeDataColumns
	DataTypeHyperCubeDataColumns
	// HyperCubeReducedData get hypercube reduced data
	DataTypeHyperCubeReducedData
	// DataTypeHyperCubeBinnedData get hypercube binned data
	DataTypeHyperCubeBinnedData
	// DataTypeHyperCubeStackData get hypercube stacked data
	DataTypeHyperCubeStackData
	// DataTypeHyperCubeContinuousData get hypercube continuous data
	DataTypeHyperCubeContinuousData
	// DataTypeHyperCubeTreeData get hypercube tree data
	DataTypeHyperCubeTreeData
)

When adding DataType, also: * add entry in dataTypeEnum

func (DataType) MarshalJSON

func (typ DataType) MarshalJSON() ([]byte, error)

MarshalJSON marshal DataType

func (DataType) String

func (typ DataType) String() string

String representation of data type or "unknown"

func (*DataType) UnmarshalJSON

func (typ *DataType) UnmarshalJSON(arg []byte) error

UnmarshalJSON unmarshal DataType

type EmptyConstraintValueError

type EmptyConstraintValueError struct{}

EmptyConstraintValueError ConstraintValue is empty

func (EmptyConstraintValueError) Error

func (err EmptyConstraintValueError) Error() string

Error constraint value is empty

type GetDataRequests

type GetDataRequests struct {
	// Type of data function
	Type DataType `json:"type"`
	// Path for get data function
	Path string `json:"path,omitempty"`
	// Height of data to get in GetData
	Height int `json:"height,omitempty"`
}

GetDataRequests data requests to send

func (GetDataRequests) MaxHeight

func (data GetDataRequests) MaxHeight() int

MaxHeight max data to get

type MalformedConstraintValueError

type MalformedConstraintValueError ConstraintValue

MalformedConstraintValueError ConstraintValue is malformed

func (MalformedConstraintValueError) Error

Error ConstraintValue is malformed

type NoDefError

type NoDefError string

NoDefError No object definition found

func (NoDefError) Error

func (err NoDefError) Error() string

Error No object definition found

type ObjectDef

type ObjectDef struct {
	// DataDef type of data and path to data carrier
	DataDef DataDef `json:"datadef,omitempty"`
	// Data Get data definitions
	Data []Data `json:"data,omitempty"`
	// Select definitions for selecting in object
	Select *Select `json:"select,omitempty"`
}

ObjectDef object definitions

func GetObjectDef

func GetObjectDef(object string) (*ObjectDef, error)

GetObjectDef get definitions for object type (using default config)

func (*ObjectDef) Evaluate

func (def *ObjectDef) Evaluate(data json.RawMessage) ([]GetDataRequests, error)

Evaluate which constraint section applies

func (*ObjectDef) Validate

func (def *ObjectDef) Validate() error

Validate object definition

type ObjectDefs

type ObjectDefs map[string]*ObjectDef

ObjectDefs contains how to find and select data within sense objects

func OverrideFromFile

func OverrideFromFile(cfgFile string) (ObjectDefs, error)

OverrideFromFile read config from file (using default config)

func (ObjectDefs) GetObjectDef

func (defs ObjectDefs) GetObjectDef(object string) (*ObjectDef, error)

GetObjectDef get definitions for object type

func (ObjectDefs) OverrideFromFile

func (defs ObjectDefs) OverrideFromFile(cfgFile string) error

FromFile read config from file

type Select

type Select struct {
	// Type of select function
	Type SelectType `json:"type"`
	// Path to use for selection
	Path string `json:"path,omitempty"`
}

Select definitions for selecting in object

type SelectType

type SelectType int

SelectType select function type

const (
	// SelectTypeUnknown unknown select func (default int)
	SelectTypeUnknown SelectType = iota
	// SelectTypeListObjectValues use SelectListObjectValues method
	SelectTypeListObjectValues
	// SelectTypeHypercubeValues use SelectHyperCubeValues method
	SelectTypeHypercubeValues
	// SelectTypeHypercubeColumnValues each dimension is a data page
	SelectTypeHypercubeColumnValues
)

When adding SelectType, also: * add entry in selectTypeEnum

func (SelectType) MarshalJSON

func (t SelectType) MarshalJSON() ([]byte, error)

MarshalJSON marshal SelectType

func (SelectType) String

func (t SelectType) String() string

String representation of select type

func (*SelectType) UnmarshalJSON

func (t *SelectType) UnmarshalJSON(arg []byte) error

UnmarshalJSON unmarshal SelectType

Jump to

Keyboard shortcuts

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