manager

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyLoaded = errors.New("already loaded")

ErrAlreadyLoaded is returned when a parser attempting to register is already found to be loaded with the same ID.

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager() *Manager

func (*Manager) AntifloodIrcConn

func (m *Manager) AntifloodIrcConn(c *irc.Connection) *ircConnectionProxy

func (*Manager) GetParsers

func (m *Manager) GetParsers() []Parser

GetParsers returns a slice of currently loaded parsers.

func (*Manager) NotifyUserJoined added in v1.0.2

func (m *Manager) NotifyUserJoined(target string, source string) error

func (*Manager) Parse

func (m *Manager) Parse(ctx context.Context, currentURL *url.URL) (string, parsers.ParseResult)

Parse goes through all loaded parsers in order to analyze a given URL.

func (*Manager) RegisterParser

func (m *Manager) RegisterParser(ctx context.Context, parser Parser) error

RegisterParser is called by a parser package to register itself automatically.

func (*Manager) TrackOutput

func (m *Manager) TrackOutput(target, t string) (shouldNotSend bool, err error)

func (*Manager) TrackUrl

func (m *Manager) TrackUrl(target string, u *url.URL) (shouldIgnore bool, err error)

func (*Manager) TrackUser added in v1.0.2

func (m *Manager) TrackUser(target string, source string) (shouldIgnore bool)

type Parser

type Parser interface {
	Init(ctx context.Context) error
	Name() string
	Parse(ctx context.Context, u *url.URL, referer *url.URL) parsers.ParseResult
}

Parser describes the core functionality of any parser used to analyze URLs.

Jump to

Keyboard shortcuts

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