db

package
v0.77.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 16 Imported by: 15 modules, 23 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	SchemaVersion = db.SchemaVersion
)

Variables

View Source
var (
	// GitHub Container Registry
	DefaultGHCRRepository = fmt.Sprintf("%s:%d", "ghcr.io/aquasecurity/trivy-db", db.SchemaVersion)

	// GCR mirror
	DefaultGCRRepository = fmt.Sprintf("%s:%d", "mirror.gcr.io/aquasec/trivy-db", db.SchemaVersion)

	Close = db.Close
	Path  = db.Path
)

Functions

func Dir added in v0.54.0

func Dir(cacheDir string) string

func Init

func Init(dbDir string, opts ...db.Option) error

Init initializes the vulnerability database with read-only mode

Types

type Client added in v0.2.0

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

Client implements DB operations

func NewClient added in v0.2.0

func NewClient(dbDir string, quiet bool, opts ...Option) *Client

NewClient is the factory method for DB client

func (*Client) Clear added in v0.53.0

func (c *Client) Clear(_ context.Context) error

func (*Client) Download added in v0.2.0

func (c *Client) Download(ctx context.Context, dst string, opt types.RegistryOptions) error

Download downloads the DB file

func (*Client) NeedsUpdate added in v0.3.0

func (c *Client) NeedsUpdate(ctx context.Context, cliVersion string, skip bool) (bool, error)

NeedsUpdate check is DB needs update

func (*Client) ShowInfo added in v0.54.0

func (c *Client) ShowInfo() error

type Option added in v0.23.0

type Option func(*options)

Option is a functional option

func WithDBRepository added in v0.25.1

func WithDBRepository(dbRepository []name.Reference) Option

WithDBRepository takes a dbRepository

func WithOCIArtifact added in v0.23.0

func WithOCIArtifact(art *oci.Artifact) Option

WithOCIArtifact takes an OCI artifact

Jump to

Keyboard shortcuts

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