Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (40 sloc) 1.14 KB
package patrol
type API_Status struct {
// Instance ID - UUIDv4
InstanceID string `json:"instance-id,omitempty"`
Apps map[string]*API_Response `json:"apps,omitempty"`
Services map[string]*API_Response `json:"service,omitempty"`
// Timestamp Patrol started at
Started *Timestamp `json:"started,omitempty"`
// Is Patrol in a Shutdown state?
Shutdown bool `json:"shutdown,omitempty"`
func (self *Patrol) GetStatus() *API_Status {
started := self.ticker_running
shutdown := self.shutdown
result := &API_Status{
InstanceID: self.instance_id,
Apps: make(map[string]*API_Response),
Services: make(map[string]*API_Response),
Shutdown: shutdown,
if !started.IsZero() {
result.Started = &Timestamp{
Time: started,
TimestampFormat: self.config.Timestamp,
for id, app := range self.apps {
result.Apps[id] = app.apiResponse(api_endpoint_status)
for id, service := range {
result.Services[id] = service.apiResponse(api_endpoint_status)
return result
You can’t perform that action at this time.