Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateSensorRequest ¶
type CreateSensorRequest struct { Id string `json:"id"` Name string `json:"name"` DataType DataType `json:"data_type"` Unit string `json:"unit"` Type SensorType `json:"type"` PollingInterval int `json:"polling_interval"` PollingEndpoint string `json:"polling_endpoint"` PollingStrategy PollingStrategy `json:"polling_strategy"` RetainmentPeriodSeconds int `json:"retainment_period_seconds"` }
type PollingStrategy ¶
type PollingStrategy string
const (
PollingStrategyPing PollingStrategy = "ping"
)
type Sensor ¶
type Sensor struct { ID string `json:"id" gorm:"primaryKey"` DeviceID string `json:"device_id" gorm:"primaryKey"` Name string `json:"name"` DataType DataType `json:"data_type"` Unit string `json:"unit"` IsActive bool `json:"is_active"` Type SensorType `json:"type"` PollingInterval int `json:"polling_interval"` PollingEndpoint string `json:"polling_endpoint"` PollingStrategy PollingStrategy `json:"polling_strategy"` RetainmentPeriodSeconds int `json:"retainment_period_seconds"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type SensorType ¶
type SensorType string
const ( SensorTypeExternal SensorType = "external" SensorTypePolling SensorType = "polling" )
type SensorsController ¶
type SensorsController struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(database SensorsDatabase) *SensorsController
func (*SensorsController) DeleteSensor ¶
func (c *SensorsController) DeleteSensor(context *gin.Context)
func (*SensorsController) GetSensor ¶
func (c *SensorsController) GetSensor(context *gin.Context)
func (*SensorsController) GetSensors ¶
func (c *SensorsController) GetSensors(context *gin.Context)
func (*SensorsController) PostSensor ¶
func (c *SensorsController) PostSensor(context *gin.Context)
type SensorsDatabase ¶
Click to show internal directories.
Click to hide internal directories.