output

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0, ISC Imports: 3 Imported by: 0

Documentation

Overview

Package output contains utilities for processing results from zgrab2 scanners for eventual output and consumption by ztag.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NullProcessCallback

func NullProcessCallback(w *Processor, v reflect.Value) *reflect.Value

NullProcessCallback is the default ProcessCallback; it just returns nil.

func Process

func Process(v interface{}) (interface{}, error)

Process the given value recursively using the default options.

Types

type ProcessCallback

type ProcessCallback func(*Processor, reflect.Value) *reflect.Value

ProcessCallback is called for each element in a struct; if it returns a non-nil value, that value will be used and further processing on that element will be skipped.

type Processor

type Processor struct {
	// Callback is a function that gets called on each element being
	// processed. If the callback returns a non-nil value, that value is
	// returned immediately instead of doing any further processing on
	// the element.
	Callback ProcessCallback

	// Verbose determines whether `zgrab:"debug"` fields will be
	// included in the output.
	Verbose bool

	// Path is the current path being processed, from the root element.
	// Used for debugging purposes only.
	// If a panic occurs, the path will point to the element where the
	// element that caused the problem.
	Path []pathEntry
}

Processor holds the state for a process run. A given processor should only be used on a single thread.

func NewProcessor

func NewProcessor() *Processor

NewProcessor returns a new Processor instance with the default settings.

func (*Processor) Process

func (processor *Processor) Process(v interface{}) (ret interface{}, err error)

Process the given value recursively using the options in this processor.

type ZGrabTag

type ZGrabTag struct {
	// Debug means that the field should only be output when doing verbose output.
	Debug bool
}

ZGrabTag holds the information from the `zgrab` tag. Currently only supports the "debug" value.

Jump to

Keyboard shortcuts

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