blocker

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blocker

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

Blocker scans the database for skylinks that should be blocked and calls skyd to block them.

func New

func New(skydClient *api.SkydClient, db *database.DB, logger *logrus.Logger) (*Blocker, error)

New returns a new Blocker with the given parameters.

func (*Blocker) BlockHashes

func (bl *Blocker) BlockHashes(hashes []database.Hash) (int, int, error)

BlockHashes blocks the given list of hashes. It returns the amount of hashes which were blocked successfully, the amount that were invalid, and a potential error.

func (*Blocker) Start

func (bl *Blocker) Start() error

Start launches the two backgrounds that periodically scan for new hashes to block or retry hashes that failed to get blocked the first time around.

func (*Blocker) Stop

func (bl *Blocker) Stop() error

Stop waits for the blocker's waitgroup and times out after one minute.

Jump to

Keyboard shortcuts

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