Documentation ¶
Index ¶
- Variables
- type Core
- type Dialer
- type ManageAPI
- func (a *ManageAPI) ExecCommand(_ context.Context, in *manageproto.ExecCommandRequest) (*manageproto.ExecCommandResponse, error)
- func (a *ManageAPI) ExecCommandReturnStream(in *manageproto.ExecCommandRequest, ...) error
- func (a *ManageAPI) ExecCommandStream(srv manageproto.API_ExecCommandStreamServer) error
- func (a *ManageAPI) ReadFile(_ context.Context, in *manageproto.ReadFileRequest) (*manageproto.ReadFileResponse, error)
- func (a *ManageAPI) WriteFile(_ context.Context, in *manageproto.WriteFileRequest) (*manageproto.WriteFileResponse, error)
- type TerminalSize
- type TerminalSizeHandler
Constants ¶
This section is empty.
Variables ¶
var ( // ErrQueueFull is returned when the queue is full. ErrQueueFull = errors.New("winsize: queue is full") // ErrQueueClosed is returned when a channel is full. ErrQueueClosed = errors.New("chan is closed, cannot append data") )
Functions ¶
This section is empty.
Types ¶
type Dialer ¶
type Dialer interface {
DialContext(ctx context.Context, network, address string) (net.Conn, error)
}
Dialer is the dial interface. Necessary to stub network connections for local testing with bufconns.
type ManageAPI ¶
type ManageAPI struct { manageproto.UnimplementedAPIServer // contains filtered or unexported fields }
ManageAPI is the ManageAPI.
func (*ManageAPI) ExecCommand ¶
func (a *ManageAPI) ExecCommand(_ context.Context, in *manageproto.ExecCommandRequest) (*manageproto.ExecCommandResponse, error)
ExecCommand executes a command in the VM.
func (*ManageAPI) ExecCommandReturnStream ¶
func (a *ManageAPI) ExecCommandReturnStream(in *manageproto.ExecCommandRequest, srv manageproto.API_ExecCommandReturnStreamServer) error
ExecCommandReturnStream executes a command in the VM and streams the output to the caller. This is useful if the command needs much time to run and we want to log the current state, i.e. kubeadm.
func (*ManageAPI) ExecCommandStream ¶
func (a *ManageAPI) ExecCommandStream(srv manageproto.API_ExecCommandStreamServer) error
ExecCommandStream executes a command in the VM and streams the output to the caller. This is useful if the command needs much time to run and we want to log the current state, i.e. kubeadm.
func (*ManageAPI) ReadFile ¶
func (a *ManageAPI) ReadFile(_ context.Context, in *manageproto.ReadFileRequest) (*manageproto.ReadFileResponse, error)
ReadFile reads a file and returns its content.
func (*ManageAPI) WriteFile ¶
func (a *ManageAPI) WriteFile(_ context.Context, in *manageproto.WriteFileRequest) (*manageproto.WriteFileResponse, error)
WriteFile creates a file and writes output to it.
type TerminalSize ¶
TerminalSize is the struct holding the size data.
type TerminalSizeHandler ¶
type TerminalSizeHandler struct {
// contains filtered or unexported fields
}
TerminalSizeHandler stores the Height and Width of a terminal.
func NewTerminalSizeHandler ¶
func NewTerminalSizeHandler(cap int) *TerminalSizeHandler
NewTerminalSizeHandler creates a new Winsize.
func (*TerminalSizeHandler) Close ¶
func (w *TerminalSizeHandler) Close()
Close closes the winsize queue and chan.
func (*TerminalSizeHandler) Fill ¶
func (w *TerminalSizeHandler) Fill(data *TerminalSize) error
Fill appends the data to the queue.
func (*TerminalSizeHandler) Next ¶
func (w *TerminalSizeHandler) Next() *TerminalSize
Next returns the size. The chanel must be served. Otherwise the connection will hang.