demo

package
v0.30.7 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package demo provides a synthetic traffic source and resolver so the UI can be run and developed without root (no packet capture) while still showing realistic, named per-app traffic — unlike offline pcap replay, where apps resolve to "unknown" because the original sockets no longer exist.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SeedDNS

func SeedDNS(c *dnscache.Cache)

SeedDNS pre-populates the cache with the demo IP→host mappings so the engine groups traffic by domain just as it would from sniffed DNS.

Types

type Resolver

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

Resolver maps the synthetic local ports back to their app, satisfying engine.Resolver.

func NewResolver

func NewResolver() *Resolver

NewResolver builds the demo resolver from the connection table.

func (*Resolver) Lookup

func (r *Resolver) Lookup(k types.ConnKey) (types.Process, bool)

Lookup resolves a connection key to its app by local port.

type Source

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

Source generates synthetic flows over time, mimicking a live capture.

func NewSource

func NewSource(seed int64) *Source

NewSource returns a demo source. seed varies the traffic; tick is the emission interval.

func (*Source) Name

func (s *Source) Name() string

Name identifies the source in snapshots.

func (*Source) Run

func (s *Source) Run(ctx context.Context, out chan<- types.Flow) error

Run emits flows until the context is cancelled.

Jump to

Keyboard shortcuts

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