reportio

package
v0.0.0-...-e09b680 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPathNotLocal         = errors.New("report path is not local")
	ErrInvalidPathStructure = errors.New("invalid report path structure")
)

Functions

func IsPossibleReport

func IsPossibleReport(name string, mode fs.FileMode) bool

IsPossibleReport returns true if the given file is possibly a report.

func OriginExistsInPaths

func OriginExistsInPaths(path string, bases []string, sourceID, shasum string) (bool, error)

OriginExistsInPaths returns true if an OSV report exists with an origin that exists with the same sourceID and shasum.

The function iterates across each of the base paths in bases and joins them with path using `filepath.Join(base, path)`.

An error is returned if there is an error reading the OSV reports, or the filesystem.

func ReportsInPaths

func ReportsInPaths(path string, bases []string) ([]string, error)

ReportsInPaths returns a slice with all the filepaths to all OSV reports that share the same path (i.e. ecosystem and package name) across the directories in bases.

The function iterates across each of the base paths in bases and joins them with path using `filepath.Join(base, path)`.

An error will be returned if there is an error reading the the filesystem.

func ValidatePath

func ValidatePath(path string) error

ValidatePath ensures path is a valid place to put OSV reports.

This method enforces that every path is local, and that it has at least two path elements - i.e. an ecosystem, and a package name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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