native

package
v1.235.0-nightly.44844... Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 26 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 Start

func Start(ctx context.Context, executable string, opts ...Option) (*Handle, error)

Start launches a plugin with gRPC-only transport and ephemeral mutual TLS.

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 WithAPI

func WithAPI(server *bridge.Server) Option

WithAPI provides the invocation-scoped Atmos API server.

func WithCallTimeout

func WithCallTimeout(timeout time.Duration) Option

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

func WithDirectory(directory string) Option

WithDirectory sets the plugin process working directory.

func WithEnvironment

func WithEnvironment(environment []string) Option

WithEnvironment supplies explicitly approved process environment entries.

Jump to

Keyboard shortcuts

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