Documentation
¶
Index ¶
- Constants
- func DecodeCommand(value string) []string
- func EncodeCommand(args []string) string
- type Client
- func (c *Client) Close() error
- func (c *Client) CloseShell(sessionID uint32) error
- func (c *Client) List(req ListRequest) (DistroList, error)
- func (c *Client) ListDistros(available bool) ([]DistroInfo, error)
- func (c *Client) OnShellExit(fn func(sender uint32, ev ShellExitEvent))
- func (c *Client) OnShellExitEvent(fn func(ShellExitEvent))
- func (c *Client) OnShellOutput(fn func(sender uint32, ev ShellOutputEvent))
- func (c *Client) OnShellOutputEvent(fn func(ShellOutputEvent))
- func (c *Client) OpenShell(req ShellOpenRequest) (uint32, error)
- func (c *Client) Pull(req PullRequest) (Empty, error)
- func (c *Client) PullDistro(name, url string) error
- func (c *Client) Raw() *sutra.Client
- func (c *Client) Remove(req RemoveRequest) (Empty, error)
- func (c *Client) RemoveDistro(name string) error
- func (c *Client) ResizeShell(sessionID uint32, rows, cols int) error
- func (c *Client) Run(req RunRequest) (RunResult, error)
- func (c *Client) RunDistro(req RunRequest) (RunResult, error)
- func (c *Client) SendShellInput(sessionID uint32, data []byte) error
- func (c *Client) SetTimeout(timeout time.Duration)
- func (c *Client) ShellClose(req ShellCloseRequest) error
- func (c *Client) ShellInput(req ShellInputRequest) error
- func (c *Client) ShellOpen(req ShellOpenRequest) (ShellSession, error)
- func (c *Client) ShellResize(req ShellResizeRequest) error
- type DistroInfo
- type DistroList
- type Empty
- type ListRequest
- type PullRequest
- type RemoveRequest
- type RunRequest
- type RunResult
- type ShellCloseRequest
- type ShellExitEvent
- type ShellInputRequest
- type ShellOpenRequest
- type ShellOutputEvent
- type ShellResizeRequest
- type ShellSession
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 EncodeCommand ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CloseShell ¶
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) PullDistro ¶
func (*Client) RemoveDistro ¶
func (*Client) SendShellInput ¶
func (*Client) SetTimeout ¶
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 ¶
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 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 ¶
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 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 ¶
func (ShellExitEvent) MarshalBinary ¶
func (v ShellExitEvent) MarshalBinary() []byte
func (*ShellExitEvent) UnmarshalBinary ¶
func (v *ShellExitEvent) UnmarshalBinary(data []byte) error
type ShellInputRequest ¶
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 ¶
func (ShellOutputEvent) MarshalBinary ¶
func (v ShellOutputEvent) MarshalBinary() []byte
func (*ShellOutputEvent) UnmarshalBinary ¶
func (v *ShellOutputEvent) UnmarshalBinary(data []byte) error
type ShellResizeRequest ¶
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
Click to show internal directories.
Click to hide internal directories.