forked from Cliffbreak/tsviewer
30 lines
834 B
Go
30 lines
834 B
Go
|
package service
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"git.cliffbreak.de/haveachin/go-tsviewer/features/server"
|
||
|
)
|
||
|
|
||
|
func (s Service) Info() (*server.Server, error) {
|
||
|
serverInfo, err := s.TSClient.Server.Info()
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
return &server.Server{
|
||
|
Name: serverInfo.Name,
|
||
|
Status: serverInfo.Status,
|
||
|
Version: serverInfo.Version,
|
||
|
WelcomeMessage: serverInfo.WelcomeMessage,
|
||
|
MaxClients: serverInfo.MaxClients,
|
||
|
ClientsOnline: serverInfo.ClientsOnline,
|
||
|
ReservedSlots: serverInfo.ReservedSlots,
|
||
|
Uptime: time.Duration(serverInfo.Uptime) * time.Nanosecond,
|
||
|
TotalPing: serverInfo.TotalPing,
|
||
|
MinAndroidVersion: serverInfo.MinAndroidVersion,
|
||
|
MinClientVersion: serverInfo.MinClientVersion,
|
||
|
MiniOSVersion: serverInfo.MiniOSVersion,
|
||
|
}, nil
|
||
|
}
|