parse

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedFormat means this parser cannot decode the requested format.
	ErrUnsupportedFormat = errors.New("unsupported output format")
	// ErrInvalidOutput means contents could not be decoded for the requested format.
	ErrInvalidOutput = errors.New("invalid masscan output")
)

Functions

This section is empty.

Types

type Format

type Format string

Format represents a masscan output format in the parser layer.

const (
	// FormatJSON is a JSON output format.
	FormatJSON Format = "json"
	// FormatXML is an XML output format.
	FormatXML Format = "xml"
	// FormatList is a list output format.
	FormatList Format = "list"
	// FormatGrepable is a grepable output format.
	FormatGrepable Format = "grepable"
	// FormatBinary is a binary output format.
	FormatBinary Format = "binary"
	// FormatUnknown means output format autodetection is required.
	FormatUnknown Format = "unknown"
)

type Host

type Host struct {
	Address   string
	Timestamp string
	Ports     []Port
}

Host is a discovered host in parsed output.

type Port

type Port struct {
	Number    int
	Protocol  string
	Status    string
	Reason    string
	ReasonTTL int
}

Port is a discovered port in parsed output.

type Result

type Result struct {
	Hosts []Host
}

Result is the parsed representation of a masscan output.

func Output

func Output(contents []byte, format Format) (*Result, error)

Output parses masscan output contents with the given format.

Jump to

Keyboard shortcuts

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