Documentation
¶
Overview ¶
Package client implements the orchestrator's CLI/MCP component, routing calls through a local node API or a standalone authenticated client session. Standalone clients are not enrolled fleet machines and cannot execute work.
Index ¶
- func RunTunnelService(ctx context.Context, dir string) error
- type Admin
- func (c Admin) AuthRole(ctx context.Context) (string, error)
- func (c Admin) InspectMachineState(ctx context.Context, id *identity.Identity) (model.MachineState, bool, error)
- func (c Admin) Invitation(ctx context.Context, id string) (enrollment.Invitation, error)
- func (c Admin) Invite(ctx context.Context, q enrollment.Request) (enrollment.Link, error)
- func (c Admin) IsSuperuser(ctx context.Context) bool
- func (c Admin) JSON(ctx context.Context, method, path string, params, result any) error
- func (c Admin) ManageMachine(ctx context.Context, id, action string) error
- func (c Admin) Push(ctx context.Context, dir string) (update.Deployment, error)
- func (c Admin) RenameMachine(ctx context.Context, id, name string) error
- func (c Admin) ResolveMachine(ctx context.Context, name string) (model.Node, error)
- func (c Admin) Role(ctx context.Context) string
- type Client
- func (c Client) Activities(ctx context.Context, query model.PoolActivityQuery) (model.PoolActivitySnapshot, error)
- func (c Client) Call(ctx context.Context, target, method string, params any, result any) error
- func (c Client) Close() error
- func (c Client) Dashboard(ctx context.Context, gateway Admin, query model.PoolActivityQuery) (model.PoolActivitySnapshot, error)
- func (c Client) DisposePersistentTunnel(ctx context.Context, id string) error
- func (c Client) Download(ctx context.Context, a model.Artifact, offset int64, w io.Writer) error
- func (c Client) FollowLogs(ctx context.Context, target, id string, offset int64, dest io.Writer) error
- func (c Client) Forwards() []ForwardInfo
- func (c Client) MCPServer() *mcp.Server
- func (c Client) PasteClipboard(ctx context.Context, spec ClipboardSpec) (clipboard.Result, error)
- func (c Client) PersistentTunnels(ctx context.Context) ([]PersistentTunnelInfo, error)
- func (c Client) Session(ctx context.Context) (SessionInfo, error)
- func (c Client) StartForward(ctx context.Context, spec ForwardSpec) (*Forward, error)
- func (c Client) StartPersistentTunnel(ctx context.Context, spec PersistentTunnelSpec) (PersistentTunnelInfo, error)
- func (c Client) StopForward(id string) error
- func (c Client) TestConnection(ctx context.Context, spec ConnectionTestSpec) (model.ConnectionTestResult, error)
- func (c Client) Tunnel(ctx context.Context, target, address string) (net.Conn, error)
- func (c Client) Wait(ctx context.Context, target, id string) (model.Task, error)
- func (c Client) WithLifetime(ctx context.Context) Client
- func (c Client) WithPersistentTunnels(root string, launch func(context.Context, string) error) Client
- func (c Client) WithStandalone(ctx context.Context, cfg StandaloneConfig) Client
- type ClipboardSpec
- type ConnectionTestSpec
- type Forward
- type ForwardInfo
- type ForwardSpec
- type PersistentTunnelInfo
- type PersistentTunnelSpec
- type SessionInfo
- type StandaloneConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Admin ¶
type Admin struct{ URL, Key string }
func (Admin) AuthRole ¶
AuthRole preserves authentication and connection errors for explicit commands. Role is used by help, where unavailable credentials simply hide management.
func (Admin) InspectMachineState ¶
func (c Admin) InspectMachineState(ctx context.Context, id *identity.Identity) (model.MachineState, bool, error)
InspectMachineState reads identity policy without acknowledging it or advertising lifecycle support on behalf of a running node.
func (Admin) Invitation ¶
func (c Admin) Invitation(ctx context.Context, id string) (enrollment.Invitation, error)
Invitation reads the authenticated fleet's registry, including redeemed invitations whose public installation URLs are no longer available.
func (Admin) Invite ¶
func (c Admin) Invite(ctx context.Context, q enrollment.Request) (enrollment.Link, error)
func (Admin) ManageMachine ¶
func (Admin) RenameMachine ¶
func (Admin) ResolveMachine ¶
type Client ¶
Client submits and observes work on nodes without defining a fixed machine role.
func (Client) Activities ¶
func (c Client) Activities(ctx context.Context, query model.PoolActivityQuery) (model.PoolActivitySnapshot, error)
func (Client) Dashboard ¶
func (c Client) Dashboard(ctx context.Context, gateway Admin, query model.PoolActivityQuery) (model.PoolActivitySnapshot, error)
Dashboard observes the gateway directly. Peer activity is optional enrichment; an unavailable execution backend does not hide a reachable gateway or directory.
func (Client) DisposePersistentTunnel ¶
func (Client) FollowLogs ¶
func (c Client) FollowLogs(ctx context.Context, target, id string, offset int64, dest io.Writer) error
FollowLogs resumes from a byte offset and ends at task completion or caller cancellation. Cancelling a log follower never cancels the durable task.
func (Client) Forwards ¶
func (c Client) Forwards() []ForwardInfo
func (Client) PasteClipboard ¶
PasteClipboard copies text to the destination clipboard or streams copied files into an existing directory. Reverse reads the remote clipboard instead.
func (Client) PersistentTunnels ¶
func (c Client) PersistentTunnels(ctx context.Context) ([]PersistentTunnelInfo, error)
func (Client) Session ¶
func (c Client) Session(ctx context.Context) (SessionInfo, error)
Session describes this requesting process, not an enrolled fleet machine.
func (Client) StartForward ¶
func (Client) StartPersistentTunnel ¶
func (c Client) StartPersistentTunnel(ctx context.Context, spec PersistentTunnelSpec) (PersistentTunnelInfo, error)
func (Client) StopForward ¶
func (Client) TestConnection ¶
func (c Client) TestConnection(ctx context.Context, spec ConnectionTestSpec) (model.ConnectionTestResult, error)
func (Client) Wait ¶
Wait returns when the task is terminal. Current workers answer a blocking tasks.get as soon as the task finishes; older workers ignore waitSeconds and answer at once, so the loop keeps a minimum poll interval for them.
func (Client) WithLifetime ¶
WithLifetime owns local listeners and streams until Close or cancellation.
func (Client) WithPersistentTunnels ¶
func (c Client) WithPersistentTunnels(root string, launch func(context.Context, string) error) Client
WithPersistentTunnels enables host-owned tunnels without extending this client's lifetime. launch installs/starts a separate user service; no credentials are passed in argv.
func (Client) WithStandalone ¶
func (c Client) WithStandalone(ctx context.Context, cfg StandaloneConfig) Client
WithStandalone selects a backend with a read-only probe before any work is submitted. Only a refused local connection permits fallback. Authentication, timeouts, and uncertain application failures never cause a backend switch. Close must be called when the CLI or MCP process finishes.
type ClipboardSpec ¶
type ConnectionTestSpec ¶
type ConnectionTestSpec struct {
Node string `json:"node"`
From string `json:"from,omitempty"`
model.ConnectionTestOptions
}
ConnectionTestSpec selects either this orchestrator or a named source worker.
type Forward ¶
type Forward struct {
// contains filtered or unexported fields
}
func (*Forward) Info ¶
func (f *Forward) Info() ForwardInfo
type ForwardInfo ¶
type ForwardSpec ¶
type PersistentTunnelInfo ¶
type PersistentTunnelSpec ¶
type PersistentTunnelSpec struct {
ForwardSpec
ID string `json:"id"`
TTLSeconds int64 `json:"ttlSeconds,omitempty"`
}
PersistentTunnelSpec describes a retained listener, not a replayable TCP stream.
type SessionInfo ¶
type SessionInfo struct {
Role string `json:"role"`
OwnerID string `json:"ownerId"`
TransportID string `json:"transportId"`
Connections map[string]string `json:"connections"`
Sessions []model.PeerSession `json:"sessions"`
Forwards []ForwardInfo `json:"forwards"`
}