mirror of
https://github.com/tale/headplane.git
synced 2026-08-19 17:36:19 +00:00
feat: switch away from websocket to stdout messaging for agent
This commit is contained in:
@@ -8,6 +8,11 @@ import (
|
||||
"github.com/tale/headplane/agent/internal/util"
|
||||
)
|
||||
|
||||
type Register struct {
|
||||
Type string
|
||||
ID string
|
||||
}
|
||||
|
||||
func main() {
|
||||
log := util.GetLogger()
|
||||
cfg, err := config.Load()
|
||||
@@ -21,11 +26,10 @@ func main() {
|
||||
agent.Connect()
|
||||
defer agent.Shutdown()
|
||||
|
||||
ws, err := hpagent.NewSocket(agent, cfg)
|
||||
if err != nil {
|
||||
log.Fatal("Failed to create websocket: %s", err)
|
||||
}
|
||||
log.Msg(&Register{
|
||||
Type: "register",
|
||||
ID: agent.ID,
|
||||
})
|
||||
|
||||
defer ws.StopListening()
|
||||
ws.FollowMaster()
|
||||
hpagent.FollowMaster(agent)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user