utils

package
v0.0.0-...-501356c Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DoneChan chan bool
View Source
var Loop bool = true
View Source
var LoopModbus bool = true
View Source
var MqttAddress string = "localhost"

Informações do MQTT Broker Local

View Source
var MqttClient mqtt.Client
View Source
var MqttPassword string = ""
View Source
var MqttPort string = "1883"
View Source
var MqttUser string = ""
View Source
var Status bool = true
View Source
var StopChan chan bool // Canal de sinalização para encerrar as goroutines
View Source
var Wg sync.WaitGroup // WaitGroup para aguardar a conclusão das goroutines
View Source
var WgGoroutines sync.WaitGroup

Functions

This section is empty.

Types

type Address

type Address struct {
	Address string `json:"address"`
	Port    string `json:"port"`
	Name    string `json:"name"`
	Others  string `json:"others"`
}

type ConfigMQTT

type ConfigMQTT struct {
	Server   string `json:"server"`
	Port     string `json:"port"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type Data

type Data struct {
	BitMemories  map[string]interface{} `json:"bitMemories"`
	WordMemories map[string]interface{} `json:"wordMemories"`
}

type DevSettings

type DevSettings struct {
	Address     string                   `json:"address"`
	Port        string                   `json:"port"`
	Name        string                   `json:"name"`
	Protocol    string                   `json:"protocol"`
	ReadingTime int                      `json:"readingTime"`
	Topics      []string                 `json:"topics"`
	Data        []map[string]interface{} `json:"data"`
}

type Devices

type Devices struct {
	Devices []DevSettings `json:"devices"`
}

type ExitPayloadMsg

type ExitPayloadMsg struct {
	Address       string
	Port          string
	Name          string
	Others        string
	Protocol      string
	ReadTimeStamp string
	Topics        []string
	BitMemories   map[string]interface{}
	WordMemories  map[string]interface{}
}

type InputMQTTMsg

type InputMQTTMsg struct {
	Action string `json:"action"`
}

Formato da mensagem de entrada esperado pelo CallBack TODO: Deixar informação em repositório externo

type MqttMsgStruct

type MqttMsgStruct struct {
	Address       Address `json:"address"`
	ReadTimeStamp string  `json:"readTimeStamp"`
	Protocol      string  `json:"protocol"`
	Data          Data    `json:"data"`
}

type RoutineController

type RoutineController struct {
	StopChan chan struct{} // Canal de sinalização para encerrar as goroutines
	DoneChan chan struct{}
	Wg       sync.WaitGroup // WaitGroup para aguardar a conclusão das goroutines
}

func (*RoutineController) Stop

func (c *RoutineController) Stop()

Função para encerrar as goroutines existentes

Jump to

Keyboard shortcuts

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