-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.go
64 lines (58 loc) · 1.58 KB
/
plugin.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Package spec contains struct and interface specification for honcheonui plugins
package spec
import (
"time"
"github.com/gofrs/uuid"
)
// HoncheonuiResource is a struct for containing resource data
type HoncheonuiResource struct {
Provider string
Type string
OriginalID string
UUID uuid.UUID
Name string
Notes string
GroupID string
ResourceCreatedAt time.Time
ResourceModifiedAt time.Time
IPAddress string
Location string
IsConn bool
IsOn bool
Attributes map[string]string
IntegerAttributes map[string]int
Tags []string
UserIDs []string
Raw interface{}
}
// HoncheonuiStatus is a struct for containing status data
type HoncheonuiStatus struct {
OriginalID string
IsConn bool
IsOn bool
}
// HoncheonuiNotification is a struct for containing notification data
type HoncheonuiNotification struct {
Provider string
Type string
OriginalID string
GroupID string
UserID string
Title string
Content string
Category string
IssuedBy string
IsOpen bool
IssuedAt time.Time
ModifiedAt time.Time
ResourceIDs []string
UserIDs []string
}
// Provider is an interface for provider plugins
type Provider interface {
Init() error
CheckAccount(string, string) (int, int, error)
GetResources(string, string) ([]interface{}, error)
GetStatuses(string, string) ([]interface{}, error)
GetNotifications(string, string, time.Time) ([]interface{}, error)
}