2019-01-31 00:02:38 +00:00
|
|
|
package data
|
|
|
|
|
2019-03-14 03:01:44 +00:00
|
|
|
import ui "github.com/gizak/termui/v3"
|
2019-03-13 03:15:55 +00:00
|
|
|
|
2019-03-08 04:04:46 +00:00
|
|
|
type Consumer struct {
|
2019-03-16 23:59:28 +00:00
|
|
|
SampleChannel chan *Sample
|
|
|
|
AlertChannel chan *Alert
|
|
|
|
CommandChannel chan *Command
|
2019-02-03 03:30:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Sample struct {
|
|
|
|
Label string
|
|
|
|
Value string
|
2019-03-13 03:15:55 +00:00
|
|
|
Color *ui.Color
|
2019-03-08 04:04:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Alert struct {
|
2019-03-10 04:41:23 +00:00
|
|
|
Title string
|
|
|
|
Text string
|
2019-03-13 03:15:55 +00:00
|
|
|
Color *ui.Color
|
2019-03-08 04:04:46 +00:00
|
|
|
}
|
|
|
|
|
2019-03-16 04:35:00 +00:00
|
|
|
type Command struct {
|
|
|
|
Type string
|
|
|
|
Value interface{}
|
|
|
|
}
|
|
|
|
|
2019-03-16 23:59:28 +00:00
|
|
|
func NewConsumer() *Consumer {
|
|
|
|
return &Consumer{
|
|
|
|
SampleChannel: make(chan *Sample),
|
|
|
|
AlertChannel: make(chan *Alert),
|
|
|
|
CommandChannel: make(chan *Command),
|
2019-03-08 04:04:46 +00:00
|
|
|
}
|
2019-01-31 00:02:38 +00:00
|
|
|
}
|