MCPcopy
hub / github.com/github/gh-ost / onServerCommand

Method onServerCommand

go/logic/server.go:183–193  ·  view source on GitHub ↗

onServerCommand responds to a user's interactive command

(command string, writer *bufio.Writer)

Source from the content-addressed store, hash-verified

181
182// onServerCommand responds to a user's interactive command
183func (srv *Server) onServerCommand(command string, writer *bufio.Writer) (err error) {
184 defer writer.Flush()
185
186 printStatusRule, err := srv.applyServerCommand(command, writer)
187 if err == nil {
188 srv.printStatus(printStatusRule, writer)
189 } else {
190 fmt.Fprintf(writer, "%s\n", err.Error())
191 }
192 return srv.migrationContext.Log.Errore(err)
193}
194
195// applyServerCommand parses and executes commands by user
196func (srv *Server) applyServerCommand(command string, writer *bufio.Writer) (printStatusRule PrintStatusRule, err error) {

Callers 1

handleConnectionMethod · 0.95

Calls 4

applyServerCommandMethod · 0.95
printStatusMethod · 0.80
ErrorMethod · 0.65
ErroreMethod · 0.65

Tested by

no test coverage detected