Documentation
¶
Index ¶
- type Command
- type CommandAck
- type CommandParameters
- type CommandRequest
- type CommandStatus
- type Device
- type DeviceType
- type DeviceTypeKnxProtocol
- type DeviceTypeModbusProtocol
- type DeviceTypeModbusRegister
- type Event
- type LocationPointSchema
- type Measure
- type Node
- type NodeProtocol
- type Platform
- type Project
- func (p Project) CreateEvent(event Event) error
- func (p Project) GetDevice(uuid string) (Device, error)
- func (p Project) GetDeviceType(uuid string) (DeviceType, error)
- func (p Project) GetDeviceTypes() ([]DeviceType, error)
- func (p Project) GetDevices() ([]Device, error)
- func (p Project) GetNode(uuid string) (Node, error)
- func (p Project) GetNodes() ([]Node, error)
- func (p Project) GetRule(uuid string) (Rule, error)
- func (p Project) GetRules() ([]Rule, error)
- type Response
- type ResponseError
- type ResponseErrorDetail
- type Rule
- type RuleAction
- type RuleCondition
- type RuleTrigger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶ added in v1.8.8
type Command struct {
CommandRequest
Uuid string `json:"uuid"`
Status CommandStatus `json:"status"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
ReceivedAt *time.Time `json:"receivedAt,omitempty"`
CompletedAt *time.Time `json:"completedAt,omitempty"`
FailedAt *time.Time `json:"failedAt,omitempty"`
}
type CommandAck ¶ added in v1.12.0
type CommandAck struct {
Uuid string `json:"uuid"`
Status CommandStatus `json:"status"`
Extras map[string]any `json:"-"`
}
func (CommandAck) MarshalJSON ¶ added in v1.12.0
func (c CommandAck) MarshalJSON() ([]byte, error)
func (*CommandAck) UnmarshalJSON ¶ added in v1.12.0
func (c *CommandAck) UnmarshalJSON(data []byte) error
type CommandParameters ¶ added in v1.8.9
func (CommandParameters) MarshalJSON ¶ added in v1.8.10
func (c CommandParameters) MarshalJSON() ([]byte, error)
func (*CommandParameters) UnmarshalJSON ¶ added in v1.8.9
func (c *CommandParameters) UnmarshalJSON(data []byte) error
type CommandRequest ¶ added in v1.8.10
type CommandStatus ¶ added in v1.12.0
type CommandStatus string
const ( Pending CommandStatus = "pending" Received CommandStatus = "received" Completed CommandStatus = "completed" Failed CommandStatus = "failed" )
type Device ¶
type Device struct {
Uuid string `json:"uuid,omitempty"`
ProjectID string `json:"projectId"`
DeviceTypeID string `json:"deviceTypeId,omitempty"`
NodeID string `json:"nodeId,omitempty"`
Encoder string `json:"encoder,omitempty"`
Decoder string `json:"decoder,omitempty"`
FirmwareVersion string `json:"firmwareVersion,omitempty"`
PlantID string `json:"plantId,omitempty"`
Location *LocationPointSchema `json:"location,omitempty"`
SerialNumber string `json:"serialNumber,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
DeviceType *DeviceType `json:"deviceType,omitempty"`
Metadata map[string]any `json:"metadata"`
State any `json:"state"`
StateUpdatedAt any `json:"stateUpdatedAt"`
LastActivityAt string `json:"lastActivityAt"`
LastCommunicationAt string `json:"lastCommunicationAt"`
ConnectivityStatus string `json:"connectivityStatus"`
LastConnectionAt string `json:"lastConnectionAt"`
LastDisconnectionAt string `json:"lastDisconnectionAt"`
Tags []string `json:"tags"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// contains filtered or unexported fields
}
type DeviceType ¶
type DeviceType struct {
Uuid string `json:"uuid,omitempty"`
ProjectID string `json:"projectId"`
Visibility string `json:"visibility,omitempty"`
Encoder string `json:"encoder,omitempty"`
Decoder string `json:"decoder,omitempty"`
FirmwareID string `json:"firmwareId,omitempty"`
FirmwareVersions []string `json:"firmwareVersions"`
Model string `json:"model,omitempty"`
Manufacturer string `json:"manufacturer,omitempty"`
Category string `json:"category,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Protocols *struct {
Modbus *DeviceTypeModbusProtocol `json:"modbus,omitempty"`
Knx *DeviceTypeKnxProtocol `json:"knx,omitempty"`
} `json:"protocols,omitempty"`
Metadata map[string]any `json:"metadata"`
Commands any `json:"commands"`
Events any `json:"events"`
Properties any `json:"properties"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// contains filtered or unexported fields
}
type DeviceTypeKnxProtocol ¶ added in v1.8.2
type DeviceTypeModbusProtocol ¶ added in v1.8.2
type DeviceTypeModbusProtocol struct {
Endianness string `json:"endianness"`
Registers []DeviceTypeModbusRegister `json:"registers"`
}
type DeviceTypeModbusRegister ¶ added in v1.8.2
type DeviceTypeModbusRegister struct {
Register uint16 `json:"register"`
Read bool `json:"read"`
ModbusFunctionRead int `json:"modbusFunctionRead"`
Write bool `json:"write"`
ModbusFunctionWrite int `json:"modbusFunctionWrite,omitempty"`
Words byte `json:"words"`
BitwiseReading bool `json:"bitwiseReading"`
Properties []struct {
Index int `json:"index"`
Name string `json:"name"`
} `json:"properties"`
ScaleFactor *float64 `json:"scaleFactor,omitempty"`
Type string `json:"type"`
}
type Event ¶
type Event struct {
Uuid string `json:"uuid,omitempty"`
ProjectID string `json:"projectId"`
Description string `json:"description,omitempty"`
Type string `json:"type"`
EventTime time.Time `json:"eventTime,omitempty"`
Source string `json:"source"`
Metadata map[string]any `json:"metadata,omitempty"`
Data any `json:"data,omitempty"`
}
type LocationPointSchema ¶
type Node ¶ added in v1.1.0
type Node struct {
Uuid string `json:"uuid,omitempty"`
ProjectID string `json:"projectId"`
PlantID string `json:"plantId,omitempty"`
Name string `json:"name"`
Model string `json:"model,omitempty"`
NodeTypeID string `json:"nodeTypeId,omitempty"`
SerialNumber string `json:"serialNumber,omitempty"`
Location *LocationPointSchema `json:"location,omitempty"`
Protocols []NodeProtocol `json:"protocols,omitempty"`
Metadata map[string]any `json:"metadata"`
ConnectivityStatus string `json:"connectivityStatus"`
LastConnectionAt string `json:"lastConnectionAt"`
LastCommunicationAt string `json:"lastCommunicationAt"`
LastDisconnectionAt string `json:"lastDisconnectionAt"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags"`
Rules []string `json:"rules,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// contains filtered or unexported fields
}
type NodeProtocol ¶ added in v1.6.1
type Platform ¶
type Platform struct {
// contains filtered or unexported fields
}
func (Platform) GetProjects ¶
func (*Platform) SetSkipVerify ¶ added in v1.10.0
type Project ¶
type Project struct {
Uuid string `json:"uuid"`
ProjectId string `json:"projectId"`
Name string `json:"name"`
Metadata map[string]any `json:"metadata,omitempty"`
Configuration any `json:"configuration,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// contains filtered or unexported fields
}
func (Project) CreateEvent ¶
func (Project) GetDeviceType ¶ added in v1.2.0
func (p Project) GetDeviceType(uuid string) (DeviceType, error)
func (Project) GetDeviceTypes ¶ added in v1.2.0
func (p Project) GetDeviceTypes() ([]DeviceType, error)
func (Project) GetDevices ¶
type ResponseError ¶
type ResponseError struct {
Status bool `json:"status,omitempty"`
Error ResponseErrorDetail `json:"error,omitempty"`
}
type ResponseErrorDetail ¶
type Rule ¶ added in v1.8.6
type Rule struct {
Uuid string `json:"uuid"`
ProjectId string `json:"projectId"`
Name string `json:"name"`
Description *string `json:"description,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
Tags []string `json:"tags,omitempty"`
Status string `json:"status"`
AllowConcurrent bool `json:"allowConcurrent"`
Mode string `json:"mode"`
Triggers []RuleTrigger `json:"triggers"`
Actions []RuleAction `json:"actions"`
ElseActions []RuleAction `json:"elseActions"`
Condition *RuleCondition `json:"condition,omitempty"`
// contains filtered or unexported fields
}
type RuleAction ¶ added in v1.8.6
type RuleAction struct {
Type string `json:"type"`
// Type wasm
Label *string `json:"label,omitempty"`
Language *string `json:"language,omitempty"`
Source *string `json:"source,omitempty"`
Binary *string `json:"binary,omitempty"`
Hash *string `json:"hash,omitempty"`
// Type log
Value *string `json:"value,omitempty"`
// Type webhook
Uri *string `json:"uri,omitempty"`
Payload *string `json:"payload,omitempty"`
// Type command
Command map[string]any `json:"command,omitempty"`
DeviceId *string `json:"deviceId,omitempty"`
// Type delay
Time *int64 `json:"time,omitempty"`
}
type RuleCondition ¶ added in v1.8.6
Click to show internal directories.
Click to hide internal directories.