|
|
@ -1,6 +1,7 @@
|
|
|
|
package daemon
|
|
|
|
package daemon
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
|
|
|
|
"encoding/json"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"os/signal"
|
|
|
|
"os/signal"
|
|
|
@ -33,6 +34,7 @@ func Main() {
|
|
|
|
err := runServer(
|
|
|
|
err := runServer(
|
|
|
|
d.log,
|
|
|
|
d.log,
|
|
|
|
d.handlePing,
|
|
|
|
d.handlePing,
|
|
|
|
|
|
|
|
d.handleGetConfig,
|
|
|
|
d.handleListProfiles,
|
|
|
|
d.handleListProfiles,
|
|
|
|
d.handleLaunch,
|
|
|
|
d.handleLaunch,
|
|
|
|
d.handleListSandboxes,
|
|
|
|
d.handleListSandboxes,
|
|
|
@ -164,6 +166,15 @@ func (d *daemonState) handlePing(msg *PingMsg, m *ipc.Message) error {
|
|
|
|
return m.Respond(&PingMsg{msg.Data})
|
|
|
|
return m.Respond(&PingMsg{msg.Data})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (d *daemonState) handleGetConfig(msg *GetConfigMsg, m *ipc.Message) error {
|
|
|
|
|
|
|
|
d.Debug("received get config with data [%s]", msg.Data)
|
|
|
|
|
|
|
|
jdata, err := json.Marshal(d.config)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return m.Respond(&ErrorMsg{err.Error()})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return m.Respond(&GetConfigMsg{string(jdata)})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (d *daemonState) handleListProfiles(msg *ListProfilesMsg, m *ipc.Message) error {
|
|
|
|
func (d *daemonState) handleListProfiles(msg *ListProfilesMsg, m *ipc.Message) error {
|
|
|
|
r := new(ListProfilesResp)
|
|
|
|
r := new(ListProfilesResp)
|
|
|
|
index := 1
|
|
|
|
index := 1
|
|
|
|