129 lines
2.7 KiB
Go
129 lines
2.7 KiB
Go
package domain
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
type SkirdaSession interface {
|
|
GetSessionId() string
|
|
GetGameId() string
|
|
GetUIAssets() SessionUIAssets
|
|
GetGameType() string
|
|
GetSessionData() string
|
|
}
|
|
|
|
// type SkirdaSession struct {
|
|
// SkirdaSessionId string
|
|
// SkirdaGameId string
|
|
// Assets SessionUIAssets
|
|
// }
|
|
|
|
type SkirdaSessions []SkirdaSession
|
|
|
|
// GetGameId implements SkirdaSession
|
|
func (SkirdaSessions) GetGameId() string {
|
|
panic("unimplemented")
|
|
}
|
|
|
|
// GetGameType implements SkirdaSession
|
|
func (SkirdaSessions) GetGameType() string {
|
|
panic("unimplemented")
|
|
}
|
|
|
|
// GetSessionData implements SkirdaSession
|
|
func (SkirdaSessions) GetSessionData() string {
|
|
panic("unimplemented")
|
|
}
|
|
|
|
// GetSessionId implements SkirdaSession
|
|
func (SkirdaSessions) GetSessionId() string {
|
|
panic("unimplemented")
|
|
}
|
|
|
|
// GetUIAssets implements SkirdaSession
|
|
func (SkirdaSessions) GetUIAssets() SessionUIAssets {
|
|
panic("unimplemented")
|
|
}
|
|
|
|
type SessionUIAssets struct {
|
|
// GameID string `json:"gameId"`
|
|
Title string `json:"title"`
|
|
Icon string `json:"icon"`
|
|
Description string `json:"description"`
|
|
}
|
|
|
|
func (sessions SkirdaSessions) FindSessionById(sessionId string) (SkirdaSession, error) {
|
|
for _, session := range sessions {
|
|
if session.GetSessionId() == sessionId {
|
|
return session, nil
|
|
}
|
|
}
|
|
return nil, errors.New("no any sessions founded")
|
|
}
|
|
|
|
func (sessions SkirdaSessions) AddSessions(newSessions []SkirdaSession) {
|
|
sessions = append(sessions, newSessions...)
|
|
}
|
|
|
|
type MinecraftSession struct {
|
|
SkirdaSessionId string
|
|
SkirdaGameId string
|
|
Assets SessionUIAssets
|
|
Version string
|
|
}
|
|
|
|
func (session MinecraftSession) GetSessionId() string {
|
|
return session.SkirdaSessionId
|
|
}
|
|
|
|
func (session MinecraftSession) GetUIAssets() SessionUIAssets {
|
|
return session.Assets
|
|
}
|
|
|
|
func (session MinecraftSession) GetGameId() string {
|
|
return session.SkirdaGameId
|
|
}
|
|
|
|
func (session MinecraftSession) GetMinecraftVersion() string {
|
|
return session.SkirdaGameId
|
|
}
|
|
|
|
func (session MinecraftSession) GetGameType() string {
|
|
return "minecraft"
|
|
}
|
|
|
|
func (session MinecraftSession) GetSessionData() string {
|
|
return session.Version
|
|
}
|
|
|
|
type SteamSession struct {
|
|
SkirdaSessionId string
|
|
SkirdaGameId string
|
|
Assets SessionUIAssets
|
|
// Data SteamSessionData
|
|
}
|
|
|
|
type SteamSessionData struct {
|
|
kke string
|
|
}
|
|
|
|
func (session SteamSession) GetSessionId() string {
|
|
return session.SkirdaSessionId
|
|
}
|
|
|
|
func (session SteamSession) GetUIAssets() SessionUIAssets {
|
|
return session.Assets
|
|
}
|
|
|
|
func (session SteamSession) GetGameId() string {
|
|
return session.SkirdaGameId
|
|
}
|
|
|
|
func (session SteamSession) GetGameType() string {
|
|
return "steam"
|
|
}
|
|
|
|
func (session SteamSession) GetSessionData() string {
|
|
return ""
|
|
}
|