distro

package
v0.0.0-...-155abb7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ServiceName        = "dev.avyos.distro"
	ServiceID   uint32 = 112
)
View Source
const (
	RequestStatus      uint16 = 0x0201
	RequestInstall     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) GetStatus

func (c *Client) GetStatus() (StatusResponse, error)

func (*Client) Install

func (c *Client) Install(req InstallRequest) (Empty, error)

func (*Client) InstallDistro

func (c *Client) InstallDistro(url string) 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) Raw

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

func (*Client) Remove

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

func (*Client) Status

func (c *Client) Status(req Empty) (StatusResponse, error)

func (*Client) Uninstall

func (c *Client) Uninstall() 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 InstallRequest

type InstallRequest struct {
	URL string
}

func (InstallRequest) MarshalBinary

func (v InstallRequest) MarshalBinary() []byte

func (*InstallRequest) UnmarshalBinary

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

type RunRequest

type RunRequest struct {
	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 {
	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

type StatusResponse

type StatusResponse struct {
	Installed bool
	Path      string
	Size      int
}

func (StatusResponse) MarshalBinary

func (v StatusResponse) MarshalBinary() []byte

func (*StatusResponse) UnmarshalBinary

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

Jump to

Keyboard shortcuts

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