Documentation
¶
Overview ¶
Package dagaddress parses and prints DAG addresses: URLs that select workspace artifacts.
[dag[+<type>[+<type>...]]://][<workspace>@<version>:][<path>][?<dimension>=<key>&...]
The scheme marks a workspace artifact address. Without it, the value is a relative address. In a relative address, ":" is accepted as a path separator for compatibility. In an absolute address, the first ":" after "@" ends the version, and later colons in the path are the old separator. Neither separator splits a key: the query is split off first.
Index ¶
Constants ¶
const Scheme = "dag"
Scheme is the URL scheme of a DAG address.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Address ¶
type Address struct {
// HasScheme reports whether the value started with "dag://" or "dag+type://".
HasScheme bool
// Types lists the "+<type>" segments of the scheme, in CLI case.
Types []string
// Absolute reports whether the value carried "<workspace>@<version>:".
Absolute bool
// Workspace is the Git address of the workspace, written as a Go import path.
Workspace string
// Version is the branch, tag, or commit of an absolute address.
Version string
// Path is the field path with "/" separators. It may be a pattern. Empty
// selects all artifacts.
Path string
// Query lists the dimension selectors in input order.
Query []Pair
}
Address is a parsed DAG address.
func Parse ¶
Parse parses value as a DAG address. A value with another URL scheme is an error: it is an external reference, not an artifact address.
func (*Address) DimensionFilters ¶
func (addr *Address) DimensionFilters() []DimensionFilter
DimensionFilters groups the query pairs by dimension, in first-seen order. A pair without a key makes the whole dimension match any key.
type DimensionFilter ¶
DimensionFilter groups the query by dimension: repeated dimensions are alternatives, and different dimensions combine with AND. Nil keys select any key in the dimension.