Documentation ¶
Overview ¶
Package pkgecosystem defines the open source ecosystems supported by Package Analysis.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupported = errors.New("ecosystem unsupported")
ErrUnsupported is returned by Ecosystem.UnmarshalText when bytes that do not correspond to a defined ecosystem constant is passed in as a parameter.
SupportedEcosystems is a list of all the ecosystems supported.
var SupportedEcosystemsStrings = EcosystemsAsStrings(SupportedEcosystems)
SupportedEcosystemsStrings is the list of supported ecosystems represented as strings.
Functions ¶
func EcosystemsAsStrings ¶
EcosystemsAsStrings converts a slice of Ecosystems to a string slice.
func Unsupported ¶
Unsupported returns a new ErrUnsupported that adds the unsupported ecosystem name to the error message
Types ¶
type Ecosystem ¶
type Ecosystem string
Ecosystem represents an open source package ecosystem from which packages can be downloaded.
It implements encoding.TextUnmarshaler and encoding.TextMarshaler so it can be used with flag.TextVar.
func Parse ¶
Parse returns an Ecosystem corresponding to the given string name, or the None ecosystem along with an error if there is no matching Ecosystem. If name == "", then the None ecosystem is returned with no error.
func ParsePurlType ¶
ParsePurlType converts from a Package URL type, defined at https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst to an Ecosystem object
func (Ecosystem) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Ecosystem) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
It will only succeed when unmarshaling ecosytems in SupportedEcosystems or empty.