version

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EQ  operator = "="
	GT  operator = ">"
	LT  operator = "<"
	GTE operator = ">="
	LTE operator = "<="
	OR  operator = "||"
	AND operator = ","
)

Variables

Functions

This section is empty.

Types

type Comparator

type Comparator interface {
	Compare(*Version) (int, error)
}

type Constraint

type Constraint interface {
	fmt.Stringer
	Satisfied(*Version) (bool, error)
}

func GetConstraint

func GetConstraint(constStr string, format Format) (Constraint, error)

func MustGetConstraint

func MustGetConstraint(constStr string, format Format) Constraint

MustGetConstraint is meant for testing only, do not use within the library

type Format

type Format int
const (
	UnknownFormat Format = iota
	SemanticFormat
	DebFormat
	RpmFormat
	PythonFormat
)

func FormatFromPkgType

func FormatFromPkgType(t pkg.Type) Format

func ParseFormat

func ParseFormat(userStr string) Format

func (Format) String

func (f Format) String() string

type Version

type Version struct {
	Raw    string
	Format Format
	// contains filtered or unexported fields
}

func NewVersion

func NewVersion(raw string, format Format) (*Version, error)

func NewVersionFromPkg

func NewVersionFromPkg(p pkg.Package) (*Version, error)

func (Version) CPEs

func (v Version) CPEs() []syftPkg.CPE

func (Version) String

func (v Version) String() string

Jump to

Keyboard shortcuts

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