dbg

package
v0.0.0-...-143e6d5 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 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
	RequestReadFile     uint16 = 0x0620
	RequestWriteFile    uint16 = 0x0621
)
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) 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) 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 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