-
Notifications
You must be signed in to change notification settings - Fork 111
/
builtin_config.go
39 lines (35 loc) · 943 Bytes
/
builtin_config.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
package generator
import (
"github.com/BurntSushi/toml"
"github.com/pkg/errors"
)
const builtinConfigToml = `
[templates]
[[templates.supervisor]]
name = "three-svc-sup"
[[ templates.supervisor.service ]]
package = "example/service-1"
application = "example-app"
[[ templates.supervisor.service ]]
package = "example/service-2"
application = "example-app"
[[ templates.supervisor.service ]]
package = "example/service-3"
application = "example-app"
[generator]
[[generator.supervisor]]
name = "supervisors:qa"
template = "three-svc-sup"
count = 10
channel = "qa"
environment = "qa"
site = "site1"
`
func BuiltinConfig() (*LoadProfileCfg, error) {
var profileCfg LoadProfileCfg
_, err := toml.Decode(builtinConfigToml, &profileCfg)
if err != nil {
return nil, errors.Wrap(err, "Oops :( The builtin load profile isn't valid")
}
return &profileCfg, nil
}