-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhats-up.1h.go
33 lines (26 loc) · 873 Bytes
/
whats-up.1h.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// <xbar.title>What's Up?</xbar.title>
// <xbar.version>v0.17.0</xbar.version>
// <xbar.author>Luis A. Cruz</xbar.author>
// <xbar.author.github>sprak3000</xbar.author.github>
// <xbar.desc>Tracks if services are reporting any outages.</xbar.desc>
// <xbar.dependencies>golang</xbar.dependencies>
// Package main is the entry point for running the plugin
package main
import (
"fmt"
"os"
"github.com/sprak3000/go-whatsup-client/whatsup"
"github.com/sprak3000/xbar-whats-up/configuration"
"github.com/sprak3000/xbar-whats-up/service"
)
func main() {
sites, lErr := service.LoadSites(configuration.FileReader{}, configuration.FileWriter{}, "./.whats-up.json")
if lErr != nil {
fmt.Println("What's Up Error")
fmt.Println("---")
fmt.Printf("%v\n", lErr.Error())
os.Exit(1)
}
c := whatsup.NewStatusPageClient()
sites.GetOverview(c).Display(os.Stdout)
}