onServerCommand responds to a user's interactive command
(command string, writer *bufio.Writer)
| 181 | |
| 182 | // onServerCommand responds to a user's interactive command |
| 183 | func (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 |
| 196 | func (srv *Server) applyServerCommand(command string, writer *bufio.Writer) (printStatusRule PrintStatusRule, err error) { |
no test coverage detected