22 lines
397 B
Go
22 lines
397 B
Go
package services
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gitea.henriburau.de/haw-lan/cod4watcher/models"
|
|
)
|
|
|
|
type CoD4Service struct {
|
|
p models.StatusProvider
|
|
}
|
|
|
|
func NewCoD4Server(p models.StatusProvider) (*CoD4Service, error) {
|
|
return &CoD4Service{
|
|
p,
|
|
}, nil
|
|
}
|
|
|
|
func (s *CoD4Service) GetServerStatus(host, port string) (*models.CoD4ServerStatus, error) {
|
|
return s.p.GetServerStatus(host, port, time.Second)
|
|
}
|