debug

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Debugger

type Debugger interface {
	// Init initializes the backend
	Init() error
	// Event receives a new collector event.
	Event(e *Event)
}

Debugger is an interface for different type of debugging backends

type Event

type Event struct {
	// Type is the type of the event
	Type string
	// RequestID identifies the HTTP request of the Event
	RequestID uint32
	// CollectorID identifies the collector of the Event
	CollectorID uint32
	// Values contains the event's key-value pairs. Different type of events
	// can return different key-value pairs
	Values map[string]string
}

Event represents an action inside a collector

type LogDebugger

type LogDebugger struct {
	// Output is the log destination, anything can be used which implements them
	// io.Writer interface. Leave it blank to use STDERR
	Output io.Writer
	// Prefix appears at the beginning of each generated log line
	Prefix string
	// Flag defines the logging properties.
	Flag int
	// contains filtered or unexported fields
}

LogDebugger is the simplest debugger which prints log messages to the STDERR

func (*LogDebugger) Event

func (l *LogDebugger) Event(e *Event)

Event receives Collector events and prints them to STDERR

func (*LogDebugger) Init

func (l *LogDebugger) Init() error

Init initializes the LogDebugger

type WebDebugger

type WebDebugger struct {
	// Address is the address of the web server. It is 127.0.0.1:7676 by default.
	Address string

	CurrentRequests map[uint32]requestInfo
	RequestLog      []requestInfo
	sync.Mutex
	// contains filtered or unexported fields
}

WebDebugger is a web based debuging frontend for colly

func (*WebDebugger) Event

func (w *WebDebugger) Event(e *Event)

Event updates the debugger's status

func (*WebDebugger) Init

func (w *WebDebugger) Init() error

Init initializes the WebDebugger

Jump to

Keyboard shortcuts

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