waveterm/pkg/scpacket/scpacket.go
2022-07-03 12:01:56 -07:00

37 lines
841 B
Go

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"`
UserId string `json:"userid"`
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}
}