entities

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrThingForbidden represents the error when thing cannot be authenticated
	ErrThingForbidden = errors.New("forbidden to authenticate thing")

	// ErrThingNotFound represents the error when the schema has a invalid format
	ErrThingNotFound = errors.New("thing not found on thing's service")

	// ErrThingExists is returned when trying to register an existing thing
	ErrThingExists = errors.New("thing is already registered")
)

Functions

This section is empty.

Types

type Data

type Data struct {
	SensorID int         `json:"sensorId"`
	Value    interface{} `json:"value"`
}

Data represents the thing's data

type Schema

type Schema struct {
	SensorID  int    `json:"sensorId"`
	ValueType int    `json:"valueType" validate:"required"`
	Unit      int    `json:"unit"`
	TypeID    int    `json:"typeId" validate:"required"`
	Name      string `json:"name" validate:"required,max=30"`
}

Schema represents the thing's schema

type Thing

type Thing struct {
	ID     string   `json:"id"`
	Token  string   `json:"token,omitempty"`
	Name   string   `json:"name,omitempty"`
	Schema []Schema `json:"schema,omitempty"`
}

Thing represents the thing domain entity

Jump to

Keyboard shortcuts

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