bot

package
v0.0.0-...-f1cee2f Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

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

Bot iterates on all subscriptions and listens / responds to messages

func New

func New(r *repo.MySQL, q queue.Queue) (*Bot, error)

New returns a new bot

func (*Bot) HandleMessage

func (b *Bot) HandleMessage(msg util.Object)

func (*Bot) Start

func (b *Bot) Start() error

Start the monitoring process - will start a separate Go routine

func (*Bot) Stop

func (b *Bot) Stop()

Stop the monitoring process

type IPByDate

type IPByDate []govt.DetectedUrl

IPByDate sorting

func (IPByDate) Len

func (a IPByDate) Len() int

func (IPByDate) Less

func (a IPByDate) Less(i, j int) bool

func (IPByDate) Swap

func (a IPByDate) Swap(i, j int)

type Worker

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

Worker reads messages from the queue and does the actual work

func NewWorker

func NewWorker(q queue.Queue) (*Worker, error)

NewWorker that loads work messages from the queue

func (*Worker) Start

func (w *Worker) Start()

Start the worker process. To stop, just close the queue.

Jump to

Keyboard shortcuts

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