new sessions struct

This commit is contained in:
cyber-dream 2022-11-04 02:21:44 +03:00
parent d645cbc860
commit 672d491e60
2 changed files with 25 additions and 19 deletions

View File

@ -13,6 +13,10 @@ type Session struct {
Expires time.Time
}
type Sessions struct {
Sessions []Session
}
type JSSessionInterface struct {
GameID string `json:"gameId"`
Icon string `json:"icon"`

View File

@ -11,24 +11,26 @@ func ConvertServerSessionsToJSON(s Session) []byte {
return s_json
}
var FakeSessions = []Session{
{
GameId: "garrysmod",
Title: "Test 1",
Status: "Super fake session",
Expires: time.Time{},
},
{
GameId: "beamng",
Title: "Test 2",
Status: "Super fake session 2",
Expires: time.Time{},
},
{
GameId: "minecraft",
Title: "Test 3",
Status: "Testing session",
Version: "1.54.7",
Expires: time.Time{},
var FakeSessions = Sessions{
Sessions: []Session{
{
GameId: "garrysmod",
Title: "Test 1",
Status: "Super fake session",
Expires: time.Time{},
},
{
GameId: "beamng",
Title: "Test 2",
Status: "Super fake session 2",
Expires: time.Time{},
},
{
GameId: "minecraft",
Title: "Test 3",
Status: "Testing session",
Version: "1.54.7",
Expires: time.Time{},
},
},
}