types

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VersionSort

func VersionSort(vs []Version) func(int, int) bool

VersionSort returns a function suitable for passing to sort.Slice or sort.SliceStable.

Types

type ArchOp

type ArchOp uint
const (
	OpEquals       ArchOp // equals
	OpNotEquals           // not equals
	OpPatternMatch        // pattern match
)

func (ArchOp) Cmp

func (o ArchOp) Cmp(a, b string) bool

func (ArchOp) MarshalText

func (o ArchOp) MarshalText() (text []byte, err error)

func (ArchOp) String

func (i ArchOp) String() string

func (*ArchOp) UnmarshalText

func (o *ArchOp) UnmarshalText(text []byte) error

type PackageKind

type PackageKind uint
const (
	UnknownPackage PackageKind = iota // unknown
	SourcePackage                     // source
	BinaryPackage                     // binary
)

func (PackageKind) MarshalText

func (k PackageKind) MarshalText() (text []byte, err error)

func (PackageKind) String

func (i PackageKind) String() string

func (*PackageKind) UnmarshalText

func (k *PackageKind) UnmarshalText(text []byte) error

type Range

type Range struct {
	Lower Version `json:"["`
	Upper Version `json:")"`
}

Range is a half-open interval of two Versions.

In the usual notation, it is: [Lower, Upper)

func (*Range) Contains

func (r *Range) Contains(v *Version) bool

Contains reports whether the Version falls within the Range.

type Severity

type Severity uint
const (
	Unknown Severity = iota
	Negligible
	Low
	Medium
	High
	Critical
)

func (*Severity) MarshalText

func (s *Severity) MarshalText() ([]byte, error)

func (Severity) String

func (i Severity) String() string

func (*Severity) UnmarshalText

func (s *Severity) UnmarshalText(b []byte) error

type Version

type Version struct {
	Kind string
	V    [10]int32
}

Version describes a revision of some sort that is ordered correctly within its "Kind".

Versions of different kinds do not have any sensible ordering.

func (*Version) Compare

func (v *Version) Compare(x *Version) int

Compare returns an integer describing the relationship of two Versions.

The result will be 0 if a==b, -1 if a < b, and +1 if a > b. If the Versions are of different kinds, the Kinds will be compared lexographically.

func (*Version) MarshalText

func (v *Version) MarshalText() ([]byte, error)

MarshalText implments encoding.TextMarshaler.

func (*Version) String

func (v *Version) String() string

func (*Version) UnmarshalText

func (v *Version) UnmarshalText(text []byte) (err error)

UnmarshalText implments encoding.TextUnmarshaler.

Directories

Path Synopsis
Package cpe provides for handling Common Platform Enumeration (CPE) names.
Package cpe provides for handling Common Platform Enumeration (CPE) names.
Package csaf provides functionality for handling Common Security Advisory Framework Version 2.0 documents: https://docs.oasis-open.org/csaf/csaf/v2.0/os/csaf-v2.0-os.html
Package csaf provides functionality for handling Common Security Advisory Framework Version 2.0 documents: https://docs.oasis-open.org/csaf/csaf/v2.0/os/csaf-v2.0-os.html
Package cvss implements v2.0, v3.0, v3.1, and v4.0 CVSS vectors and scoring.
Package cvss implements v2.0, v3.0, v3.1, and v4.0 CVSS vectors and scoring.

Jump to

Keyboard shortcuts

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