-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
28 lines (24 loc) · 722 Bytes
/
main.go
File metadata and controls
28 lines (24 loc) · 722 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
package main
import (
"flag"
"fmt"
"os"
"code.crute.us/mcrute/simplevisor/supervise"
)
func main() {
mode := flag.String("mode", "parent", "mode in which to run simplevisor, internal use only")
config := flag.String("config", "simplevisor.json", "config file location")
noVault := flag.Bool("no-vault", false, "disable Vault integration entirely")
discoverVault := flag.Bool("discover-vault", false, "use DNS SRV to discover Vault address")
flag.Parse()
switch *mode {
case "parent":
parent := &supervise.SupervisorParent{}
parent.Main(*config, *noVault, *discoverVault)
case "child":
supervise.ChildMain()
default:
fmt.Println("Error starting supervisor, invalid mode passed.")
os.Exit(1)
}
}