ingest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ingest

func Ingest(name string, raw []byte) (*scanpb.Run, error)

Ingest looks up the named scanner and runs it against raw. It is the one-call entry point the CLI uses; an unknown name yields an error that lists the scanners that are registered.

func Names

func Names() []string

Names returns the sorted list of registered ingestor names (for CLI help/completion).

func Register

func Register(in Ingestor)

Register makes an Ingestor available under its Name(). Adapters call it from init(). A duplicate name panics: that is a programming error and is caught at startup.

Types

type Ingestor

type Ingestor interface {
	// Name is the scanner identifier ("nmap", "zgrab2", ...). It is both the key the
	// Ingestor registers under and the value stamped onto Run.Scanner.
	Name() string

	// Ingest parses one scanner's raw output into a scan.Run. Implementations MUST NOT
	// touch the database: they only build the in-memory Run tree. Deduplication, merge and
	// storage happen downstream via Scans.Create (which folds through host.IngestHosts), so
	// the same identity/merge primitives are shared with every other ingest path.
	Ingest(raw []byte) (*scanpb.Run, error)
}

Ingestor maps one scanner's native output into the shared scan model. Any tool that can emit bytes — nmap XML, masscan/zgrab JSON, a naabu port list — becomes a contributor to the same objects by implementing this one method. nmap.FromXML already has this shape.

func Get

func Get(name string) (Ingestor, bool)

Get returns the Ingestor registered under name, if any.

Jump to

Keyboard shortcuts

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