summaryrefslogtreecommitdiff
path: root/src/hub/src/spreadspace.org/sfive/s5types.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/hub/src/spreadspace.org/sfive/s5types.go')
-rw-r--r--src/hub/src/spreadspace.org/sfive/s5types.go38
1 files changed, 22 insertions, 16 deletions
diff --git a/src/hub/src/spreadspace.org/sfive/s5types.go b/src/hub/src/spreadspace.org/sfive/s5types.go
index 56b1552..3b7dc31 100644
--- a/src/hub/src/spreadspace.org/sfive/s5types.go
+++ b/src/hub/src/spreadspace.org/sfive/s5types.go
@@ -9,34 +9,34 @@ const (
)
type StreamId struct {
- ContentId string `json:"content-id"`
- Format string `json:"format"`
- Quality string `json:"quality"`
+ ContentId string `json:"content-id"`
+ Format string `json:"format"`
+ Quality string `json:"quality"`
}
type SourceId struct {
- Hostname string `json:"hostname"`
- StreamId StreamId `json:"stream-id"`
- Tags []string `json:"tags"`
+ Hostname string `json:"hostname"`
+ StreamId StreamId `json:"streamer-id"`
+ Tags []string `json:"tags"`
}
type ClientData struct {
- Ip string
- BytesTransferred uint
- UserAgent string
+ Ip string `json:"ip"`
+ BytesTransferred uint `json:"bytes-transferred"`
+ UserAgent string `json:"user-agent"`
}
type SourceData struct {
- ClientCount uint
- BytesReceived uint
- BytesSent uint
- Clients []ClientData
+ ClientCount uint `json:"client-count"`
+ BytesReceived uint `json:"bytes-received"`
+ BytesSent uint `json:"bytes-sent"`
+ Clients []ClientData `json:"clients"`
}
type DataUpdate struct {
- StartTime time.Time
- Duration time.Duration
- Data SourceData
+ StartTime time.Time `json:"start-time"`
+ Duration time.Duration `json:"duration-ms"`
+ Data SourceData `json:"data"`
}
type StatisticsData struct {
@@ -49,3 +49,9 @@ func (self *StatisticsData) CopyFrom(id *SourceId) {
self.StreamId = id.StreamId
self.Tags = id.Tags
}
+
+func (self *StatisticsData) CopyFromUpdate(id *DataUpdate) {
+ self.StartTime = id.StartTime
+ self.Duration = id.Duration
+ self.Data = id.Data
+}