distro

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceName        = "dev.avyos.distro"
	ServiceID   uint32 = 112
)
View Source
const (
	RequestList        uint16 = 0x0201
	RequestPull        uint16 = 0x0202
	RequestRun         uint16 = 0x0203
	RequestRemove      uint16 = 0x0204
	RequestShellOpen   uint16 = 0x0205
	RequestShellInput  uint16 = 0x0206
	RequestShellResize uint16 = 0x0207
	RequestShellClose  uint16 = 0x0208
)
View Source
const (
	EventShellOutput uint16 = 0x0301
	EventShellExit   uint16 = 0x0302
)

Variables

This section is empty.

Functions

func DecodeCommand

func DecodeCommand(value string) []string

func EncodeCommand

func EncodeCommand(args []string) string

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func Connect

func Connect() (*Client, error)

func NewClient

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

func (*Client) Close

func (c *Client) Close() error

func (*Client) CloseShell

func (c *Client) CloseShell(sessionID uint32) error

func (*Client) List

func (c *Client) List(req ListRequest) (DistroList, error)

func (*Client) ListDistros

func (c *Client) ListDistros(available bool) ([]DistroInfo, error)

func (*Client) OnShellExit

func (c *Client) OnShellExit(fn func(sender uint32, ev ShellExitEvent))

func (*Client) OnShellExitEvent

func (c *Client) OnShellExitEvent(fn func(ShellExitEvent))

func (*Client) OnShellOutput

func (c *Client) OnShellOutput(fn func(sender uint32, ev ShellOutputEvent))

func (*Client) OnShellOutputEvent

func (c *Client) OnShellOutputEvent(fn func(ShellOutputEvent))

func (*Client) OpenShell

func (c *Client) OpenShell(req ShellOpenRequest) (uint32, error)

func (*Client) Pull

func (c *Client) Pull(req PullRequest) (Empty, error)

func (*Client) PullDistro

func (c *Client) PullDistro(name, url string) error

func (*Client) Raw

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

func (*Client) Remove

func (c *Client) Remove(req RemoveRequest) (Empty, error)

func (*Client) RemoveDistro

func (c *Client) RemoveDistro(name string) error

func (*Client) ResizeShell

func (c *Client) ResizeShell(sessionID uint32, rows, cols int) error

func (*Client) Run

func (c *Client) Run(req RunRequest) (RunResult, error)

func (*Client) RunDistro

func (c *Client) RunDistro(req RunRequest) (RunResult, error)

func (*Client) SendShellInput

func (c *Client) SendShellInput(sessionID uint32, data []byte) 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

type DistroInfo

type DistroInfo struct {
	Name    string
	URL     string
	Version string
	Path    string
	Size    int
}

func (DistroInfo) MarshalBinary

func (v DistroInfo) MarshalBinary() []byte

func (*DistroInfo) UnmarshalBinary

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

type DistroList

type DistroList struct {
	Items []DistroInfo
}

func (DistroList) MarshalBinary

func (v DistroList) MarshalBinary() []byte

func (*DistroList) UnmarshalBinary

func (v *DistroList) UnmarshalBinary(data []byte) 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 ListRequest

type ListRequest struct {
	Available bool
}

func (ListRequest) MarshalBinary

func (v ListRequest) MarshalBinary() []byte

func (*ListRequest) UnmarshalBinary

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

type PullRequest

type PullRequest struct {
	Name string
	URL  string
}

func (PullRequest) MarshalBinary

func (v PullRequest) MarshalBinary() []byte

func (*PullRequest) UnmarshalBinary

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

type RemoveRequest

type RemoveRequest struct {
	Name string
}

func (RemoveRequest) MarshalBinary

func (v RemoveRequest) MarshalBinary() []byte

func (*RemoveRequest) UnmarshalBinary

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

type RunRequest

type RunRequest struct {
	Distro  string
	Command string
	Workdir string
	Bind    string
	Env     string
	Input   []byte
}

func (RunRequest) MarshalBinary

func (v RunRequest) MarshalBinary() []byte

func (*RunRequest) UnmarshalBinary

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

type RunResult

type RunResult struct {
	Stdout   []byte
	Stderr   []byte
	ExitCode int
}

func (RunResult) MarshalBinary

func (v RunResult) MarshalBinary() []byte

func (*RunResult) UnmarshalBinary

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

type ShellCloseRequest

type ShellCloseRequest struct {
	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 {
	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 {
	Distro  string
	Workdir string
	Bind    string
	Env     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 {
	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

Jump to

Keyboard shortcuts

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