MCPcopy Index your code
hub / github.com/DarthSim/overmind / handleConnection

Method handleConnection

start/command_center.go:64–101  ·  view source on GitHub ↗
(conn net.Conn)

Source from the content-addressed store, hash-verified

62}
63
64func (c *commandCenter) handleConnection(conn net.Conn) {
65 re := regexp.MustCompile(`\S+`)
66
67 utils.ScanLines(conn, func(b []byte) bool {
68 args := re.FindAllString(string(b), -1)
69
70 if len(args) == 0 {
71 return true
72 }
73
74 cmd := args[0]
75
76 if len(args) > 1 {
77 args = args[1:]
78 } else {
79 args = []string{}
80 }
81
82 switch cmd {
83 case "restart":
84 c.processRestart(args)
85 case "stop":
86 c.processStop(args)
87 case "quit":
88 c.processQuit()
89 case "kill":
90 c.processKill()
91 case "get-connection":
92 c.processGetConnection(args, conn)
93 case "echo":
94 c.processEcho(conn)
95 case "status":
96 c.processStatus(conn)
97 }
98
99 return true
100 })
101}
102
103func (c *commandCenter) processRestart(args []string) {
104 for _, p := range c.cmd.processes {

Callers 1

StartMethod · 0.95

Calls 8

processRestartMethod · 0.95
processStopMethod · 0.95
processQuitMethod · 0.95
processKillMethod · 0.95
processGetConnectionMethod · 0.95
processEchoMethod · 0.95
processStatusMethod · 0.95
ScanLinesFunction · 0.92

Tested by

no test coverage detected