exec

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdapterV1 added in v0.2.0

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

AdapterV1 wraps SDK v1 exec.Provider as the engine canonical ExecProvider. For v1, all methods are direct delegation (types identical). When v2 ships and canonical types diverge, AdapterV1 translates v1 → canonical.

func NewAdapterV1 added in v0.2.0

func NewAdapterV1(inner exec.Provider) *AdapterV1

NewAdapterV1 creates a new v1 adapter wrapping the given SDK exec provider.

func (*AdapterV1) AttachSession added in v0.2.0

func (a *AdapterV1) AttachSession(ctx *types.PluginContext, sessionID string) (*exec.Session, []byte, error)

func (*AdapterV1) Close added in v0.2.0

func (a *AdapterV1) Close()

func (*AdapterV1) CloseSession added in v0.2.0

func (a *AdapterV1) CloseSession(ctx *types.PluginContext, sessionID string) error

func (*AdapterV1) CreateSession added in v0.2.0

func (a *AdapterV1) CreateSession(ctx *types.PluginContext, opts exec.SessionOptions) (*exec.Session, error)

func (*AdapterV1) DetachSession added in v0.2.0

func (a *AdapterV1) DetachSession(ctx *types.PluginContext, sessionID string) (*exec.Session, error)

func (*AdapterV1) GetSession added in v0.2.0

func (a *AdapterV1) GetSession(ctx *types.PluginContext, sessionID string) (*exec.Session, error)

func (*AdapterV1) GetSupportedResources added in v0.2.0

func (a *AdapterV1) GetSupportedResources(ctx *types.PluginContext) []exec.Handler

func (*AdapterV1) ListSessions added in v0.2.0

func (a *AdapterV1) ListSessions(ctx *types.PluginContext) ([]*exec.Session, error)

func (*AdapterV1) ResizeSession added in v0.2.0

func (a *AdapterV1) ResizeSession(ctx *types.PluginContext, sessionID string, cols, rows int32) error

func (*AdapterV1) Stream added in v0.2.0

func (a *AdapterV1) Stream(ctx context.Context, in chan exec.StreamInput) (chan exec.StreamOutput, error)

type AttachSessionResult

type AttachSessionResult struct {
	Session *sdkexec.Session `json:"session"`
	Buffer  string           `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.Service,
) Controller

type CreateTerminalOptions

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

type ExecProvider added in v0.2.0

type ExecProvider interface {
	GetSupportedResources(ctx *types.PluginContext) []exec.Handler
	GetSession(ctx *types.PluginContext, sessionID string) (*exec.Session, error)
	ListSessions(ctx *types.PluginContext) ([]*exec.Session, error)
	CreateSession(ctx *types.PluginContext, opts exec.SessionOptions) (*exec.Session, error)
	AttachSession(ctx *types.PluginContext, sessionID string) (*exec.Session, []byte, error)
	DetachSession(ctx *types.PluginContext, sessionID string) (*exec.Session, error)
	CloseSession(ctx *types.PluginContext, sessionID string) error
	ResizeSession(ctx *types.PluginContext, sessionID string, cols, rows int32) error
	Stream(ctx context.Context, in chan exec.StreamInput) (chan exec.StreamOutput, error)
	Close()
}

ExecProvider is the engine's version-independent interface for exec plugins. For v1, method signatures match SDK exec.Provider exactly (doc 20 §13.7). When v2 redesigns exec (context.Context, interfaces), this diverges.

Jump to

Keyboard shortcuts

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