emqx-agent.go 565 B

12345678910111213141516171819202122232425262728
  1. package main
  2. import "sparrow/pkg/protocol"
  3. type Agent struct {
  4. }
  5. // Message 收到设备上报消息处理
  6. func (a *Agent) Message(topic string, payload []byte) error {
  7. //TODO implement me
  8. panic("implement me")
  9. }
  10. // Connected 设备接入时
  11. func (a *Agent) Connected(status *protocol.DevConnectStatus) error {
  12. //TODO implement me
  13. panic("implement me")
  14. }
  15. // Disconnected 设备断开连接时
  16. func (a *Agent) Disconnected(status *protocol.DevConnectStatus) error {
  17. //TODO implement me
  18. panic("implement me")
  19. }
  20. func NewAgent() *Agent {
  21. return &Agent{}
  22. }