jsonblob

package
v0.1.26 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 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 CommonEntry

type CommonEntry struct {
	Updater     string
	Fingerprint driver.Fingerprint
	Date        time.Time
}

CommonEntry is an embedded type that's shared between the "normal" Entry type and the on-disk json produced by a Store's Load method.

type Entry

type Entry struct {
	CommonEntry
	Vuln []*claircore.Vulnerability
}

Entry is a record of all information needed to record a vulnerability at a later date.

type Loader

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

Loader is an iterator struct that returns Entries.

Users should call Next until it reports false, then check for errors via Err.

func Load

func Load(ctx context.Context, r io.Reader) (*Loader, error)

Load reads in all the records serialized in the provided Reader.

func (*Loader) Entry

func (l *Loader) Entry() *Entry

Entry returns the latest loaded Entry.

func (*Loader) Err

func (l *Loader) Err() error

Err is the latest encountered error.

func (*Loader) Next

func (l *Loader) Next() bool

Next reports whether there's a Entry to be processed.

type Store

type Store struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

A Store buffers update operations.

func New

func New() (*Store, error)

New constructs an empty Store.

func (*Store) DeleteUpdateOperations

func (s *Store) DeleteUpdateOperations(context.Context, ...uuid.UUID) error

DeleteUpdateOperations is unimplemented.

func (*Store) Entries

func (s *Store) Entries() map[uuid.UUID]*Entry

Entries returns a map containing all the Entries stored by calls to UpdateVulnerabilities.

It is unsafe for modification because it does not return a copy of the map.

func (*Store) GetLatestUpdateRef

func (s *Store) GetLatestUpdateRef(context.Context) (uuid.UUID, error)

GetLatestUpdateRef reports the latest update reference of any known updater.

func (*Store) GetLatestUpdateRefs

func (s *Store) GetLatestUpdateRefs(context.Context) (map[string][]driver.UpdateOperation, error)

GetLatestUpdateRefs reports the latest update reference for every known updater.

func (*Store) GetUpdateDiff

func (s *Store) GetUpdateDiff(ctx context.Context, prev, cur uuid.UUID) (*driver.UpdateDiff, error)

GetUpdateDiff is unimplemented.

func (*Store) GetUpdateOperations

func (s *Store) GetUpdateOperations(context.Context, ...string) (map[string][]driver.UpdateOperation, error)

GetUpdateOperations returns a list of UpdateOperations in date descending order for the given updaters.

The returned map is keyed by Updater implementation's unique names.

If no updaters are specified, all UpdateOperations are returned.

func (*Store) Store

func (s *Store) Store(w io.Writer) error

Store writes out the Store to the provided Writer. It's the inverse of Load.

func (*Store) UpdateVulnerabilities

func (s *Store) UpdateVulnerabilities(_ context.Context, updater string, fingerprint driver.Fingerprint, vulns []*claircore.Vulnerability) (uuid.UUID, error)

UpdateVulnerabilities records all provided vulnerabilities.

Jump to

Keyboard shortcuts

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