@@ -12,13 +12,40 @@ import (
12
12
"github.com/leighmacdonald/steamid/v4/steamid"
13
13
)
14
14
15
+ type RequestServerUpdate struct {
16
+ ServerID int `json:"server_id"`
17
+ ServerName string `json:"server_name"`
18
+ ServerNameShort string `json:"server_name_short"`
19
+ Host string `json:"host"`
20
+ Port int `json:"port"`
21
+ ReservedSlots int `json:"reserved_slots"`
22
+ Password string `json:"password"`
23
+ RCON string `json:"rcon"`
24
+ Lat float64 `json:"lat"`
25
+ Lon float64 `json:"lon"`
26
+ CC string `json:"cc"`
27
+ DefaultMap string `json:"default_map"`
28
+ Region string `json:"region"`
29
+ IsEnabled bool `json:"is_enabled"`
30
+ EnableStats bool `json:"enable_stats"`
31
+ LogSecret int `json:"log_secret"`
32
+ }
33
+
34
+ type ServerInfoSafe struct {
35
+ ServerNameLong string `json:"server_name_long"`
36
+ ServerName string `json:"server_name"`
37
+ ServerID int `json:"server_id"`
38
+ Colour string `json:"colour"`
39
+ }
40
+
15
41
type ServersUsecase interface {
16
- GetServer (ctx context.Context , serverID int ) (Server , error )
17
- GetServerPermissions (ctx context.Context ) ([]ServerPermission , error )
18
- GetServers (ctx context.Context , filter ServerQueryFilter ) ([]Server , int64 , error )
19
- GetServerByName (ctx context.Context , serverName string , server * Server , disabledOk bool , deletedOk bool ) error
20
- GetServerByPassword (ctx context.Context , serverPassword string , server * Server , disabledOk bool , deletedOk bool ) error
21
- SaveServer (ctx context.Context , server * Server ) error
42
+ Server (ctx context.Context , serverID int ) (Server , error )
43
+ ServerPermissions (ctx context.Context ) ([]ServerPermission , error )
44
+ Servers (ctx context.Context , filter ServerQueryFilter ) ([]Server , int64 , error )
45
+ GetByName (ctx context.Context , serverName string , server * Server , disabledOk bool , deletedOk bool ) error
46
+ GetByPassword (ctx context.Context , serverPassword string , server * Server , disabledOk bool , deletedOk bool ) error
47
+ Save (ctx context.Context , req RequestServerUpdate ) (Server , error )
48
+ Delete (ctx context.Context , serverID int ) error
22
49
}
23
50
24
51
type ServersRepository interface {
0 commit comments