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) 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) WriteFile(req WriteFileRequest) (WriteFileResult, error)
- type Empty
- type ExecRequest
- type ExecResult
- type FileChunk
- type ReadFileRequest
- type SessionInfo
- type SessionToken
- 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 RequestReadFile uint16 = 0x0620 RequestWriteFile uint16 = 0x0621 )
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) 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) 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 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.