Documentation
¶
Overview ¶
Package background owns the native child process and local control socket for an ordinary background job. commands supply startup facts and presentation.
Index ¶
- Variables
- func Launch(ctx context.Context, opts LaunchOptions, ...) (result error)
- func Ready(ctx context.Context, ready Readiness) error
- func ReceiptWriter(ctx context.Context, output io.Writer) io.Writer
- func Reconnecting(ctx context.Context)
- func RunChild(ctx context.Context, run func(context.Context, Bootstrap) error) (result error)
- type Bootstrap
- type Entry
- type Kind
- type LaunchOptions
- type Readiness
- type ReceiptWriteError
- type State
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("background job not found")
ErrNotFound means there is no reachable socket owner for the exact ID in this state directory. it is not confirmation that a stop request was processed.
Functions ¶
func Launch ¶
func Launch(ctx context.Context, opts LaunchOptions, receipt func(context.Context, Entry) error) (result error)
Launch starts one child in its own session. the receipt callback is synchronous and shares the handoff deadline; use ReceiptWriter for its output. a failed receipt or canceled startup stops and reaps the child.
func Ready ¶
Ready reports readiness from the serving operation. the first observation sends the startup receipt; later observations update only the job's live state. it is a no-op in an ordinary foreground operation.
func ReceiptWriter ¶
ReceiptWriter bounds backpressure on pipes and terminal streams during handoff. other writers are called directly and must not block beyond the context.
func Reconnecting ¶
Reconnecting marks lost readiness without starting a new job or sending a second receipt. before the first ready observation the job is still starting.
Types ¶
type Bootstrap ¶
type Bootstrap struct {
JobID string `json:"job_id"`
StateDir string `json:"state_dir"`
Kind Kind `json:"kind"`
Payload json.RawMessage `json:"payload,omitempty"`
}
Bootstrap carries the canonical state root and the operation's validated startup payload on an inherited, private channel, never in the child's argv.
type Entry ¶
type LaunchOptions ¶
type Readiness ¶
type Readiness struct {
Address string `json:"address,omitempty"`
Target string `json:"target,omitempty"`
TunnelID string `json:"tunnel_id,omitempty"`
ServiceID string `json:"service_id,omitempty"`
ConnectCommand []string `json:"connect_command,omitempty"`
Profile json.RawMessage `json:"profile,omitempty"`
GuestEntryURL string `json:"guest_entry_url,omitempty"`
}
Readiness is reported by the serving operation, not inferred by the launcher. Profile carries the connector's own shape. Profile, ConnectCommand, and GuestEntryURL go only to the launcher, not status and list.
type ReceiptWriteError ¶
type ReceiptWriteError struct {
// contains filtered or unexported fields
}
ReceiptWriteError marks a failed descriptor write. callers must not retry it through an unbounded diagnostic writer, which may share the failed descriptor.
func (*ReceiptWriteError) Error ¶
func (e *ReceiptWriteError) Error() string
func (*ReceiptWriteError) Unwrap ¶
func (e *ReceiptWriteError) Unwrap() error