Documentation
¶
Overview ¶
Package native runs native plugins over mutually authenticated go-plugin gRPC.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDescription ¶
func CheckDescription(expected, actual *pluginv1.DescribeResponse) error
CheckDescription rejects binaries that disagree with their installed manifest.
Types ¶
type Handle ¶
type Handle struct {
Info pluginv1.InfoClient
Provider pluginv1.AuthProviderClient
Identity pluginv1.AuthIdentityClient
Commands pluginv1.CommandsClient
// contains filtered or unexported fields
}
Handle owns a native process and its versioned service clients.
func (*Handle) Close ¶
func (h *Handle) Close()
Close terminates the process, its process group, the broker, and active callback streams.
func (*Handle) Command ¶
func (h *Handle) Command(ctx context.Context, request *pluginv1.CommandRequest, stdout, stderr io.Writer) error
Command runs an export and validates its terminal event before accepting its exit status. Writers must come from Atmos's masked I/O layer when attached to a terminal.
func (*Handle) Invoke ¶
func (h *Handle) Invoke(ctx context.Context, scope bridge.Invocation, run func(context.Context, *pluginv1.Invocation) error) error
Invoke grants API access for one operation and drains callbacks before returning. The operation is cancelled by its caller, by SIGINT or SIGTERM, or by the call timeout; in every case the plugin process is stopped rather than left running.
type Option ¶
type Option func(*options)
Option configures the native process without inheriting the CLI's secrets.
func WithCallTimeout ¶
WithCallTimeout bounds every invocation made through the handle. The deadline is sent to the plugin, and the plugin process is stopped when it passes. Zero or negative disables it.
func WithDescription ¶
func WithDescription(expected *pluginv1.DescribeResponse) Option
WithDescription binds the process handshake to statically verified metadata.
func WithDirectory ¶
WithDirectory sets the plugin process working directory.
func WithEnvironment ¶
WithEnvironment supplies explicitly approved process environment entries.