(route string, uuid string)
| 1066 | } |
| 1067 | |
| 1068 | func (console *Console) handleSSHPanelCommand(route string, uuid string) { |
| 1069 | sMessage := protocol.PrepareAndDecideWhichSProtoToLower(global.G_Component.Conn, global.G_Component.Secret, global.G_Component.UUID) |
| 1070 | |
| 1071 | header := &protocol.Header{ |
| 1072 | Sender: protocol.ADMIN_UUID, |
| 1073 | Accepter: uuid, |
| 1074 | MessageType: protocol.SSHCOMMAND, |
| 1075 | RouteLen: uint32(len([]byte(route))), |
| 1076 | Route: route, |
| 1077 | } |
| 1078 | |
| 1079 | console.ready <- true |
| 1080 | |
| 1081 | for { |
| 1082 | select { |
| 1083 | case tCommand := <-console.getCommand: |
| 1084 | sshCommandMess := &protocol.SSHCommand{ |
| 1085 | CommandLen: uint64(len(tCommand)), |
| 1086 | Command: tCommand, |
| 1087 | } |
| 1088 | protocol.ConstructMessage(sMessage, header, sshCommandMess, false) |
| 1089 | sMessage.SendMessage() |
| 1090 | case <-console.mgr.ConsoleManager.Exit: |
| 1091 | return |
| 1092 | } |
| 1093 | } |
| 1094 | } |
| 1095 | |
| 1096 | func (console *Console) expectParams(params []string, numbers interface{}, mode int, needToBeInt interface{}) bool { |
| 1097 | switch nums := numbers.(type) { |
no test coverage detected