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().
Click to show internal directories.
Click to hide internal directories.