Documentation
¶
Index ¶
- Constants
- type AuthRequest
- type Client
- func (c *Client) Authenticate(req AuthRequest) (SessionInfo, error)
- func (c *Client) Close() error
- func (c *Client) Logout(req SessionToken) (Empty, error)
- func (c *Client) OnShellExit(fn func(sender uint32, ev ShellExitEvent))
- func (c *Client) OnShellOutput(fn func(sender uint32, ev ShellOutputEvent))
- func (c *Client) Raw() *sutra.Client
- func (c *Client) ReadFile(req ReadFileRequest) (FileChunk, error)
- func (c *Client) RunCommand(req ExecRequest) (ExecResult, error)
- func (c *Client) RunShell(req ExecRequest) (ExecResult, error)
- func (c *Client) SetTimeout(timeout time.Duration)
- func (c *Client) ShellClose(req ShellCloseRequest) error
- func (c *Client) ShellInput(req ShellInputRequest) error
- func (c *Client) ShellOpen(req ShellOpenRequest) (ShellSession, error)
- func (c *Client) ShellResize(req ShellResizeRequest) error
- func (c *Client) WriteFile(req WriteFileRequest) (WriteFileResult, error)
- type Empty
- type ExecRequest
- type ExecResult
- type FileChunk
- type ReadFileRequest
- type SessionInfo
- type SessionToken
- type ShellCloseRequest
- type ShellExitEvent
- type ShellInputRequest
- type ShellOpenRequest
- type ShellOutputEvent
- type ShellResizeRequest
- type ShellSession
- type WriteFileRequest
- type WriteFileResult
Constants ¶
View Source
const ( ServiceName = "dev.avyos.dbg" ServiceID uint32 = 96 )
View Source
const ( RequestAuthenticate uint16 = 0x0601 RequestLogout uint16 = 0x0602 RequestRunCommand uint16 = 0x0610 RequestRunShell uint16 = 0x0611 RequestShellOpen uint16 = 0x0612 RequestShellInput uint16 = 0x0613 RequestShellResize uint16 = 0x0614 RequestShellClose uint16 = 0x0615 RequestReadFile uint16 = 0x0620 RequestWriteFile uint16 = 0x0621 )
View Source
const ( EventShellOutput uint16 = 0x0630 EventShellExit uint16 = 0x0631 )
View Source
const DefaultTCPPort = 5037
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthRequest ¶
func (AuthRequest) MarshalBinary ¶
func (v AuthRequest) MarshalBinary() []byte
func (*AuthRequest) UnmarshalBinary ¶
func (v *AuthRequest) UnmarshalBinary(data []byte) error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewTCPClient ¶
func (*Client) Authenticate ¶
func (c *Client) Authenticate(req AuthRequest) (SessionInfo, error)
func (*Client) OnShellExit ¶
func (c *Client) OnShellExit(fn func(sender uint32, ev ShellExitEvent))
func (*Client) OnShellOutput ¶
func (c *Client) OnShellOutput(fn func(sender uint32, ev ShellOutputEvent))
func (*Client) RunCommand ¶
func (c *Client) RunCommand(req ExecRequest) (ExecResult, error)
func (*Client) RunShell ¶
func (c *Client) RunShell(req ExecRequest) (ExecResult, error)
func (*Client) SetTimeout ¶
func (*Client) ShellClose ¶
func (c *Client) ShellClose(req ShellCloseRequest) error
func (*Client) ShellInput ¶
func (c *Client) ShellInput(req ShellInputRequest) error
func (*Client) ShellOpen ¶
func (c *Client) ShellOpen(req ShellOpenRequest) (ShellSession, error)
func (*Client) ShellResize ¶
func (c *Client) ShellResize(req ShellResizeRequest) error
func (*Client) WriteFile ¶
func (c *Client) WriteFile(req WriteFileRequest) (WriteFileResult, error)
type ExecRequest ¶
func (ExecRequest) MarshalBinary ¶
func (v ExecRequest) MarshalBinary() []byte
func (*ExecRequest) UnmarshalBinary ¶
func (v *ExecRequest) UnmarshalBinary(data []byte) error
type ExecResult ¶
type ExecResult struct {
ExitCode int
Stdout []byte
Stderr []byte
StdoutTruncated bool
StderrTruncated bool
}
func (ExecResult) MarshalBinary ¶
func (v ExecResult) MarshalBinary() []byte
func (*ExecResult) UnmarshalBinary ¶
func (v *ExecResult) UnmarshalBinary(data []byte) error
type ReadFileRequest ¶
func (ReadFileRequest) MarshalBinary ¶
func (v ReadFileRequest) MarshalBinary() []byte
func (*ReadFileRequest) UnmarshalBinary ¶
func (v *ReadFileRequest) UnmarshalBinary(data []byte) error
type SessionInfo ¶
type SessionInfo struct {
Token string
Username string
UID uint32
GID uint32
Home string
Shell string
}
func (SessionInfo) MarshalBinary ¶
func (v SessionInfo) MarshalBinary() []byte
func (*SessionInfo) UnmarshalBinary ¶
func (v *SessionInfo) UnmarshalBinary(data []byte) error
type SessionToken ¶
type SessionToken struct {
Token string
}
func (SessionToken) MarshalBinary ¶
func (v SessionToken) MarshalBinary() []byte
func (*SessionToken) UnmarshalBinary ¶
func (v *SessionToken) UnmarshalBinary(data []byte) error
type ShellCloseRequest ¶
func (ShellCloseRequest) MarshalBinary ¶
func (v ShellCloseRequest) MarshalBinary() []byte
func (*ShellCloseRequest) UnmarshalBinary ¶
func (v *ShellCloseRequest) UnmarshalBinary(data []byte) error
type ShellExitEvent ¶
func (ShellExitEvent) MarshalBinary ¶
func (v ShellExitEvent) MarshalBinary() []byte
func (*ShellExitEvent) UnmarshalBinary ¶
func (v *ShellExitEvent) UnmarshalBinary(data []byte) error
type ShellInputRequest ¶
func (ShellInputRequest) MarshalBinary ¶
func (v ShellInputRequest) MarshalBinary() []byte
func (*ShellInputRequest) UnmarshalBinary ¶
func (v *ShellInputRequest) UnmarshalBinary(data []byte) error
type ShellOpenRequest ¶
func (ShellOpenRequest) MarshalBinary ¶
func (v ShellOpenRequest) MarshalBinary() []byte
func (*ShellOpenRequest) UnmarshalBinary ¶
func (v *ShellOpenRequest) UnmarshalBinary(data []byte) error
type ShellOutputEvent ¶
func (ShellOutputEvent) MarshalBinary ¶
func (v ShellOutputEvent) MarshalBinary() []byte
func (*ShellOutputEvent) UnmarshalBinary ¶
func (v *ShellOutputEvent) UnmarshalBinary(data []byte) error
type ShellResizeRequest ¶
func (ShellResizeRequest) MarshalBinary ¶
func (v ShellResizeRequest) MarshalBinary() []byte
func (*ShellResizeRequest) UnmarshalBinary ¶
func (v *ShellResizeRequest) UnmarshalBinary(data []byte) error
type ShellSession ¶
type ShellSession struct {
SessionID uint32
}
func (ShellSession) MarshalBinary ¶
func (v ShellSession) MarshalBinary() []byte
func (*ShellSession) UnmarshalBinary ¶
func (v *ShellSession) UnmarshalBinary(data []byte) error
type WriteFileRequest ¶
type WriteFileRequest struct {
Token string
Path string
Offset uint64
Data []byte
Truncate bool
Mode uint32
}
func (WriteFileRequest) MarshalBinary ¶
func (v WriteFileRequest) MarshalBinary() []byte
func (*WriteFileRequest) UnmarshalBinary ¶
func (v *WriteFileRequest) UnmarshalBinary(data []byte) error
type WriteFileResult ¶
type WriteFileResult struct {
Written uint32
}
func (WriteFileResult) MarshalBinary ¶
func (v WriteFileResult) MarshalBinary() []byte
func (*WriteFileResult) UnmarshalBinary ¶
func (v *WriteFileResult) UnmarshalBinary(data []byte) error
Click to show internal directories.
Click to hide internal directories.