Documentation ¶
Overview ¶
Package version provides data structures for representing version attributes.
Index ¶
- type AttrKey
- type AttrSet
- func (s AttrSet) Clone() AttrSet
- func (s AttrSet) Empty() bool
- func (s AttrSet) Equal(other AttrSet) bool
- func (s AttrSet) ForEachAttr(f func(key AttrKey, value string))
- func (s AttrSet) GetAttr(key AttrKey) (value string, ok bool)
- func (s AttrSet) HasAttr(key AttrKey) bool
- func (s *AttrSet) SetAttr(key AttrKey, value string)
- func (s AttrSet) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttrKey ¶
type AttrKey int8
AttrKey represents an attribute key that may be applied to an AttrSet.
Its specific values are an implementation detail of this package; only use the named constants in client code.
const ( // Blocked indicates the version is blocked or disabled for resolution. // Its value is ignored; its presence is the indicator. // // In Cargo, this is equivalent to a version being "yanked". Blocked AttrKey = -0x01 // Deleted indicates the version has been deleted upstream. // Its value is ignored; its presence is the indicator. Deleted AttrKey = -0x02 // Error indicates that the version has an error when it has been fed to // the system (e.g. parsing, abstracting, building effective POM...) // This is not a resolution error, that would be stored in the resolved // graph, but an error during the ingestion step. // Its value is ignored; its presence is the indicator. The exact error // can be retrieved through the ingestion services (e.g. pacman, gopher...) Error AttrKey = -0x04 // Redirect indicates the version has been moved to a different version or package. // // In Maven, this is equivalent to a relocation version. Redirect AttrKey = 1 // Features represent clusters of optional dependencies which // are opted into as a set. // // In Cargo, this is a JSON map from the feature name to a list // of enabled dependencies/other features. Features AttrKey = 2 // DerivedFrom names another package from which this version is derived. // The presence of this attribute implies that this version is not a primary // form but is rather a derivative form in some context. // // NPM uses this to link a bundled dependency to its original package. DerivedFrom AttrKey = 3 // NativeLibrary specifies what native library this version links against. NativeLibrary AttrKey = 4 // Registries specifies the registries where the version can be found and // the registries in which the dependencies can be fetched. // In Maven, this is a comma separated list of registry IDs, and dependency // registries are prefixed with "dep:". Registries AttrKey = 5 // SupportedFrameworks specifies what dotnet target frameworks this // versions supports as a colon-separated list. Each element is the raw // string received from upstream. SupportedFrameworks AttrKey = 6 // DependencyGroups specifies what dotnet target framework dependencies // the package specifies as a colon-separated list. It includes // dependency groups that don't have any dependencies for that // framework. DependencyGroups AttrKey = 7 // Ident is a 16-byte UUID that uniquely identifies this immutable // version. Ident AttrKey = 8 // Created is the time the version was created as reported upstream. The // value is represented as a unix timestamp in seconds encoded as // varint. Created AttrKey = 9 // Tags is a comma separated list of other names this version is known // as, such as "latest" in npm. Tags AttrKey = 10 )
type AttrSet ¶
type AttrSet struct {
// contains filtered or unexported fields
}
AttrSet represents a set of version attributes. The zero value of AttrSet is an empty set.
func (AttrSet) ForEachAttr ¶
ForEachAttr calls f for each attribute.
func (AttrSet) HasAttr ¶
HasAttr reports whether the set has the given attribute. This is a convenience method when the key is used as a flag.
Click to show internal directories.
Click to hide internal directories.