remote

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package remote provides a backend that executes code on a remote runtime service. Generic target for dedicated runtime services, batch systems, or job runners.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRemoteNotAvailable is returned when the remote service is not available.
	ErrRemoteNotAvailable = errors.New("remote service not available")

	// ErrConnectionFailed is returned when connection to remote service fails.
	ErrConnectionFailed = errors.New("connection to remote service failed")

	// ErrRemoteExecutionFailed is returned when remote execution fails.
	ErrRemoteExecutionFailed = errors.New("remote execution failed")
)

Errors for remote backend operations.

Functions

This section is empty.

Types

type Backend

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

Backend executes code on a remote runtime service.

func New

func New(cfg Config) *Backend

New creates a new remote backend with the given configuration.

func (*Backend) Execute

Execute runs code on the remote runtime service.

func (*Backend) Kind

func (b *Backend) Kind() runtime.BackendKind

Kind returns the backend kind identifier.

type Config

type Config struct {
	// Endpoint is the URL of the remote runtime service.
	// Required.
	Endpoint string

	// AuthToken is the authentication token for the remote service.
	AuthToken string

	// TLSSkipVerify skips TLS certificate verification.
	// WARNING: Only use for development.
	TLSSkipVerify bool

	// TimeoutOverhead is additional timeout added to account for network latency.
	// Default: 5s
	TimeoutOverhead time.Duration

	// MaxRetries is the maximum number of retries on transient failures.
	// Default: 3
	MaxRetries int

	// Logger is an optional logger for backend events.
	Logger Logger
}

Config configures a remote backend.

type Logger

type Logger interface {
	Info(msg string, args ...any)
	Warn(msg string, args ...any)
	Error(msg string, args ...any)
}

Logger is the interface for logging.

Contract: - Concurrency: implementations must be safe for concurrent use. - Errors: logging must be best-effort and must not panic.

Jump to

Keyboard shortcuts

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