audittask

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager represents an entity performing data audit tasks.

func New

func New(opts ...Option) *Manager

New creates, initializes and returns new Manager instance.

func (*Manager) Listen

func (m *Manager) Listen(ctx context.Context)

Listen starts the process of processing tasks from the queue.

The listener is terminated by context.

func (*Manager) PushTask

func (m *Manager) PushTask(t *audit.Task) error

PushTask adds a task to the queue for processing.

Returns error if task was not added to the queue.

func (*Manager) Reset

func (m *Manager) Reset() (popped int)

Reset pops all tasks from the queue. Returns amount of popped elements.

type Option

type Option func(*cfg)

Option is a Manager's constructor option.

func WithContainerCommunicator

func WithContainerCommunicator(cnrCom auditor.ContainerCommunicator) Option

WithContainerCommunicator returns option to set component of communication with container nodes.

func WithLogger

func WithLogger(l *logger.Logger) Option

WithLogger returns option to specify Manager's logger.

func WithMaxPDPSleepInterval

func WithMaxPDPSleepInterval(dur time.Duration) Option

WithMaxPDPSleepInterval returns option to set maximum sleep interval between range hash requests as part of PDP check.

func WithPDPWorkerPoolGenerator

func WithPDPWorkerPoolGenerator(f func() (util.WorkerPool, error)) Option

WithPDPWorkerPool returns option to set worker pool for PDP pairs processing.

func WithPoRWorkerPoolGenerator

func WithPoRWorkerPoolGenerator(f func() (util.WorkerPool, error)) Option

WithPoRWorkerPool returns option to set worker pool for PoR SG processing.

func WithQueueCapacity

func WithQueueCapacity(cap uint32) Option

WithQueueCapacity returns option to set task queue capacity.

func WithWorkerPool

func WithWorkerPool(p util.WorkerPool) Option

WithWorkerPool returns option to set worker pool for task execution.

Jump to

Keyboard shortcuts

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