Documentation ¶
Index ¶
- Constants
- func AddRunData(pk *packet.RunPacketType, data string, dataType string) (int, error)
- func DetectGoArch(uname string) (string, string, error)
- func GetTerminalSize() (int, int, error)
- func GetWinsize(p *packet.RunPacketType) *pty.Winsize
- func HasDupStdin(fds []packet.RemoteFd) bool
- func IgnoreSigPipe()
- func MakeAndCopyStdinFifo(dst *os.File, fifoName string) error
- func MakeClientCommandStr() string
- func MakeDetachedExecCmd(pk *packet.RunPacketType, cmdTty *os.File) (*exec.Cmd, error)
- func MakeEnv0(envMap map[string]string) []byte
- func MakeInitPacket() *packet.InitPacketType
- func MakeInstallCommandStr() string
- func MakeLocalExecCmd(cmdStr string, sapi shellapi.ShellApi) *exec.Cmd
- func MakeRunnerExec(ck base.CommandKey) (*exec.Cmd, error)
- func MakeServerInitPacket() (*packet.InitPacketType, error)
- func MakeSimpleStaticWriterPipe(data []byte) (*os.File, error)
- func MakeWaveshellSingleCmd() (*exec.Cmd, error)
- func MaxFdNumInPacket(pk *packet.RunPacketType) int
- func NextFreeFdNum(pk *packet.RunPacketType) (int, error)
- func ParseEnv0(env []byte) map[string]string
- func RunInstallFromCmd(ctx context.Context, ecmd ConnInterface, tryDetect bool, ...) error
- func SendRunPacketAndRunData(ctx context.Context, sender *packet.PacketSender, ...) error
- func SetupSignalsForDetach()
- func ValidateRemoteFds(rfds []packet.RemoteFd) error
- func ValidateRunPacket(pk *packet.RunPacketType) error
- type ClientOpts
- type ClientProc
- type CmdWrap
- func (cw CmdWrap) Kill()
- func (cw CmdWrap) Parser() (*packet.PacketParser, io.ReadCloser, io.ReadCloser, error)
- func (cw CmdWrap) Sender() (*packet.PacketSender, io.WriteCloser, error)
- func (cw CmdWrap) Start() error
- func (cw CmdWrap) StderrPipe() (io.ReadCloser, error)
- func (cw CmdWrap) StdinPipe() (io.WriteCloser, error)
- func (cw CmdWrap) StdoutPipe() (io.ReadCloser, error)
- func (cw CmdWrap) Wait() error
- type ConnInterface
- type FdContext
- type InstallOpts
- type InvalidPacketError
- type ReturnStateBuf
- type SSHOpts
- type SessionWrap
- func (sw SessionWrap) Kill()
- func (sw SessionWrap) Parser() (*packet.PacketParser, io.ReadCloser, io.ReadCloser, error)
- func (sw SessionWrap) Sender() (*packet.PacketSender, io.WriteCloser, error)
- func (sw SessionWrap) Start() error
- func (sw SessionWrap) StderrPipe() (io.ReadCloser, error)
- func (sw SessionWrap) StdinPipe() (io.WriteCloser, error)
- func (sw SessionWrap) StdoutPipe() (io.ReadCloser, error)
- func (sw SessionWrap) Wait() error
- type ShExecType
- func (c *ShExecType) Close()
- func (c *ShExecType) IsExited() bool
- func (c *ShExecType) MakeCmdStartPacket(reqId string) *packet.CmdStartPacketType
- func (c *ShExecType) ProcWait() error
- func (cmd *ShExecType) RunRemoteIOAndWait(packetParser *packet.PacketParser, sender *packet.PacketSender)
- func (s *ShExecType) SendSignal(sig syscall.Signal)
- func (c *ShExecType) WaitForCommand() *packet.CmdDonePacketType
- type ShExecUPR
- type StdContext
- type WaveshellBinaryReaderFn
- type WaveshellLaunchError
Constants ¶
View Source
const ClientCommandFmt = `` /* 221-byte string literal not displayed */
View Source
const DefaultMaxPtySize = 1024 * 1024
View Source
const FirstExtraFilesFdNum = 3
View Source
const ForceDebugRcFile = false
View Source
const ForceDebugReturnState = false
View Source
const InstallCommandFmt = `` /* 350-byte string literal not displayed */
View Source
const MaxFdNum = 1023
View Source
const MaxMaxPtySize = 100 * 1024 * 1024
View Source
const MaxRunDataSize = 1024 * 1024
View Source
const MaxTermCols = 1024
View Source
const MaxTermRows = 1024
View Source
const MaxTotalRunDataSize = 10 * MaxRunDataSize
View Source
const MinMaxPtySize = 16 * 1024
View Source
const MinTermCols = 10
View Source
const MinTermRows = 2
View Source
const NotFoundVersion = "v0.0"
View Source
const ReturnStateReadWaitTime = 2 * time.Second
View Source
const RtnStateFdNum = 20
View Source
const ShellVarName = "SHELL"
View Source
const SigKillWaitTime = 2 * time.Second
Variables ¶
This section is empty.
Functions ¶
func AddRunData ¶
func GetTerminalSize ¶
func GetWinsize ¶
func GetWinsize(p *packet.RunPacketType) *pty.Winsize
func HasDupStdin ¶
func IgnoreSigPipe ¶
func IgnoreSigPipe()
in detached run mode, we don't want waveshell to die from signals since we want waveshell to persist even if the waveshell --server is terminated
func MakeAndCopyStdinFifo ¶
this will never return (unless there is an error creating/opening the file), as fifoFile will never EOF
func MakeClientCommandStr ¶
func MakeClientCommandStr() string
func MakeDetachedExecCmd ¶
func MakeInitPacket ¶
func MakeInitPacket() *packet.InitPacketType
func MakeInstallCommandStr ¶
func MakeInstallCommandStr() string
func MakeRunnerExec ¶
func MakeRunnerExec(ck base.CommandKey) (*exec.Cmd, error)
func MakeServerInitPacket ¶
func MakeServerInitPacket() (*packet.InitPacketType, error)
func MakeSimpleStaticWriterPipe ¶
returns (pr, err)
func MakeWaveshellSingleCmd ¶
func MaxFdNumInPacket ¶
func MaxFdNumInPacket(pk *packet.RunPacketType) int
func NextFreeFdNum ¶
func NextFreeFdNum(pk *packet.RunPacketType) (int, error)
func RunInstallFromCmd ¶
func RunInstallFromCmd(ctx context.Context, ecmd ConnInterface, tryDetect bool, waveshellStream io.Reader, waveshellReaderFn WaveshellBinaryReaderFn, msgFn func(string)) error
func SendRunPacketAndRunData ¶
func SendRunPacketAndRunData(ctx context.Context, sender *packet.PacketSender, runPacket *packet.RunPacketType) error
func SetupSignalsForDetach ¶
func SetupSignalsForDetach()
in detached run mode, we don't want waveshell to die from signals since we want waveshell to persist even if the waveshell --server is terminated
func ValidateRemoteFds ¶
func ValidateRunPacket ¶
func ValidateRunPacket(pk *packet.RunPacketType) error
Types ¶
type ClientOpts ¶
type ClientProc ¶
type ClientProc struct { Cmd ConnInterface InitPk *packet.InitPacketType StartTs time.Time StdinWriter io.WriteCloser StdoutReader io.ReadCloser StderrReader io.ReadCloser Input *packet.PacketSender Output *packet.PacketParser }
func MakeClientProc ¶
func MakeClientProc(ctx context.Context, ecmd ConnInterface) (*ClientProc, error)
returns (clientproc, initpk, error)
func (*ClientProc) Close ¶
func (cproc *ClientProc) Close()
func (*ClientProc) ProxySingleOutput ¶
func (cproc *ClientProc) ProxySingleOutput(ck base.CommandKey, sender *packet.PacketSender, packetCallback func(packet.PacketType))
type CmdWrap ¶
func (CmdWrap) Parser ¶
func (cw CmdWrap) Parser() (*packet.PacketParser, io.ReadCloser, io.ReadCloser, error)
func (CmdWrap) Sender ¶
func (cw CmdWrap) Sender() (*packet.PacketSender, io.WriteCloser, error)
func (CmdWrap) StderrPipe ¶
func (cw CmdWrap) StderrPipe() (io.ReadCloser, error)
func (CmdWrap) StdoutPipe ¶
func (cw CmdWrap) StdoutPipe() (io.ReadCloser, error)
type ConnInterface ¶
type ConnInterface interface { Kill() Wait() error Sender() (*packet.PacketSender, io.WriteCloser, error) Parser() (*packet.PacketParser, io.ReadCloser, io.ReadCloser, error) Start() error StdinPipe() (io.WriteCloser, error) StdoutPipe() (io.ReadCloser, error) StderrPipe() (io.ReadCloser, error) }
type FdContext ¶
type FdContext interface { GetWriter(fdNum int) io.WriteCloser GetReader(fdNum int) io.ReadCloser }
type InstallOpts ¶
type InvalidPacketError ¶
type InvalidPacketError struct {
InvalidPk *packet.PacketType
}
func (InvalidPacketError) Error ¶
func (ipe InvalidPacketError) Error() string
type ReturnStateBuf ¶
type ReturnStateBuf struct { Lock *sync.Mutex Buf []byte Done bool Err error Reader *os.File FdNum int EndBytes []byte DoneCh chan bool }
func MakeReturnStateBuf ¶
func MakeReturnStateBuf() *ReturnStateBuf
type SSHOpts ¶
type SessionWrap ¶
func (SessionWrap) Kill ¶
func (sw SessionWrap) Kill()
func (SessionWrap) Parser ¶
func (sw SessionWrap) Parser() (*packet.PacketParser, io.ReadCloser, io.ReadCloser, error)
func (SessionWrap) Sender ¶
func (sw SessionWrap) Sender() (*packet.PacketSender, io.WriteCloser, error)
func (SessionWrap) Start ¶
func (sw SessionWrap) Start() error
func (SessionWrap) StderrPipe ¶
func (sw SessionWrap) StderrPipe() (io.ReadCloser, error)
func (SessionWrap) StdinPipe ¶
func (sw SessionWrap) StdinPipe() (io.WriteCloser, error)
func (SessionWrap) StdoutPipe ¶
func (sw SessionWrap) StdoutPipe() (io.ReadCloser, error)
func (SessionWrap) Wait ¶
func (sw SessionWrap) Wait() error
type ShExecType ¶
type ShExecType struct { Lock *sync.Mutex // only locks "Exited" field StartTs time.Time CK base.CommandKey FileNames *base.CommandFileNames Cmd *exec.Cmd CmdPty *os.File MaxPtySize int64 Multiplexer *mpio.Multiplexer Detached bool DetachedOutput *packet.PacketSender RunnerOutFd *os.File MsgSender *packet.PacketSender // where to send out-of-band messages back to calling proceess ReturnState *ReturnStateBuf Exited bool // locked via Lock TmpRcFileName string // file *or* directory holding temporary rc file(s) SAPI shellapi.ShellApi ShellPrivKey *ecdh.PrivateKey SudoWriter *os.File }
func MakeShExec ¶
func MakeShExec(ck base.CommandKey, upr packet.UnknownPacketReporter, sapi shellapi.ShellApi) *ShExecType
func RunCommandSimple ¶
func RunCommandSimple(pk *packet.RunPacketType, sender *packet.PacketSender, fromServer bool) (rtnShExec *ShExecType, rtnErr error)
func (*ShExecType) Close ¶
func (c *ShExecType) Close()
func (*ShExecType) IsExited ¶
func (c *ShExecType) IsExited() bool
func (*ShExecType) MakeCmdStartPacket ¶
func (c *ShExecType) MakeCmdStartPacket(reqId string) *packet.CmdStartPacketType
func (*ShExecType) ProcWait ¶
func (c *ShExecType) ProcWait() error
func (*ShExecType) RunRemoteIOAndWait ¶
func (cmd *ShExecType) RunRemoteIOAndWait(packetParser *packet.PacketParser, sender *packet.PacketSender)
func (*ShExecType) SendSignal ¶
func (s *ShExecType) SendSignal(sig syscall.Signal)
func (*ShExecType) WaitForCommand ¶
func (c *ShExecType) WaitForCommand() *packet.CmdDonePacketType
called in waveshell --single mode (returns the real cmddone packet)
type ShExecUPR ¶
type ShExecUPR struct { ShExec *ShExecType UPR packet.UnknownPacketReporter }
func (ShExecUPR) UnknownPacket ¶
func (s ShExecUPR) UnknownPacket(pk packet.PacketType)
type StdContext ¶
type StdContext struct{}
func (StdContext) GetReader ¶
func (StdContext) GetReader(fdNum int) io.ReadCloser
func (StdContext) GetWriter ¶
func (StdContext) GetWriter(fdNum int) io.WriteCloser
type WaveshellBinaryReaderFn ¶
type WaveshellLaunchError ¶
type WaveshellLaunchError struct {
InitPk *packet.InitPacketType
}
func (WaveshellLaunchError) Error ¶
func (wle WaveshellLaunchError) Error() string
Click to show internal directories.
Click to hide internal directories.