updater

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	*Opts
}

Controller is a control structure for fetching, parsing, and updating a vulnstore.

func NewController added in v0.0.21

func NewController(opts *Opts) *Controller

New is a constructor for an Controller

func (*Controller) Start

func (u *Controller) Start(ctx context.Context) error

Start begins a long running update controller. cancel ctx to stop.

func (*Controller) Update

func (u *Controller) Update(ctx context.Context) error

Update triggers an update procedure. exported to make testing easier.

type Opts

type Opts struct {
	// an embedded updater interface
	driver.Updater
	// a unique name for this controller. must be unique between controllers
	Name string
	// store for persistence
	Store vulnstore.Updater
	// update interval
	Interval time.Duration
	// lock to ensure only process updating
	Lock distlock.Locker
	// immediately update on construction
	UpdateOnStart bool
}

Opts are options used to create an Updater

Jump to

Keyboard shortcuts

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