-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdata.go
More file actions
138 lines (113 loc) · 2.26 KB
/
Copy pathdata.go
File metadata and controls
138 lines (113 loc) · 2.26 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
package mitch
import (
"sync"
"time"
)
type Store struct {
Users map[int64]*User
APIKeys map[int64]*APIKey
Games map[int64]*Game
Uploads map[int64]*Upload
Builds map[int64]*Build
BuildFiles map[int64]*BuildFile
GameAdmins map[int64]*GameAdmin
UserGameSessions map[int64]*UserGameSession
CDNFiles map[string]*CDNFile
idSeed int64
writeMutex sync.Mutex
}
func newStore() *Store {
return &Store{
Users: make(map[int64]*User),
APIKeys: make(map[int64]*APIKey),
Games: make(map[int64]*Game),
Uploads: make(map[int64]*Upload),
Builds: make(map[int64]*Build),
BuildFiles: make(map[int64]*BuildFile),
GameAdmins: make(map[int64]*GameAdmin),
UserGameSessions: make(map[int64]*UserGameSession),
CDNFiles: make(map[string]*CDNFile),
idSeed: 10,
}
}
type User struct {
Store *Store
ID int64
Username string
DisplayName string
Gamer bool
Developer bool
PressUser bool
AllowTelemetry bool
}
type APIKey struct {
Store *Store
ID int64
UserID int64
Key string
CreatedAt time.Time
UpdatedAt time.Time
}
type Game struct {
Store *Store
Type string
Classification string
ID int64
UserID int64
Title string
MinPrice int64
Published bool
}
type Upload struct {
Store *Store
ID int64
GameID int64
Filename string
URL string
Size int64
ChannelName string
Storage string
Head int64
Type string
PlatformWindows bool
PlatformLinux bool
PlatformMac bool
}
type Build struct {
Store *Store
ID int64
ParentBuildID int64
UploadID int64
Version int
}
type BuildFile struct {
Store *Store
ID int64
BuildID int64
Type string
SubType string
Status string
Filename string
Size int64
}
type GameAdmin struct {
Store *Store
ID int64
GameID int64
UserID int64
}
type CDNFile struct {
Path string
Filename string
Size int64
Contents []byte
}
type UserGameSession struct {
Store *Store
ID int64
GameID int64
UserID int64
Crashed bool
SecondsRun int64
LastRunAt time.Time
}