Versions in this module Expand all Collapse all v0 v0.7.6 Jun 15, 2024 Changes in this version + const CdPacketStr + const CmdDonePacketStr + const CmdFinalPacketStr + const CmdStartPacketStr + const CompGenPacketStr + const DataAckPacketStr + const DataEndPacketStr + const DataPacketStr + const DonePacketStr + const EC_CmdNotRunning + const EC_InvalidCwd + const FileDataPacketStr + const FileStatPacketStr + const GetCmdPacketStr + const InitPacketStr + const LogPacketStr + const MaxCompGenValues + const MessagePacketStr + const OpenAICloudReqStr + const OpenAICmdInfoChatGreetingMessage + const OpenAIPacketStr + const PacketEOFStr + const PacketSenderQueueSize + const PingPacketStr + const RawPacketStr + const ReInitPacketStr + const ResponsePacketStr + const RpcInputPacketStr + const RunPacketStr + const ShellStateDiffPackVersion + const ShellStatePackVersion + const ShellStatePacketStr + const ShellType_bash + const ShellType_zsh + const SpecialInputPacketStr + const StreamFilePacketStr + const StreamFileResponseStr + const SudoRequestPacketStr + const SudoResponsePacketStr + const UntailCmdPacketStr + const WriteFileDonePacketStr + const WriteFilePacketStr + const WriteFileReadyPacketStr + var GlobalDebug = false + var TypeStrToFactory map[string]reflect.Type + func AsExtType(pk PacketType) string + func AsString(pk PacketType) string + func B64DecodedLen(b64 string) int + func GetMajorVersion(versionStr string) string + func IsValidCompGenType(t string) bool + func MarshalPacket(packet PacketType) ([]byte, error) + func ParseShellStateVersion(fullVersionStr string) (string, string, error) + func RegisterPacketType(typeStr string, rtype reflect.Type) + func SendPacket(w io.Writer, packet PacketType) error + func StateVersionsCompatible(v1 string, v2 string) bool + type BarePacketType struct + Type string + type CdPacketType struct + Dir string + ReqId string + Type string + func MakeCdPacket() *CdPacketType + func (*CdPacketType) GetType() string + func (p *CdPacketType) GetReqId() string + type CmdDonePacketType struct + CK base.CommandKey + DurationMs int64 + ExitCode int + FinalState *ShellState + FinalStateBasePtr *ShellStatePtr + FinalStateDiff *ShellStateDiff + Ts int64 + Type string + func MakeCmdDonePacket(ck base.CommandKey) *CmdDonePacketType + func (*CmdDonePacketType) GetType() string + func (p *CmdDonePacketType) GetCK() base.CommandKey + type CmdFinalPacketType struct + CK base.CommandKey + Error string + Ts int64 + Type string + func MakeCmdFinalPacket(ck base.CommandKey) *CmdFinalPacketType + func (*CmdFinalPacketType) GetType() string + func (pk *CmdFinalPacketType) GetCK() base.CommandKey + type CmdStartPacketType struct + CK base.CommandKey + Pid int + RespId string + Ts int64 + Type string + WaveshellPid int + func MakeCmdStartPacket(reqId string) *CmdStartPacketType + func (*CmdStartPacketType) GetResponseDone() bool + func (*CmdStartPacketType) GetType() string + func (p *CmdStartPacketType) GetResponseId() string + type CommandPacketType interface + GetCK func() base.CommandKey + GetType func() string + type CompGenPacketType struct + CompType string + Cwd string + Prefix string + ReqId string + Type string + func MakeCompGenPacket() *CompGenPacketType + func (*CompGenPacketType) GetType() string + func (p *CompGenPacketType) GetReqId() string + type DataAckPacketType struct + AckLen int + CK base.CommandKey + Error string + FdNum int + Type string + func MakeDataAckPacket() *DataAckPacketType + func (*DataAckPacketType) GetType() string + func (p *DataAckPacketType) GetCK() base.CommandKey + func (p *DataAckPacketType) String() string + type DataEndPacketType struct + CK base.CommandKey + Type string + func MakeDataEndPacket(ck base.CommandKey) *DataEndPacketType + func (*DataEndPacketType) GetType() string + type DataPacketType struct + CK base.CommandKey + Data64 string + Eof bool + Error string + FdNum int + Type string + func MakeDataPacket() *DataPacketType + func (*DataPacketType) GetType() string + func (p *DataPacketType) GetCK() base.CommandKey + func (p *DataPacketType) String() string + type DefaultUPR struct + func (DefaultUPR) UnknownPacket(pk PacketType) + type DonePacketType struct + Type string + func MakeDonePacket() *DonePacketType + func (*DonePacketType) GetType() string + type FileDataPacketType struct + Data []byte + Eof bool + Error string + RespId string + Type string + func MakeFileDataPacket(reqId string) *FileDataPacketType + func (*FileDataPacketType) GetType() string + func (p *FileDataPacketType) GetAssociatedReqId() string + func (p *FileDataPacketType) GetResponseDone() bool + func (p *FileDataPacketType) GetResponseId() string + type FileInfo struct + IsDir bool + MimeType string + ModTs int64 + Name string + NotFound bool + Perm int + Size int64 + type FileStatPacketType struct + Done bool + Error string + IsDir bool + ModTs time.Time + ModeStr string + Name string + Path string + Perm int + RespId string + Size int64 + Type string + func MakeFileStatPacketFromFileInfo(finfo fs.FileInfo, err string, done bool) *FileStatPacketType + func MakeFileStatPacketType() *FileStatPacketType + func (*FileStatPacketType) GetType() string + func (p *FileStatPacketType) GetResponseDone() bool + func (p *FileStatPacketType) GetResponseId() string + type GetCmdPacketType struct + CK base.CommandKey + PtyOnly bool + PtyPos int64 + ReqId string + RunPos int64 + Tail bool + Type string + func MakeGetCmdPacket() *GetCmdPacketType + func (*GetCmdPacketType) GetType() string + func (p *GetCmdPacketType) GetReqId() string + type InitPacketType struct + BuildTime string + HomeDir string + HostName string + NotFound bool + RemoteId string + RespId string + Shell string + Type string + UName string + User string + Version string + WaveshellHomeDir string + func MakeInitPacket() *InitPacketType + func (*InitPacketType) GetType() string + func (pk *InitPacketType) GetResponseDone() bool + func (pk *InitPacketType) GetResponseId() string + type LogPacketType struct + Entry wlog.LogEntry + Type string + func MakeLogPacket(entry wlog.LogEntry) *LogPacketType + func (*LogPacketType) GetType() string + func (p *LogPacketType) String() string + type MessagePacketType struct + CK base.CommandKey + Message string + Type string + func FmtMessagePacket(fmtStr string, args ...interface{}) *MessagePacketType + func MakeMessagePacket(message string) *MessagePacketType + func (*MessagePacketType) GetType() string + func (p *MessagePacketType) String() string + type MessageUPR struct + CK base.CommandKey + Sender *PacketSender + func (upr MessageUPR) UnknownPacket(pk PacketType) + type ModelUpdatePacketType struct + Type string + Updates []any + type OpenAICloudReqPacketType struct + ClientId string + MaxChoices int + MaxTokens int + Prompt []OpenAIPromptMessageType + Type string + func MakeOpenAICloudReqPacket() *OpenAICloudReqPacketType + func (*OpenAICloudReqPacketType) GetType() string + type OpenAICmdInfoChatMessage struct + AssistantResponse *OpenAICmdInfoPacketOutputType + IsAssistantResponse bool + MessageID int + UserEngineeredQuery string + UserQuery string + type OpenAICmdInfoPacketOutputType struct + Created int64 + Error string + FinishReason string + Message string + Model string + type OpenAIPacketType struct + Created int64 + Error string + FinishReason string + Index int + Model string + Text string + Type string + Usage *OpenAIUsageType + func MakeOpenAIPacket() *OpenAIPacketType + func (*OpenAIPacketType) GetType() string + type OpenAIPromptMessageType struct + Content string + Name string + Role string + type OpenAIUsageType struct + CompletionTokens int + PromptTokens int + TotalTokens int + type PacketParser struct + Err error + Lock *sync.Mutex + MainCh chan PacketType + RpcHandler bool + RpcMap map[string]*RpcEntry + func CombinePacketParsers(p1 *PacketParser, p2 *PacketParser, rpcHandler bool) *PacketParser + func MakePacketParser(input io.Reader, opts *PacketParserOpts) *PacketParser + func (p *PacketParser) GetErr() error + func (p *PacketParser) GetNextResponse(ctx context.Context, reqId string) (RpcResponsePacketType, error) + func (p *PacketParser) GetResponseIter(reqId string) *RpcResponseIter + func (p *PacketParser) RegisterRpc(reqId string) chan RpcResponsePacketType + func (p *PacketParser) RegisterRpcSz(reqId string, queueSize int) chan RpcResponsePacketType + func (p *PacketParser) SetErr(err error) + func (p *PacketParser) UnRegisterRpc(reqId string) + func (p *PacketParser) WaitForResponse(ctx context.Context, reqId string) RpcResponsePacketType + type PacketParserOpts struct + IgnoreUntilValid bool + RpcHandler bool + type PacketSender struct + Done bool + DoneCh chan bool + ErrHandler func(*PacketSender, PacketType, error) + ExitErr error + Lock *sync.Mutex + SendCh chan PacketType + func MakeChannelPacketSender(packetCh chan PacketType) *PacketSender + func MakePacketSender(output io.Writer, errHandler func(*PacketSender, PacketType, error)) *PacketSender + func (sender *PacketSender) Close() + func (sender *PacketSender) SendErrorResponse(reqId string, err error) error + func (sender *PacketSender) SendLogPacket(entry wlog.LogEntry) + func (sender *PacketSender) SendMessageFmt(fmtStr string, args ...interface{}) error + func (sender *PacketSender) SendPacket(pk PacketType) error + func (sender *PacketSender) SendPacketCtx(ctx context.Context, pk PacketType) error + func (sender *PacketSender) SendResponse(reqId string, data interface{}) error + func (sender *PacketSender) WaitForDone() error + type PacketType interface + GetType func() string + func MakePacket(packetType string) (PacketType, error) + func ParseJsonPacket(jsonBuf []byte) (PacketType, error) + type PingPacketType struct + Type string + func MakePingPacket() *PingPacketType + func (*PingPacketType) GetType() string + type RawPacketType struct + Data string + Type string + func MakeRawPacket(val string) *RawPacketType + func (*RawPacketType) GetType() string + func (p *RawPacketType) String() string + type ReInitPacketType struct + ReqId string + ShellType string + Type string + func MakeReInitPacket() *ReInitPacketType + func (*ReInitPacketType) GetType() string + func (p *ReInitPacketType) GetReqId() string + type RemoteFd struct + DupStdin bool + FdNum int + Read bool + Write bool + type ResponsePacketType struct + Data interface{} + Error string + ErrorCode string + RespId string + Success bool + Type string + func MakeErrorResponsePacket(reqId string, err error) *ResponsePacketType + func MakeResponsePacket(reqId string, data interface{}) *ResponsePacketType + func (*ResponsePacketType) GetResponseDone() bool + func (*ResponsePacketType) GetType() string + func (p *ResponsePacketType) Err() error + func (p *ResponsePacketType) GetResponseId() string + func (p *ResponsePacketType) String() string + type RpcEntry struct + ReqId string + RespCh chan RpcResponsePacketType + type RpcFollowUpPacketType interface + GetAssociatedReqId func() string + GetType func() string + type RpcInputPacketType struct + Data []byte + ReqId string + Type string + func MakeRpcInputPacket(reqId string) *RpcInputPacketType + func (*RpcInputPacketType) GetType() string + func (p *RpcInputPacketType) GetAssociatedReqId() string + type RpcPacketType interface + GetReqId func() string + GetType func() string + type RpcResponseIter struct + Parser *PacketParser + ReqId string + func (iter *RpcResponseIter) Close() + func (iter *RpcResponseIter) Next(ctx context.Context) (RpcResponsePacketType, error) + type RpcResponsePacketType interface + GetResponseDone func() bool + GetResponseId func() string + GetType func() string + type RunDataType struct + Data []byte + DataLen int + FdNum int + type RunPacketBuilder struct + RunMap map[base.CommandKey]*RunPacketType + func MakeRunPacketBuilder() *RunPacketBuilder + func (b *RunPacketBuilder) ProcessPacket(pk PacketType) (bool, *RunPacketType) + type RunPacketType struct + CK base.CommandKey + Command string + Detached bool + Fds []RemoteFd + IsSudo bool + ReqId string + ReturnState bool + RunData []RunDataType + ShellType string + State *ShellState + StateComplete bool + StatePtr *ShellStatePtr + TermOpts *TermOpts + Timeout time.Duration + Type string + UsePty bool + func MakeRunPacket() *RunPacketType + func (*RunPacketType) GetType() string + func (p *RunPacketType) GetReqId() string + type SendError struct + Err error + IsMarshalError bool + IsWriteError bool + PacketType string + func (e *SendError) Error() string + func (e *SendError) Unwrap() error + type ShellState struct + Aliases string + Cwd string + Error string + Funcs string + HashVal string + ShellVars []byte + Version string + func (state *ShellState) DecodeShellState(barr []byte) error + func (state *ShellState) GetHashVal(force bool) string + func (state *ShellState) UnmarshalJSON(jsonBytes []byte) error + func (state ShellState) ApproximateSize() int64 + func (state ShellState) Dump() + func (state ShellState) EncodeAndHash() (string, []byte) + func (state ShellState) GetLineDiffSplitString() string + func (state ShellState) GetShellType() string + func (state ShellState) IsEmpty() bool + func (state ShellState) MarshalJSON() ([]byte, error) + type ShellStateDiff struct + AliasesDiff []byte + BaseHash string + Cwd string + DiffHashArr []string + Error string + FuncsDiff []byte + HashVal string + VarsDiff []byte + Version string + func (diff ShellStateDiff) GetShellType() string + func (sdiff *ShellStateDiff) DecodeShellStateDiff(barr []byte) error + func (sdiff *ShellStateDiff) GetHashVal(force bool) string + func (sdiff *ShellStateDiff) UnmarshalJSON(jsonBytes []byte) error + func (sdiff ShellStateDiff) Dump(vars bool, aliases bool, funcs bool) + func (sdiff ShellStateDiff) EncodeAndHash() (string, []byte) + func (sdiff ShellStateDiff) MarshalJSON() ([]byte, error) + type ShellStatePacketType struct + Error string + RespId string + ShellType string + State *ShellState + Stats *ShellStateStats + Type string + func MakeShellStatePacket() *ShellStatePacketType + func (*ShellStatePacketType) GetType() string + func (p *ShellStatePacketType) GetResponseDone() bool + func (p *ShellStatePacketType) GetResponseId() string + func (p *ShellStatePacketType) String() string + type ShellStatePtr struct + BaseHash string + DiffHashArr []string + func (ssptr *ShellStatePtr) IsEmpty() bool + type ShellStateStats struct + AliasCount int + EnvCount int + FuncCount int + HashVal string + OutputSize int64 + StateSize int64 + VarCount int + Version string + type SpecialInputPacketType struct + CK base.CommandKey + SigName string + Type string + WinSize *WinSize + func MakeSpecialInputPacket() *SpecialInputPacketType + func (*SpecialInputPacketType) GetType() string + func (p *SpecialInputPacketType) GetCK() base.CommandKey + type StreamFilePacketType struct + ByteRange []int64 + Path string + ReqId string + StatOnly bool + Type string + func MakeStreamFilePacket() *StreamFilePacketType + func (*StreamFilePacketType) GetType() string + func (p *StreamFilePacketType) GetReqId() string + type StreamFileResponseType struct + Done bool + Error string + Info *FileInfo + RespId string + Type string + func MakeStreamFileResponse(respId string) *StreamFileResponseType + func (*StreamFileResponseType) GetType() string + func (p *StreamFileResponseType) GetResponseDone() bool + func (p *StreamFileResponseType) GetResponseId() string + type SudoRequestPacketType struct + CK base.CommandKey + ErrStr string + ShellPubKey []byte + SudoStatus string + Type string + func MakeSudoRequestPacket(ck base.CommandKey, pubKey []byte, sudoStatus string) *SudoRequestPacketType + func (*SudoRequestPacketType) GetType() string + func (p *SudoRequestPacketType) GetCK() base.CommandKey + type SudoResponsePacketType struct + CK base.CommandKey + Secret []byte + SrvPubKey []byte + Type string + func MakeSudoResponsePacket(ck base.CommandKey, secret []byte, srvPubKey []byte) *SudoResponsePacketType + func (*SudoResponsePacketType) GetType() string + func (p *SudoResponsePacketType) GetCK() base.CommandKey + type TermOpts struct + Cols int + FlexRows bool + MaxPtySize int64 + Rows int + Term string + type UnknownPacketReporter interface + UnknownPacket func(pk PacketType) + type UntailCmdPacketType struct + CK base.CommandKey + ReqId string + Type string + func MakeUntailCmdPacket() *UntailCmdPacketType + func (*UntailCmdPacketType) GetType() string + func (p *UntailCmdPacketType) GetReqId() string + type WinSize struct + Cols int + Rows int + type WriteFileDonePacketType struct + Error string + RespId string + Type string + func MakeWriteFileDonePacket(reqId string) *WriteFileDonePacketType + func (*WriteFileDonePacketType) GetType() string + func (p *WriteFileDonePacketType) GetResponseDone() bool + func (p *WriteFileDonePacketType) GetResponseId() string + type WriteFilePacketType struct + Path string + ReqId string + Type string + UseTemp bool + func MakeWriteFilePacket() *WriteFilePacketType + func (*WriteFilePacketType) GetType() string + func (p *WriteFilePacketType) GetReqId() string + type WriteFileReadyPacketType struct + Error string + RespId string + Type string + func MakeWriteFileReadyPacket(reqId string) *WriteFileReadyPacketType + func (*WriteFileReadyPacketType) GetType() string + func (p *WriteFileReadyPacketType) GetResponseDone() bool + func (p *WriteFileReadyPacketType) GetResponseId() string