supervisor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Shared contracts are defined in core; aliases preserve type identity.

Index

Constants

View Source
const StateCrashed = shared.StateCrashed
View Source
const StateOrphaned = shared.StateOrphaned
View Source
const StateReady = shared.StateReady
View Source
const StateRestarting = shared.StateRestarting
View Source
const StateRunning = shared.StateRunning
View Source
const StateStarting = shared.StateStarting
View Source
const StateStopped = shared.StateStopped
View Source
const StateStopping = shared.StateStopping

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact = shared.Artifact

type Connection

type Connection = shared.Connection

type Endpoint

type Endpoint = shared.Endpoint

type Instance

type Instance = shared.Instance

type Native

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

func OpenNative

func OpenNative(ctx context.Context, store *ledger.NativeStore, options NativeOptions) (*Native, error)

func (*Native) Await

func (n *Native) Await(ctx context.Context, id string, states ...State) (Instance, error)

func (*Native) Close

func (n *Native) Close() error

func (*Native) Health

func (n *Native) Health(ctx context.Context, id string, check bool) (bool, error)

func (*Native) Instance

func (n *Native) Instance(ctx context.Context, id string) (out Instance, err error)

func (*Native) Instances

func (n *Native) Instances(ctx context.Context) (out []Instance, err error)

func (*Native) Logs

func (n *Native) Logs(ctx context.Context, id string) (out string, err error)

func (*Native) Orphans

func (n *Native) Orphans(ctx context.Context) (out []Instance, err error)

func (*Native) Ready

func (n *Native) Ready(ctx context.Context, id string, pid int, ready bool) error

func (*Native) ResolveOrphan

func (n *Native) ResolveOrphan(ctx context.Context, id string) error

func (*Native) Start

func (n *Native) Start(ctx context.Context, spec NativeSpec, secrets map[string]string) (out Instance, err error)

func (*Native) Stop

func (n *Native) Stop(ctx context.Context, id string) error

type NativeOptions

type NativeOptions struct {
	LogLimit          int    `json:"log_limit,omitempty"`
	RuntimeID         string `json:"runtime_id,omitempty"`
	RequireChecksum   bool   `json:"require_checksum,omitempty"`
	OrphanPolicy      string `json:"orphan_policy,omitempty"`
	LeaseMilliseconds int64  `json:"lease_ms,omitempty"`
	RetainTerminal    int    `json:"retain_terminal,omitempty"`
}

NativeOptions configures the C supervisor. Ownership and orphan policy remain explicit; opening does not silently substitute the compatibility supervisor.

type NativeRestart

type NativeRestart struct {
	MaxAttempts              int   `json:"max_attempts,omitempty"`
	InitialDelayMilliseconds int64 `json:"initial_delay_ms,omitempty"`
	MaxDelayMilliseconds     int64 `json:"max_delay_ms,omitempty"`
}

type NativeSpec

type NativeSpec struct {
	Artifact                     Artifact          `json:"artifact"`
	Command                      string            `json:"command"`
	Args                         []string          `json:"args,omitempty"`
	Dir                          string            `json:"dir,omitempty"`
	Environment                  map[string]string `json:"environment,omitempty"`
	Endpoints                    []Endpoint        `json:"endpoints,omitempty"`
	Connections                  []Connection      `json:"connections,omitempty"`
	Dependencies                 []string          `json:"dependencies,omitempty"`
	Restart                      NativeRestart     `json:"restart,omitempty"`
	AwaitReadiness               bool              `json:"await_readiness,omitempty"`
	ReadinessTimeoutMilliseconds int64             `json:"readiness_timeout_ms,omitempty"`
}

NativeSpec is the C wire contract. Readiness and health checks are reported explicitly by the application; no Go callback is passed into the engine.

type Orphan

type Orphan = shared.Orphan

type State

type State = shared.State

Jump to

Keyboard shortcuts

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