serve

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package serve wires the configured services over one install-set tree: bootp answers the configured MACs, tftp and rsh serve the tree, every protocol filters to the configured client IPs. It also generates the operator files instigator serves alongside the media and reports what each set was assembled from. Callers may send PROM and Inst> commands to a separate instructions writer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*options)

Option adjusts Start for tests.

func WithBootpReplyAddr

func WithBootpReplyAddr(a net.Addr) Option

WithBootpReplyAddr redirects bootp replies away from the broadcast address, for tests that cannot receive broadcasts.

func WithCapture

func WithCapture(dir string) Option

WithCapture turns on the install recorder, writing the run's bundle (run.json, events.jsonl, summary.json) under dir. Unset means no recording and no overhead.

func WithInstructions

func WithInstructions(w io.Writer) Option

WithInstructions directs the operator's PROM/inst commands - "type this to boot" - to w instead of discarding them. These are console UX for a human at the PROM, never part of the leveled server log: no timestamp, no level, and never written unless a caller asks for them.

func WithRSHHighPorts

func WithRSHHighPorts() Option

WithRSHHighPorts disables the rsh reserved-source-port check, for tests that cannot bind reserved ports.

func WithRSHIdleTimeout

func WithRSHIdleTimeout(d time.Duration) Option

WithRSHIdleTimeout overrides how long a silent rsh session is tolerated before it is closed and recorded as idle. Zero keeps defaultRSHIdleTimeout.

type Servers

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

Servers is a running instigator instance.

func Start

func Start(cfg *config.Config, logger *logging.Logger, opts ...Option) (*Servers, error)

Start assembles the configured install sets, generates the operator files, binds the enabled services on the configured ports, and serves until Close. logger receives leveled server output; nil is silent, exactly like an unset Logf used to be. -v maps to a DEBUG-level logger at the call site (cmd/instigator), not an option here: verbosity is a property of the logger a caller builds, not a separate flag threaded through every service.

func (*Servers) BOOTPAddr

func (s *Servers) BOOTPAddr() net.Addr

BOOTPAddr returns the bootp socket address.

func (*Servers) Close

func (s *Servers) Close() error

Close shuts every listener and releases the media.

func (*Servers) RSHAddr

func (s *Servers) RSHAddr() net.Addr

RSHAddr returns the rsh listener address.

func (*Servers) TFTPAddr

func (s *Servers) TFTPAddr() net.Addr

TFTPAddr returns the tftp socket address.

Jump to

Keyboard shortcuts

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