sampler-fork/data/consumer.go

35 lines
531 B
Go
Raw Normal View History

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 {
Title string
Text string
2019-03-13 03:15:55 +00:00
Color *ui.Color
2019-03-08 04:04:46 +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
}