client

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package client implements the Universal Ferret API over a caller-owned gRPC connection. New returns api.Runtime; plans, sessions, output, options, and debugger values use github.com/MontFerret/api and its canonical subpackages.

The construction context bounds the handshake, while the returned runtime owns the logical connection lifetime. Runtime.Run invokes the hosted runtime directly. Plans create durable sessions whose runs are sequential. Callers close resources explicitly; Close uses bounded detached cleanup and never closes the physical transport.

Wire resource IDs, RPC clients, and watch streams remain private. Immediate remote failures expose Error, terminal failures use pkg/failure.Failure, and ErrClosed and ErrExecutionCancelled distinguish local closure and remote cancellation from the caller's context errors.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrClosed reports an operation attempted through a closed runtime or resource
	// handle. Closing begins when the first Close call commits teardown.
	ErrClosed = errors.New("Wire client or resource is closed")

	// ErrExecutionCancelled reports that a remote execution reached its cancelled
	// terminal state. It is distinct from cancellation of the caller's context.
	ErrExecutionCancelled = errors.New("remote execution was cancelled")
)

Functions

func New

func New(ctx context.Context, connection grpc.ClientConnInterface) (api.Runtime, error)

New opens a logical Wire connection and exposes it through the canonical api.Runtime interface. The context bounds the handshake; cancelling it after construction does not close the runtime. Close releases the logical connection and its resources with bounded detached cleanup, leaving the caller-owned transport open. On failure, New returns a nil interface.

Types

type Error

type Error struct {
	Category    failure.Category
	Message     string
	Diagnostics diagnostics.Diagnostics
	// contains filtered or unexported fields
}

Error is a decoded Wire RPC failure. Category is set only when the server transmitted an ErrorDetail; transport-native statuses leave it zero. Internal transport causes remain available through Unwrap without exposing protocol resource identifiers.

func (*Error) Error

func (e *Error) Error() string

Error returns the sanitized Wire error message.

func (*Error) Is

func (e *Error) Is(target error) bool

Is preserves context identity without replacing the underlying gRPC status.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap returns the underlying transport error for errors.Is and errors.As.

Jump to

Keyboard shortcuts

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