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.go51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/hub/src/spreadspace.org/sfive/s5types.go b/src/hub/src/spreadspace.org/sfive/s5types.go
new file mode 100644
index 0000000..56b1552
--- /dev/null
+++ b/src/hub/src/spreadspace.org/sfive/s5types.go
@@ -0,0 +1,51 @@
+package sfive
+
+import "time"
+
+const (
+ QualityLow = "low"
+ QualityMedium = "medium"
+ QualityHigh = "high"
+)
+
+type StreamId struct {
+ 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"`
+}
+
+type ClientData struct {
+ Ip string
+ BytesTransferred uint
+ UserAgent string
+}
+
+type SourceData struct {
+ ClientCount uint
+ BytesReceived uint
+ BytesSent uint
+ Clients []ClientData
+}
+
+type DataUpdate struct {
+ StartTime time.Time
+ Duration time.Duration
+ Data SourceData
+}
+
+type StatisticsData struct {
+ SourceId
+ DataUpdate
+}
+
+func (self *StatisticsData) CopyFrom(id *SourceId) {
+ self.Hostname = id.Hostname
+ self.StreamId = id.StreamId
+ self.Tags = id.Tags
+}