Documentation
¶
Index ¶
Constants ¶
View Source
const (
PluginID = "command"
)
Variables ¶
View Source
var ( // ErrHandlerNotFound is returned when a handler is not found. ErrHandlerNotFound = errors.New("handler not found") // ErrHandlerTimeout is returned when a handler times out. ErrHandlerTimeout = errors.New("handler timeout") )
Functions ¶
func RegisterPlugin ¶
func RegisterPlugin( p *sdk.Plugin, opts PluginOpts, ) error
Types ¶
type Handler ¶
type Handler func(ctx *types.PluginContext, body []byte) ([]byte, error)
Handler is a function that processes a command called from the frontend. It is expected to return the response body as a byte slice.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages the lifecycle of the terminal sessions.
func NewManager ¶
NewManager initializes a new Manager instance.
type Plugin ¶
func (*Plugin) GRPCClient ¶
func (p *Plugin) GRPCClient( _ context.Context, _ *plugin.GRPCBroker, c *grpc.ClientConn, ) (interface{}, error)
func (*Plugin) GRPCServer ¶
type PluginClient ¶
type PluginClient struct {
// contains filtered or unexported fields
}
func (*PluginClient) Call ¶
func (p *PluginClient) Call( ctx *types.PluginContext, path string, body []byte, ) ([]byte, error)
type PluginOpts ¶
PluginOpts contains the options for the command plugin.
type PluginServer ¶
type PluginServer struct {
Impl Provider
}
func (*PluginServer) Call ¶
func (s *PluginServer) Call( ctx context.Context, req *commandpb.CallCommandRequest, ) (*commandpb.CallCommandResponse, error)
type Provider ¶
type Provider interface {
ProviderImpl
}
Provider is the interface satisfied by the plugin server and client to provide the general functionality.
type ProviderImpl ¶
Click to show internal directories.
Click to hide internal directories.