-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathscreenboards.go
More file actions
39 lines (31 loc) · 789 Bytes
/
screenboards.go
File metadata and controls
39 lines (31 loc) · 789 Bytes
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
34
35
36
37
38
39
//go:generate go-bindata -o tpl.go tmpl
package main
import (
"github.com/zorkian/go-datadog-api"
)
type ScreenBoard struct {
}
func (s ScreenBoard) getElement(client datadog.Client, id int) (interface{}, error) {
elem, err := client.GetScreenboard(*datadog.Int(id))
return elem, err
}
func (s ScreenBoard) getAsset() string {
return "tmpl/screenboard.tmpl"
}
func (s ScreenBoard) getName() string {
return "screenboards"
}
func (s ScreenBoard) String() string {
return s.getName()
}
func (s ScreenBoard) getAllElements(client datadog.Client) ([]Item, error) {
var ids []Item
dashboards, err := client.GetScreenboards()
if err != nil {
return ids, err
}
for _, elem := range dashboards {
ids = append(ids, Item{id: *elem.Id, d: ScreenBoard{}})
}
return ids, nil
}