Documentation ¶
Index ¶
- Constants
- Variables
- type Devmgmt
- func (devmgmt Devmgmt) FetchDeviceState(ctx context.Context, device types.Device) (types.DeviceResponse, error)
- func (devmgmt Devmgmt) PublishWithResponse(ctx context.Context, body []byte, topic ResponseTopic, pkey ed25519.PublicKey) ([]byte, error)
- func (devmgmt Devmgmt) SendActionCommand(ctx context.Context, device types.Device, command string, ...) (types.DeviceResponse, error)
- type Options
- type ResponseTopic
Constants ¶
View Source
const (
// RequestIDSize is size of RequestID
RequestIDSize = 16
)
Variables ¶
View Source
var ErrDeviceTimeout = errors.New("device timeout")
ErrDeviceTimeout indicates that device had timeout
View Source
var ErrInvalidSignature = errors.New("invalid signature")
ErrInvalidSignature indicates that device sent back invalid signature of payload
Functions ¶
This section is empty.
Types ¶
type Devmgmt ¶
Devmgmt is some abstraction layer over paho mqtt
func (Devmgmt) FetchDeviceState ¶
func (devmgmt Devmgmt) FetchDeviceState(ctx context.Context, device types.Device) (types.DeviceResponse, error)
FetchDeviceState sends rqeuest to device with question about his device state
type Options ¶
type Options struct { // ClientID, required ClientID string // Default: "tcp://broker:1883" BrokerURL string // ServerPublicKey is servers public key // // *Required* ServerPublicKey ed25519.PublicKey // ServerPrivateKey is servers private key // // *Required* ServerPrivateKey ed25519.PrivateKey }
Options of the Devmgmt
type ResponseTopic ¶
ResponseTopic is type of topic which contains Request and Response
Click to show internal directories.
Click to hide internal directories.