targetkit

package
v0.2026209.2002 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package targetkit provides transport-neutral gRPC connections to Charly targets. SSH is only a process transport: gRPC still owns the protocol, and the target chain carried by CUE-generated spec.TargetSpec owns nested routing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialProcessProvider

func DialProcessProvider(ctx context.Context, process spec.Process, opts DialOptions) (*grpc.ClientConn, pb.ProviderClient, error)

DialProcessProvider opens gRPC over a process supplied by a deployment executor. This is the placement-neutral sibling of DialProvider: the same protocol runs over local exec, SSH, containers, VMs, and recursively nested venues without teaching the gRPC layer about any of them.

func DialProvider

func DialProvider(ctx context.Context, target spec.TargetSpec, opts DialOptions) (*grpc.ClientConn, pb.ProviderClient, error)

DialProvider opens gRPC over a local-exec or SSH stdio process. The SSH remote argv is fixed to `charly __agent-target serve --stdio`; nested target hops are carried as TargetSpec on the first Provider.Channel frame and are resolved by the responsible Charly node.

func ServeStdio

func ServeStdio(stdin io.ReadCloser, stdout io.WriteCloser, register func(*grpc.Server), opts ...grpc.ServerOption) error

ServeStdio runs a gRPC server on one full-duplex stdio connection. stdout is exclusively HTTP/2 protocol data; diagnostics belong on stderr.

func StdioCommand

func StdioCommand(target spec.TargetSpec, opts DialOptions) ([]string, error)

StdioCommand validates the generic route and returns an argv with no shell interpolation. Hops after the first grpc marker—including tmux, another SSH node, or an exec/container hop—are nested routing data, not special cases.

func StdioFiles

func StdioFiles() (io.ReadCloser, io.WriteCloser)

StdioFiles is the production adapter used by the hidden target command.

Types

type DialOptions

type DialOptions struct {
	CharlyBinary       string
	RemoteCharlyBinary string
	SSHBinary          string
	Stderr             io.Writer
	ExtraGRPC          []grpc.DialOption
	Command            func(context.Context, string, ...string) *exec.Cmd
}

DialOptions controls process launch only. It deliberately has no runtime- or tmux-specific fields; those remain in the CUE payload sent over Provider.Channel.

Jump to

Keyboard shortcuts

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