Refactor code

This commit is contained in:
TwinProduction
2021-07-14 01:53:14 -04:00
committed by Chris
parent a4c69d6fc3
commit 8dedcf7c74
6 changed files with 19 additions and 26 deletions

View File

@ -1,9 +1,5 @@
package core
import (
"time"
)
const (
// MaximumNumberOfResults is the maximum number of results that ServiceStatus.Results can have
MaximumNumberOfResults = 100
@ -42,17 +38,14 @@ type ServiceStatus struct {
}
// NewServiceStatus creates a new ServiceStatus
func NewServiceStatus(service *Service) *ServiceStatus {
func NewServiceStatus(serviceKey, serviceGroup, serviceName string) *ServiceStatus {
return &ServiceStatus{
Name: service.Name,
Group: service.Group,
Key: service.Key(),
Name: serviceName,
Group: serviceGroup,
Key: serviceKey,
Results: make([]*Result, 0),
Events: []*Event{{
Type: EventStart,
Timestamp: time.Now(),
}},
Uptime: NewUptime(),
Events: make([]*Event, 0),
Uptime: NewUptime(),
}
}