streams.go 491 B

123456789101112131415161718192021222324252627
  1. package models
  2. import "gopkg.in/guregu/null.v3"
  3. type TimePoint [2]null.Float
  4. type TimeSeriesPoints []TimePoint
  5. type StreamPacket struct {
  6. Stream string `json:"stream"`
  7. Series []StreamSeries `json:"series"`
  8. }
  9. type StreamSeries struct {
  10. Name string `json:"name"`
  11. Points TimeSeriesPoints `json:"points"`
  12. }
  13. type StreamInfo struct {
  14. Name string
  15. }
  16. type StreamList []*StreamInfo
  17. type StreamManager interface {
  18. GetStreamList() StreamList
  19. Push(data *StreamPacket)
  20. }