colly: github.com/gocolly/colly/debug Index | Files

package debug

import "github.com/gocolly/colly/debug"

Index

Package Files

debug.go logdebugger.go webdebugger.go

type Debugger Uses

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 Uses

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 Uses

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 Uses

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

Event receives Collector events and prints them to STDERR

func (*LogDebugger) Init Uses

func (l *LogDebugger) Init() error

Init initializes the LogDebugger

type WebDebugger Uses

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
    // contains filtered or unexported fields
}

WebDebugger is a web based debuging frontend for colly

func (*WebDebugger) Event Uses

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

Event updates the debugger's status

func (*WebDebugger) Init Uses

func (w *WebDebugger) Init() error

Init initializes the WebDebugger

Package debug imports 7 packages (graph) and is imported by 4 packages. Updated 2018-01-06. Refresh now. Tools for package owners.