Documentation ¶
Index ¶
- func InitMQTTClient(clientid string, deliveries *chan string, dataRateDisplayInterval int)
- func InitMQTTStatsClient(clientid string, mqttStoredMessages *string)
- func MQTTCommander(clientid string, command string)
- func NewConsumer(amqpConnDetails AMQPConnDetailsType, deliveries chan string)
- func NewProducer(amqpConnDetails AMQPConnDetailsType, deliveries *chan string)
- func NewRateCounter(window time.Duration, countChannel chan bool)
- func RunCommandListner(dataRateCmdGoChan chan<- int64, sensorCommandChannel chan<- string, ...)
- func RunForwarder(windowSizeCmdGoChan <-chan int64)
- func RunForwarderWithRateLimiter(dataRateCmdGoChan <-chan (int64))
- type AMQPConnDetailsType
- type SimpleStatsData
- type Stats
- type StatsChannelConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitMQTTClient ¶
InitMQTTClient Initiates the MQTT client and connects to the broker
func InitMQTTStatsClient ¶
InitMQTTStatsClient Initiates the MQTT client and connects to the broker
func MQTTCommander ¶
MQTTCommander Initiates the MQTT client and connects to the broker
func NewConsumer ¶
func NewConsumer(amqpConnDetails AMQPConnDetailsType, deliveries chan string)
NewConsumer creates a consumer and returns the delivery channel
func NewProducer ¶
func NewProducer(amqpConnDetails AMQPConnDetailsType, deliveries *chan string)
NewProducer creates a producer
func NewRateCounter ¶
NewRateCounter initiates a new counter
func RunCommandListner ¶
func RunCommandListner(dataRateCmdGoChan chan<- int64, sensorCommandChannel chan<- string, statsCmdGoChan chan<- string)
RunCommandListner listens remote commands
func RunForwarder ¶
func RunForwarder(windowSizeCmdGoChan <-chan int64)
RunForwarder runs all the configured forwarders
func RunForwarderWithRateLimiter ¶
func RunForwarderWithRateLimiter(dataRateCmdGoChan <-chan (int64))
RunForwarderWithRateLimiter runs the MQTT Client and Forwards the data to AMQP broker in cloud using. This also applies rate limiter
Types ¶
type AMQPConnDetailsType ¶
type AMQPConnDetailsType struct {
// contains filtered or unexported fields
}
AMQPConnDetailsType is the structure definition for holding connection information
type SimpleStatsData ¶
SimpleStatsData stores basic stats infomation (CPU and memory)
type Stats ¶
type Stats struct { // stats this process ProcUptime float64 //seconds ProcMemUsedPct float64 ProcCPUAvg systemstat.ProcCPUAverage LastProcCPUSample systemstat.ProcCPUSample `json:"-"` CurProcCPUSample systemstat.ProcCPUSample `json:"-"` // stats for whole system LastCPUSample systemstat.CPUSample `json:"-"` CurCPUSample systemstat.CPUSample `json:"-"` SysCPUAvg systemstat.CPUAverage SysMemK systemstat.MemSample LoadAverage systemstat.LoadAvgSample SysUptime systemstat.UptimeSample // contains filtered or unexported fields }
Stats struct stores the stats
type StatsChannelConfig ¶
type StatsChannelConfig struct {
// contains filtered or unexported fields
}
StatsChannelConfig structure keeps the channel configuration