Documentation ¶
Index ¶
- Constants
- func NewDataCollector(brokerList []string, certFile *string, keyFile *string, caFile *string, ...) sarama.SyncProducer
- func NewDeadLetterProducer(brokerList []string, certFile *string, keyFile *string, caFile *string, ...) sarama.AsyncProducer
- func ValidationError(errs validator.ValidationErrors) string
- type SensorData
- type Server
Constants ¶
View Source
const (
TemperatureSource = "temperature"
)
Variables ¶
This section is empty.
Functions ¶
func NewDataCollector ¶
func NewDeadLetterProducer ¶
func ValidationError ¶
func ValidationError(errs validator.ValidationErrors) string
Types ¶
type SensorData ¶
type SensorData struct { Id string `json:"id" validate:"required"` Value float64 `json:"value" validate:"required,gte=-30,lte=100"` SourceType string `json:"source_type" validate:"required"` }
SensorData stores sensor readings for different source types eg. temperature, light etc.
type Server ¶
type Server struct { DataCollector sarama.SyncProducer DeadLetter sarama.AsyncProducer }
Click to show internal directories.
Click to hide internal directories.