wingconnect

package
v0.149.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package wingconnect owns a wing's remembered SSH connection pool. Remote execution stays in the receiving wing; this pool only routes bounded calls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdmissionArguments

func AdmissionArguments(args json.RawMessage) (json.RawMessage, string, error)

Types

type Connection

type Connection interface {
	Call(context.Context, string, json.RawMessage) (map[string]any, bool, error)
	Done() <-chan struct{}
	Close() error
}

type Options

type Options struct {
	Dir, LocalWingID            string
	Hello                       controlsocket.Hello
	Transport                   sshcontrol.Transport
	ConnectTimeout, CallTimeout time.Duration
	// Deterministic fixture seams; production uses real timers and OpenSSH.
	Dial     func(context.Context, config.Remote, controlsocket.Hello) (Connection, error)
	NewTimer func(time.Duration) Timer
	Jitter   func(time.Duration) time.Duration
	OnChange func()
}

type Pool

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

func New

func New(ctx context.Context, opts Options) (*Pool, error)

func (*Pool) Call

func (p *Pool) Call(ctx context.Context, wingID, name string, args json.RawMessage) (map[string]any, bool, error)

func (*Pool) Close

func (p *Pool) Close() error

func (*Pool) Entries

func (p *Pool) Entries() ([]map[string]any, string)

func (*Pool) Reload

func (p *Pool) Reload() error

func (*Pool) Resolve

func (p *Pool) Resolve(name string) (string, error)

type Timer

type Timer interface {
	C() <-chan time.Time
	Stop()
}

type UnknownOutcome

type UnknownOutcome struct {
	WingID, Tool, Key string
	Err               error
}

UnknownOutcome means delivery may have succeeded. Only the original key may reconcile admission; the caller must not launch a replacement request.

func (*UnknownOutcome) Error

func (e *UnknownOutcome) Error() string

func (*UnknownOutcome) Unwrap

func (e *UnknownOutcome) Unwrap() error

Jump to

Keyboard shortcuts

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