exec

package
v0.0.0-...-3f5d8b5 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachSessionResult

type AttachSessionResult struct {
	Session *sdkexec.Session `json:"session"`
	Buffer  []byte           `json:"buffer"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(controller Controller) *Client

func (*Client) AttachSession

func (c *Client) AttachSession(sessionID string) (AttachSessionResult, error)

func (*Client) CloseSession

func (c *Client) CloseSession(sessionID string) error

func (*Client) CreateSession

func (c *Client) CreateSession(
	plugin, connection string,
	opts sdkexec.SessionOptions,
) (*sdkexec.Session, error)

func (*Client) CreateTerminal

func (c *Client) CreateTerminal(opts CreateTerminalOptions) (*sdkexec.Session, error)

func (*Client) DetachSession

func (c *Client) DetachSession(sessionID string) (*sdkexec.Session, error)

func (*Client) GetHandler

func (c *Client) GetHandler(plugin, resource string) *sdkexec.Handler

func (*Client) GetHandlers

func (c *Client) GetHandlers() map[string]map[string]sdkexec.Handler

func (*Client) GetPluginHandlers

func (c *Client) GetPluginHandlers(plugin string) map[string]sdkexec.Handler

func (*Client) GetSession

func (c *Client) GetSession(sessionID string) (*sdkexec.Session, error)

func (*Client) ListPlugins

func (c *Client) ListPlugins() ([]string, error)

func (*Client) ListSessions

func (c *Client) ListSessions() ([]*sdkexec.Session, error)

func (*Client) ResizeSession

func (c *Client) ResizeSession(sessionID string, rows, cols uint16) error

func (*Client) WriteSession

func (c *Client) WriteSession(sessionID string, input string) error

type Controller

type Controller interface {
	internaltypes.Controller
	Run(ctx context.Context)
	GetPluginHandlers(plugin string) map[string]exec.Handler
	GetHandlers() map[string]map[string]exec.Handler
	GetHandler(plugin, resource string) *exec.Handler
	CreateSession(plugin, connectionID string, opts exec.SessionOptions) (*exec.Session, error)
	ListSessions() ([]*exec.Session, error)
	GetSession(sessionID string) (*exec.Session, error)
	AttachSession(sessionID string) (*exec.Session, []byte, error)
	DetachSession(sessionID string) (*exec.Session, error)
	WriteSession(sessionID string, data []byte) error
	CloseSession(sessionID string) error
	ResizeSession(sessionID string, rows, cols uint16) error
}

func NewController

func NewController(
	logger *zap.SugaredLogger,
	sp pkgsettings.Provider,
	resourceClient resource.IClient,
) Controller

type CreateTerminalOptions

type CreateTerminalOptions struct {
	Labels  map[string]string `json:"labels"`
	Command []string          `json:"command"`
}

Jump to

Keyboard shortcuts

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