types

package
v0.0.0-...-46fbbb1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2022 VMware, Inc. SPDX-License-Identifier: Apache-2.0

Copyright 2022 VMware, Inc. SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

View Source
var (
	// VulStoreMeta defines metadata of vulnerability store for Harbor.
	VulStoreMeta = core.Metadata{
		Kind:    core.DataTypeVulnerability,
		Version: core.DataVersionVulnerability,
		Scheme:  core.DataSchemeVulnerability,
	}
)

Available stores

Functions

This section is empty.

Types

type Store

type Store interface {
	// Metadata of the data holding by the store.
	Metadata() core.Metadata

	// Validate validates whether the store has proper data of the specified type.
	Validate() error

	// SetError sets the store to the error state.
	// If the previous error exists, error provided here will override the previous one.
	// This will cause Validate() returns non nil error.
	SetError(err error)

	// FillIn fill in store with the provided data.
	// Any error happened here MUST cause Validate() returns non nil error.
	FillIn(artifactID core.ArtifactID, data interface{})

	// ForArtifact indicates data is for which image artifact.
	ForArtifact() core.ArtifactID

	// Assess checks whether the baseline is matched or not?
	Assess(baseline v1alpha1.ComplianceBaseline) error

	// FromJSON store JSON data into store.
	// Any error happened here MUST cause Validate() returns non nil error.
	FromJSON(str string)

	// ToJSON outputs the data in the store as JSON string.
	ToJSON() string
}

Store for holding the security data read from the upstream data provider.

func GetStore

func GetStore(meta core.Metadata) (Store, error)

GetStore is factory method for creating a Store depends on the metadata provided.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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