data

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: 5 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact interface {
	GetVulnerabilitiesList(ctx context.Context, id core.ArtifactID) (*vuln.Report, error)
}

type Configurator

type Configurator interface {
	// ApplyConfig applies configurations to data source.
	ApplyConfig(ctx context.Context, ds v1alpha1.DataSource) error
}

Configurator is the interface for configuring data source.

type HealthChecker

type HealthChecker interface {
	// Ping checks service whether ready.
	Ping(ctx context.Context) error
}

HealthChecker is the interface for health check.

type ReadOption

type ReadOption func(opts *ReadOptions)

ReadOption is a read option template func.

func WithMetadata

func WithMetadata(meta core.Metadata) ReadOption

WithMetadata defines read option for which metadata required.

type ReadOptions

type ReadOptions struct {
	// Metas of data to read.
	Metas []core.Metadata
}

ReadOptions contains options for client reading.

type Reader

type Reader interface {
	// Read data for the specified artifact.
	// If there are multiple data kinds supported by the upstream provider, then return them at the same time.
	// Any error occurred, non-nil error should be returned.
	Read(ctx context.Context, id core.ArtifactID, options ...ReadOption) ([]types.Store, error)
}

Reader for reading or requesting security data from the upstream data provider.

type Register

type Register interface {
	// RegisterKnownRegistries registers known registries to data source.
	RegisterKnownRegistries(ctx context.Context, registries []v1alpha1.KnownRegistry) error
}

Register is the interface for registering known registry to data source.

type Requester

type Requester interface {
	// Request the upstream data provider to create missing data for the specified artifact.
	// Request just asks for missing data and does not track the data creation process. If the data is ready,
	// it can be Read() next time.
	// As the data creation may need some time and can not be ready soon, this method may be called multiple times.
	// To avoid creating duplicated data creation processes, this method must be idempotent.
	Request(ctx context.Context, id core.ArtifactID) error
}

Requester is designed to issue request to the upstream provider for filling in the missing data.

type Writer

type Writer interface {
	// Write the specified data to somewhere.
	Write(ctx context.Context, id core.ArtifactID, data []types.Store) error
}

Writer for writing security data to somewhere like cache.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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