updater

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	UpdateFrequency time.Duration
	RipeSearch      []string
	Blocklists      map[string]*url.URL
	Logger          *hllogger.HlLogger
	StatusUpdate    func(string) error
}

Config allows to customize a Controller creation with New()

type Controller

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

Controller holds all the state & logic. Instanciate with New().

func New

func New(ctx context.Context, conf Config) (c *Controller, err error)

New returns an initialized and ready to use Controller. Cancel ctx when you want to stop its workers. Use WaitForFullStop() to be sure they are all stopped.

func (*Controller) GetGzippedDataReader

func (c *Controller) GetGzippedDataReader() (gzipReader *bytes.Reader, length int)

GetGzippedDataReader returns a reader yielding gzipped blocklist

func (*Controller) WaitForFullStop

func (c *Controller) WaitForFullStop()

WaitForFullStop will block until all workers have properly stopped. To initiate stop, cancel the context used with New().

Jump to

Keyboard shortcuts

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