audittask

package
v0.38.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: GPL-3.0 Imports: 6 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 *zap.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

WithPDPWorkerPoolGenerator returns option to set worker pool for PDP pairs processing. Callback caller owns returned pool and must release it appropriately.

func WithPoRWorkerPoolGenerator

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

WithPoRWorkerPoolGenerator returns option to set worker pool for PoR SG processing. Callback caller owns returned pool and must release it appropriately.

func WithQueueCapacity

func WithQueueCapacity(capacity 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