app

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package app wires the pieces together: it takes a validated configuration, resolves addressing, runs the safety checks and drives the dataplane.

Both front ends go through here, so a run started from the wizard and one started with --no-tui are the same run, validated the same way.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunNonInteractive

func RunNonInteractive(ctx context.Context, cfg *config.Config, out io.Writer) error

RunNonInteractive validates the flags, prints what it is about to do, and transmits — printing a statistics line every second and a summary at the end. This is the shape scripts and CI use.

Types

type PrepareOptions

type PrepareOptions struct {
	// Source overrides system discovery; nil uses the real kernel.
	Source discovery.Source
	// Logf receives dataplane messages during the run.
	Logf func(format string, args ...any)
	// Session keeps the XDP program attached between runs. An interactive
	// session passes one so a rerun does not pay the attach cost again; the
	// one-shot --no-tui path leaves it nil.
	Session *dataplane.Session
}

PrepareOptions tunes preparation.

type Prepared

type Prepared struct {
	Runner    *dataplane.Runner
	Resolved  *discovery.Resolved
	Preflight *dataplane.Preflight
	Plan      dataplane.FilterPlan
	Frames    generator.FrameSource
}

Prepare turns a configuration into a ready-to-start Runner, doing every step that must happen before an XDP program is attached: validation, PCAP loading, address and next-hop resolution, and the preflight checks.

It returns the runner, the preflight result and the resolved addressing so a front end can show a review screen. Nothing has touched the interface yet.

func Prepare

func Prepare(cfg *config.Config, opts PrepareOptions) (*Prepared, error)

Prepare validates and resolves everything a run needs.

Jump to

Keyboard shortcuts

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