manageapi

package
v0.0.0-...-97303f7 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 Core

type Core interface{}

Core interface contains functions to access the state Core data.

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 New

func New(logger *zap.Logger, core Core, dialer Dialer) *ManageAPI

New creates a new API.

func (*ManageAPI) ExecCommand

ExecCommand executes a command in the VM.

func (*ManageAPI) ExecCommandReturnStream

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

ReadFile reads a file and returns its content.

func (*ManageAPI) WriteFile

WriteFile creates a file and writes output to it.

type TerminalSize

type TerminalSize struct {
	Width  uint16
	Height uint16
}

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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