waveterm/pkg/scpacket/scpacket.go

37 lines
841 B
Go
Raw Normal View History

2022-07-01 21:17:19 +02:00
package scpacket
import (
"reflect"
"github.com/scripthaus-dev/mshell/pkg/packet"
)
const FeCommandPacketStr = "fecmd"
type RemoteState struct {
RemoteId string `json:"remoteid"`
RemoteName string `json:"remotename"`
Cwd string `json:"cwd"`
}
type FeCommandPacketType struct {
Type string `json:"type"`
SessionId string `json:"sessionid"`
WindowId string `json:"windowid"`
2022-07-03 21:01:56 +02:00
UserId string `json:"userid"`
2022-07-01 21:17:19 +02:00
CmdStr string `json:"cmdstr"`
RemoteState RemoteState `json:"remotestate"`
}
func init() {
packet.RegisterPacketType(FeCommandPacketStr, reflect.TypeOf(&FeCommandPacketType{}))
}
func (*FeCommandPacketType) GetType() string {
return FeCommandPacketStr
}
func MakeFeCommandPacket() *FeCommandPacketType {
return &FeCommandPacketType{Type: FeCommandPacketStr}
}