stream

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(baseCtx context.Context, s Stream, w worker.Worker, srcPrefix []string, logger *zap.Logger) error

Start initiate a interactive execution on the worker and transmit the request and response over Stream transport layer

Types

type InputRequest

type InputRequest struct {
	Index   int
	Fd      int
	Content []byte
}

InputRequest defines input operation from the remote

type OutputResponse

type OutputResponse struct {
	Index   int
	Fd      int
	Content []byte
}

OutputResponse defines output result to the remote

type Request

type Request struct {
	Request *model.Request
	Resize  *ResizeRequest
	Input   *InputRequest
	Cancel  *struct{}
}

Request defines operations receive from the remote

type ResizeRequest

type ResizeRequest struct {
	Index int `json:"index,omitempty"`
	Fd    int `json:"fd,omitempty"`
	Rows  int `json:"rows,omitempty"`
	Cols  int `json:"cols,omitempty"`
	X     int `json:"x,omitempty"`
	Y     int `json:"y,omitempty"`
}

ResizeRequest defines resize operation to the virtual terminal

type Response

type Response struct {
	Response *model.Response
	Output   *OutputResponse
}

Response defines response to the remote

type Stream

type Stream interface {
	Send(Response) error
	Recv() (*Request, error)
}

Stream defines the transport layer for the stream execution that stream input and output interactively

Jump to

Keyboard shortcuts

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