summaryrefslogtreecommitdiff
path: root/src/hub/src/spreadspace.org/sfive/s5types.go
blob: 56b1552abb92aa57690995bb101c42e70a64b7fe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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
}