table

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OutputPresets = map[string][]string{
	"sockets": {
		"process.pid", "process.name", "process.user",
		"socket.family", "socket.type", "socket.state",
		"socket.srcAddr", "socket.srcPort", "socket.dstAddr", "socket.dstPort",
	},
	"files": {
		"process.pid", "process.name", "process.user",
		"file.fd", "file.fdType", "file.path",
	},
	"containers": {
		"process.pid", "process.name", "process.user",
		"container.name", "container.image", "container.runtime",
	},
	"network": {
		"process.pid", "process.name",
		"socket.type", "socket.state", "socket.srcPort", "socket.dstPort",
	},
}

OutputPresets defines common output column combinations

Functions

func ParseColumns added in v0.2.0

func ParseColumns(spec string) []string

ParseColumns parses a comma-separated column specification Supports presets: "sockets", "files", "containers", "network"

func ValidateColumns added in v0.2.0

func ValidateColumns(columnNames []string) error

ValidateColumns checks if all column names are valid

Types

type ColumnPrinter added in v0.2.0

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

ColumnPrinter prints match results with custom columns specified by -o flag

func NewColumnPrinter added in v0.2.0

func NewColumnPrinter(w io.Writer, bootTime time.Time, columnNames []string, _ bool) (*ColumnPrinter, error)

NewColumnPrinter creates a new column printer with the specified columns

func (*ColumnPrinter) HasFileColumns added in v0.2.0

func (p *ColumnPrinter) HasFileColumns() bool

HasFileColumns returns true if any column is from file/socket

func (*ColumnPrinter) Print added in v0.2.0

func (p *ColumnPrinter) Print(results []filter.MatchResult)

Print prints all match results with the configured columns

type PrintOption

type PrintOption func(*Printer)

func WithColors

func WithColors(colored bool) PrintOption

WithColors enables or disables colored output.

func WithContainers

func WithContainers(mgr *containers.Manager) PrintOption

WithContainers sets the container manager for container labels.

type Printer

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

Printer handles table printing with various options.

func NewPrinter

func NewPrinter(w io.Writer, bootTime time.Time, opts ...PrintOption) *Printer

NewPrinter creates a new table Printer.

func (*Printer) PrintAll

func (p *Printer) PrintAll(tasks []*unmarshal.TaskDescriptor)

PrintAll prints all tasks in a table.

func (*Printer) PrintLineage

func (p *Printer) PrintLineage(tasks []*unmarshal.TaskDescriptor, lineagePids map[int32]bool)

PrintLineage prints all processes in the lineage of the specified PIDs.

func (*Printer) PrintPIDs

func (p *Printer) PrintPIDs(tasks []*unmarshal.TaskDescriptor, pids []int32)

PrintPIDs prints only the specified PIDs.

Jump to

Keyboard shortcuts

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