-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathggconfig.go
More file actions
35 lines (31 loc) · 844 Bytes
/
ggconfig.go
File metadata and controls
35 lines (31 loc) · 844 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
package gghelper
import (
"encoding/json"
"io"
)
// GreengrassConfig holds the /greengrass/config/config.json structure
type GreengrassConfig struct {
CoreThing struct {
CAPath string `json:"caPath"`
CertPath string `json:"certPath"`
KeyPath string `json:"keyPath"`
ThingArn string `json:"thingArn"`
IOTHost string `json:"iotHost"`
GGHost string `json:"ggHost"`
} `json:"coreThing"`
Runtime struct {
Cgroup struct {
UseSystemd string `json:"useSystemd"`
} `json:"cgroup"`
} `json:"runtime"`
ManagedRespawn bool `json:"managedRespawn"`
}
// NewGGConfig - create a new Greengrass core config object
func NewGGConfig() (ggconfig *GreengrassConfig) {
ggconfig = new(GreengrassConfig)
return ggconfig
}
func (ggc *GreengrassConfig) Write(w io.Writer) {
b, _ := json.MarshalIndent(*ggc, "", " ")
w.Write(b)
}