Documentation
¶
Overview ¶
Package artifact defines artifact metadata shared by the engine and CLI.
Index ¶
- Constants
- func IsStaticDimension(identifier string) bool
- func MatchTypeKey(candidates []string, key string) []string
- func ResolveTypeKey(candidates Paths, name, key string) ([]string, error)
- func ShortTypeKey(candidates []string, path string) string
- type Dimension
- type Dimensions
- type Path
- type Paths
Constants ¶
const ModuleDimension = "module"
Variables ¶
This section is empty.
Functions ¶
func IsStaticDimension ¶
IsStaticDimension identifies keys available without loading collections.
func MatchTypeKey ¶
MatchTypeKey lists the candidates a type key names: the path it equals, and each path it is a suffix of, on segment boundaries. A leading "/" accepts only a full path.
func ResolveTypeKey ¶
ResolveTypeKey lists the full paths a type key selects among candidates. A key that names several paths selects them all, such as every staleness check. But a key that names both an operation on each item of a collection and the same operation on the collection's batch, such as up on each service and up on a batch of services, would run it twice: that is an error that lists the paths, never their union.
func ShortTypeKey ¶
ShortTypeKey is the shortest suffix of path that names only path among the candidates. Without one, it is the full path, or the full path with a leading "/" when that is also the suffix of a longer candidate. It is a projection: adding a path to the schema can lengthen it.
Types ¶
type Dimension ¶
type Dimension struct {
Kind string
CollectionType string
Identifier string `field:"true" doc:"Stable identifier: collection schema path, type:TypeName for an artifact type, or module."`
Name string `field:"true" doc:"Short name used to select this dimension."`
QualifiedName string `field:"true" doc:"Qualified name used when the short name is ambiguous."`
ItemType string `field:"true" doc:"The collection item or artifact type name, or empty for the module dimension."`
KeyName string `field:"true" doc:"The collection key argument name, or name for a static dimension."`
KeyDescription string `field:"true" doc:"The collection key argument description, or empty for a static dimension."`
}
Dimension describes a schema axis, independent of its runtime keys.
type Dimensions ¶
type Dimensions []*Dimension
Dimensions is the set of dimensions in a selected schema scope.
func Union ¶
func Union(sets ...Dimensions) Dimensions
Union combines dimension sets, sorted by identifier.
func (Dimensions) DisplayName ¶
func (dims Dimensions) DisplayName(dim *Dimension) string
DisplayName returns the shortest unambiguous name for a dimension.
type Path ¶
type Path struct {
// Type is the type dimension identifier, such as type:Check.
Type string
Key string
Module string
// Dimensions are collection dimension identifiers, parent to child.
Dimensions []string
}
Path is one schema path in a type dimension: the full path its type key holds, and the collection dimensions an address for it must key.
type Paths ¶
type Paths []Path
Paths indexes the schema paths of every loaded module, so a type key names one path in a workspace whatever the selection.
func UnionPaths ¶
UnionPaths combines path sets, dropping duplicates.
func (Paths) CandidatePaths ¶
CandidatePaths is Candidates with each path's dimensions.