common

package
v1.4.16 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeSeverity

func NormalizeSeverity(severity string) claircore.Severity

NormalizeSeverity maps Red Hat severity strings to claircore's normalized serverity levels.

Types

type Updater

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

Updater returns a value that's periodically updated.

func NewUpdater

func NewUpdater(url string, init interface{}) *Updater

NewUpdater returns an Updater holding a value of the type passed as "init", periodically updated from the endpoint "url."

To omit an initial value, use a typed nil pointer.

func (*Updater) Fetch

func (u *Updater) Fetch(ctx context.Context, c *http.Client) error

Fetch attempts to perform an atomic update of the mapping file.

Fetch is safe to call concurrently.

func (*Updater) Get

func (u *Updater) Get(ctx context.Context, c *http.Client) (interface{}, error)

Get returns a pointer to the current copy of the value. The Get call may be hijacked to update the value from the configured endpoint.

Jump to

Keyboard shortcuts

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