scanwatcher

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPollInterval     = 15 * time.Second
	DefaultReconcileTimeout = 5 * time.Minute
	DefaultScanTimeout      = 48 * time.Hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Backend          *backendclient.BackendClient
	Provider         provider.Provider
	PollPeriod       time.Duration `mapstructure:"poll_period"`
	ReconcileTimeout time.Duration `mapstructure:"reconcile_timeout"`
	ScanTimeout      time.Duration `mapstructure:"scan_timeout"`
}

func (Config) WithBackendClient

func (c Config) WithBackendClient(b *backendclient.BackendClient) Config

func (Config) WithPollPeriod

func (c Config) WithPollPeriod(t time.Duration) Config

func (Config) WithProviderClient

func (c Config) WithProviderClient(p provider.Provider) Config

func (Config) WithReconcileTimeout

func (c Config) WithReconcileTimeout(t time.Duration) Config

func (Config) WithScanTimeout

func (c Config) WithScanTimeout(t time.Duration) Config

type ScanPoller

type ScanPoller = common.Poller[ScanReconcileEvent]

type ScanQueue

type ScanQueue = common.Queue[ScanReconcileEvent]

type ScanReconcileEvent

type ScanReconcileEvent struct {
	ScanID models.ScanID
}

func (ScanReconcileEvent) Hash

func (e ScanReconcileEvent) Hash() string

func (ScanReconcileEvent) String

func (e ScanReconcileEvent) String() string

func (ScanReconcileEvent) ToFields

func (e ScanReconcileEvent) ToFields() log.Fields

type ScanReconciler

type ScanReconciler = common.Reconciler[ScanReconcileEvent]

type Watcher

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

func New

func New(c Config) *Watcher

func (*Watcher) GetRunningScans

func (w *Watcher) GetRunningScans(ctx context.Context) ([]ScanReconcileEvent, error)

nolint:cyclop

func (*Watcher) Reconcile

func (w *Watcher) Reconcile(ctx context.Context, event ScanReconcileEvent) error

nolint:cyclop

func (*Watcher) Start

func (w *Watcher) Start(ctx context.Context)

Jump to

Keyboard shortcuts

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