dbg

package
v0.0.0-...-ba0b20d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

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

type AuthRequest struct {
	Username string
	Password string
}

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 NewClient

func NewClient(socketPath string) (*Client, error)

func NewHostClient

func NewHostClient(host string, port int) (*Client, error)

func NewTCPClient

func NewTCPClient(address string) (*Client, error)

func (*Client) Authenticate

func (c *Client) Authenticate(req AuthRequest) (SessionInfo, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Logout

func (c *Client) Logout(req SessionToken) (Empty, 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) Raw

func (c *Client) Raw() *sutra.Client

func (*Client) ReadFile

func (c *Client) ReadFile(req ReadFileRequest) (FileChunk, 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 (c *Client) SetTimeout(timeout time.Duration)

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 Empty

type Empty struct {
}

func (Empty) MarshalBinary

func (v Empty) MarshalBinary() []byte

func (*Empty) UnmarshalBinary

func (v *Empty) UnmarshalBinary(data []byte) error

type ExecRequest

type ExecRequest struct {
	Token      string
	Command    string
	Cwd        string
	TimeoutSec int32
}

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 FileChunk

type FileChunk struct {
	Data []byte
	Eof  bool
}

func (FileChunk) MarshalBinary

func (v FileChunk) MarshalBinary() []byte

func (*FileChunk) UnmarshalBinary

func (v *FileChunk) UnmarshalBinary(data []byte) error

type ReadFileRequest

type ReadFileRequest struct {
	Token  string
	Path   string
	Offset uint64
	Size   uint32
}

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

type ShellCloseRequest struct {
	Token     string
	SessionID uint32
}

func (ShellCloseRequest) MarshalBinary

func (v ShellCloseRequest) MarshalBinary() []byte

func (*ShellCloseRequest) UnmarshalBinary

func (v *ShellCloseRequest) UnmarshalBinary(data []byte) error

type ShellExitEvent

type ShellExitEvent struct {
	SessionID uint32
	ExitCode  int
}

func (ShellExitEvent) MarshalBinary

func (v ShellExitEvent) MarshalBinary() []byte

func (*ShellExitEvent) UnmarshalBinary

func (v *ShellExitEvent) UnmarshalBinary(data []byte) error

type ShellInputRequest

type ShellInputRequest struct {
	Token     string
	SessionID uint32
	Data      []byte
}

func (ShellInputRequest) MarshalBinary

func (v ShellInputRequest) MarshalBinary() []byte

func (*ShellInputRequest) UnmarshalBinary

func (v *ShellInputRequest) UnmarshalBinary(data []byte) error

type ShellOpenRequest

type ShellOpenRequest struct {
	Token string
	Cwd   string
	Rows  int
	Cols  int
}

func (ShellOpenRequest) MarshalBinary

func (v ShellOpenRequest) MarshalBinary() []byte

func (*ShellOpenRequest) UnmarshalBinary

func (v *ShellOpenRequest) UnmarshalBinary(data []byte) error

type ShellOutputEvent

type ShellOutputEvent struct {
	SessionID uint32
	Data      []byte
}

func (ShellOutputEvent) MarshalBinary

func (v ShellOutputEvent) MarshalBinary() []byte

func (*ShellOutputEvent) UnmarshalBinary

func (v *ShellOutputEvent) UnmarshalBinary(data []byte) error

type ShellResizeRequest

type ShellResizeRequest struct {
	Token     string
	SessionID uint32
	Rows      int
	Cols      int
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL