views

package
v0.0.0-...-d2cf98a Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DeviceLayoutResponseMap is a map of attribute names in result type
	// DeviceLayoutResponse indexed by view name.
	DeviceLayoutResponseMap = map[string][]string{
		"default": []string{
			"configurations",
			"sensors",
		},
	}
)

Functions

func ValidateDeviceLayoutResponse

func ValidateDeviceLayoutResponse(result *DeviceLayoutResponse) (err error)

ValidateDeviceLayoutResponse runs the validations defined on the viewed result type DeviceLayoutResponse.

func ValidateDeviceLayoutResponseView

func ValidateDeviceLayoutResponseView(result *DeviceLayoutResponseView) (err error)

ValidateDeviceLayoutResponseView runs the validations defined on DeviceLayoutResponseView using the "default" view.

func ValidateSensorRangeView

func ValidateSensorRangeView(result *SensorRangeView) (err error)

ValidateSensorRangeView runs the validations defined on SensorRangeView.

func ValidateSensorReadingView

func ValidateSensorReadingView(result *SensorReadingView) (err error)

ValidateSensorReadingView runs the validations defined on SensorReadingView.

func ValidateStationConfigurationView

func ValidateStationConfigurationView(result *StationConfigurationView) (err error)

ValidateStationConfigurationView runs the validations defined on StationConfigurationView.

func ValidateStationModuleView

func ValidateStationModuleView(result *StationModuleView) (err error)

ValidateStationModuleView runs the validations defined on StationModuleView.

func ValidateStationSensorView

func ValidateStationSensorView(result *StationSensorView) (err error)

ValidateStationSensorView runs the validations defined on StationSensorView.

Types

type DeviceLayoutResponse

type DeviceLayoutResponse struct {
	// Type to project
	Projected *DeviceLayoutResponseView
	// View to render
	View string
}

DeviceLayoutResponse is the viewed result type that is projected based on a view.

type DeviceLayoutResponseView

type DeviceLayoutResponseView struct {
	Configurations []*StationConfigurationView
	Sensors        map[string][]*StationSensorView
}

DeviceLayoutResponseView is a type that runs validations on a projected type.

type SensorRangeView

type SensorRangeView struct {
	Minimum *float32
	Maximum *float32
}

SensorRangeView is a type that runs validations on a projected type.

type SensorReadingView

type SensorReadingView struct {
	Last *float32
	Time *int64
}

SensorReadingView is a type that runs validations on a projected type.

type StationConfigurationView

type StationConfigurationView struct {
	ID           *int64
	Time         *int64
	ProvisionID  *int64
	MetaRecordID *int64
	SourceID     *int32
	Modules      []*StationModuleView
}

StationConfigurationView is a type that runs validations on a projected type.

type StationModuleView

type StationModuleView struct {
	ID               *int64
	HardwareID       *string
	HardwareIDBase64 *string
	MetaRecordID     *int64
	Name             *string
	Label            *string
	Position         *int32
	Flags            *int32
	Internal         *bool
	FullKey          *string
	Sensors          []*StationSensorView
	Meta             map[string]interface{}
}

StationModuleView is a type that runs validations on a projected type.

type StationSensorView

type StationSensorView struct {
	Name          *string
	UnitOfMeasure *string
	Reading       *SensorReadingView
	Key           *string
	FullKey       *string
	Ranges        []*SensorRangeView
	Meta          map[string]interface{}
}

StationSensorView is a type that runs validations on a projected type.

Jump to

Keyboard shortcuts

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