-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.go
More file actions
36 lines (31 loc) · 748 Bytes
/
cli.go
File metadata and controls
36 lines (31 loc) · 748 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
package agent
import (
"os"
"os/signal"
"syscall"
"github.com/fictionbase/fictionbase/type/fbprocess"
"github.com/fictionbase/fictionbase/type/fbresource"
)
// RunCLI exec Cli
func RunCLI(i []interface{}) int {
// @TODO Exec Config Set
go fbresourceRun()
go fbprocessRun()
// signal Catch
signalCh := make(chan os.Signal)
signal.Notify(signalCh, syscall.SIGHUP, syscall.SIGTERM, os.Interrupt)
select {
case ch := <-signalCh:
return catchSig(ch)
}
}
func fbresourceRun() {
// @TODO determine whether to execute from fictionbase.yml
resource := fbresource.FictionBase{}
resource.Run()
}
func fbprocessRun() {
// @TODO determine whether to execute from fictionbase.yml
processes := fbprocess.FictionBase{}
processes.Run()
}