Compare commits
3 Commits
ceb5cac7ea
...
6f3f3e1d8f
Author | SHA1 | Date | |
---|---|---|---|
6f3f3e1d8f | |||
073c0b8e90 | |||
802442edba |
@ -1,5 +1,9 @@
|
|||||||
package gameUtils
|
package gameUtils
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
)
|
||||||
|
|
||||||
func FindGameByID(id string, list Games) SteamGame {
|
func FindGameByID(id string, list Games) SteamGame {
|
||||||
for _, game := range list.SteamGames {
|
for _, game := range list.SteamGames {
|
||||||
if game.GameId == id {
|
if game.GameId == id {
|
||||||
@ -29,3 +33,9 @@ func GetJSGameInterface(game SteamGame) JSGameInterface {
|
|||||||
}
|
}
|
||||||
return newInterface
|
return newInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ConvertServerGamesToJSON(g Games) []byte {
|
||||||
|
g_json, err := json.Marshal(g)
|
||||||
|
_ = err //TODO: Check Errors
|
||||||
|
return g_json
|
||||||
|
}
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
package sessionUtils
|
|
||||||
|
|
||||||
func GetJSSessionInterface(s Session) JSSessionInterface {
|
|
||||||
return JSSessionInterface{}
|
|
||||||
}
|
|
@ -5,8 +5,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Session struct {
|
type Session struct {
|
||||||
expirateAt time.Time
|
ExpirateAt time.Time
|
||||||
gameId string
|
GameId string
|
||||||
}
|
}
|
||||||
|
|
||||||
type JSSessionInterface struct {
|
type JSSessionInterface struct {
|
||||||
|
13
sessionUtils/sessionUtils.go
Normal file
13
sessionUtils/sessionUtils.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package sessionUtils
|
||||||
|
|
||||||
|
import "encoding/json"
|
||||||
|
|
||||||
|
func ConvertServerSessionsToJSON(s Session) []byte {
|
||||||
|
s_json, err := json.Marshal(s)
|
||||||
|
_ = err //TODO: Check Errors
|
||||||
|
return s_json
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetJSSessionInterface(s Session) JSSessionInterface {
|
||||||
|
return JSSessionInterface{}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user