Documentation
¶
Overview ¶
Package pluginreference defines plugin dependency declarations independently of registry transport, artifact resolution, and runtime loading.
Index ¶
- Constants
- func CheckDigest(digest string) error
- func IsOCI(source string) bool
- func LocalRegistryDirectory(raw string) (string, error)
- func NormalizeDigest(digest string) (string, bool)
- func NormalizeSource(source, directory string) (reference, local string, err error)
- func ValidAlias(name string) bool
- func ValidName(name string) bool
- func ValidRepository(name string) bool
- func ValidVersion(version string) bool
- type ModuleLocation
- type OCIReference
- func (r OCIReference) Digest() string
- func (r OCIReference) Endpoint() *url.URL
- func (r OCIReference) Host() string
- func (r OCIReference) Repository() string
- func (r OCIReference) String() string
- func (r OCIReference) Tag() string
- func (r OCIReference) WithDigest(digest string) (OCIReference, error)
- type Reference
- func (r Reference) CandidateDigest() string
- func (r Reference) DirectSource() string
- func (r Reference) Equal(other Reference) bool
- func (r Reference) IsAlias() bool
- func (r Reference) Name() string
- func (r Reference) Normalize() (Reference, error)
- func (r Reference) Registry() string
- func (r Reference) String() string
- func (r Reference) Version() string
Constants ¶
const DefaultRegistry = "https://plugins.actionlint.kjanat.dev/"
DefaultRegistry is the public actionlint plugin catalogue.
Variables ¶
This section is empty.
Functions ¶
func CheckDigest ¶
CheckDigest accepts a SHA256 digest written as 64 lowercase hex digits, the canonical form of OCI digests and sha256:// cache addresses.
func LocalRegistryDirectory ¶
LocalRegistryDirectory accepts an explicit absolute file URI. Local candidate catalogues have no authenticated publisher and cannot substitute for HTTPS registries.
func NormalizeDigest ¶
NormalizeDigest accepts a SHA256 digest written as 64 hex digits in either case and returns it in lowercase. URL pins (#sha256=<hex>) and candidate digests use it; content addresses, which must already be canonical, use CheckDigest.
func NormalizeSource ¶
NormalizeSource roots filesystem paths in directory while preserving URI identity, including queries and digest pins. local is empty for remote URLs; otherwise it identifies the local file consumed by the artifact resolver. It validates the location without reading files or making network requests.
func ValidAlias ¶
ValidAlias checks the shared catalogue and declaration shorthand syntax.
func ValidName ¶
ValidName accepts a repository selector or a package beneath its GitHub repository. GitLab's nested namespaces already share this path grammar; authenticated catalogue evidence establishes its repository boundary.
func ValidRepository ¶
ValidRepository validates forge-qualified repository paths for declarations and catalogue identities.
func ValidVersion ¶
ValidVersion accepts exact release tags, including slash-separated tag names.
Types ¶
type ModuleLocation ¶
type ModuleLocation struct {
// Endpoint is the URI without its fragment. It is nil for a filesystem
// path.
Endpoint *url.URL
// Local is the filesystem path the location names. It is empty for an
// http, https or sha256 URI.
Local string
// Pin is the lowercase hex SHA256 digest the location pins with
// #sha256=<hex>, or the digest a sha256 URI names. It is empty when the
// location pins nothing.
Pin string
}
ModuleLocation is a parsed WebAssembly module or tool provider package location that is not an oci:// reference: a filesystem path, or a file, http, https or sha256 URI. Parsing reads no files and makes no requests.
func ParseModuleLocation ¶
func ParseModuleLocation(source string) (ModuleLocation, error)
ParseModuleLocation parses source as a filesystem path or a file, http, https or sha256 URI. Only explicit :// locations are URIs, so drive paths and colons in ordinary filenames stay paths on every host. It refuses credentials in URIs, malformed digest pins and other schemes, including oci.
func (ModuleLocation) File ¶
func (l ModuleLocation) File(directory string) string
File returns the local file the location names. A relative filesystem path is rooted in directory and a filesystem path is cleaned; a file URI's path is returned as parsed. File returns "" for a remote location.
type OCIReference ¶
type OCIReference struct {
// contains filtered or unexported fields
}
OCIReference is a parsed oci:// source: oci://<host>/<repository> with either @sha256:<hex> naming the root image index or manifest, or :<tag>. Only plugin install accepts a tag, which it resolves to a digest.
func ParseOCI ¶
func ParseOCI(source string) (OCIReference, error)
ParseOCI parses oci://<host>/<repository>@sha256:<hex> and refuses a tag.
func ParseOCITag ¶
func ParseOCITag(source string) (OCIReference, error)
ParseOCITag parses oci://<host>/<repository>:<tag> or a digest reference. Only plugin install accepts a tag, which it resolves to a digest.
func (OCIReference) Digest ¶
func (r OCIReference) Digest() string
Digest returns the SHA256 hex of the root index or manifest, or "" for a tag reference.
func (OCIReference) Endpoint ¶
func (r OCIReference) Endpoint() *url.URL
Endpoint returns the HTTP authority used by the OCI client. Loopback sources use plain HTTP like Docker; public-only policy still rejects their addresses.
func (OCIReference) Host ¶
func (r OCIReference) Host() string
Host returns the registry host, with its port if the source names one.
func (OCIReference) Repository ¶
func (r OCIReference) Repository() string
Repository returns the repository name within the registry.
func (OCIReference) String ¶
func (r OCIReference) String() string
String returns the normalized source.
func (OCIReference) Tag ¶
func (r OCIReference) Tag() string
Tag returns the tag of a tag reference, or "" for a digest reference.
func (OCIReference) WithDigest ¶
func (r OCIReference) WithDigest(digest string) (OCIReference, error)
WithDigest returns the digest reference to the same repository.
type Reference ¶
type Reference struct {
// contains filtered or unexported fields
}
Reference declares a registry alias or repository, requested release, and catalogue. Only Parse, New and NewCandidate build one, so values remain normalized. The zero Reference declares nothing.
func New ¶
New validates and normalizes a plugin declaration. Empty version and registry select latest stable and DefaultRegistry respectively.
func NewCandidate ¶
NewCandidate binds an exact canonical package from an explicit local registry to the SHA256 digest verified during installation.
func ParsePluginReference ¶
ParsePluginReference accepts an alias, owner/repo or forge-qualified repository/package, optionally followed by @latest or an exact release tag.
func (Reference) CandidateDigest ¶
CandidateDigest binds a local candidate declaration to one verified artifact. It is empty for unpinned local install requests and published registries.
func (Reference) DirectSource ¶
DirectSource returns a SHA-pinned artifact URL or oci:// digest reference, or empty for registry entries. Direct declarations already contain their immutable pin and need no lock row.
func (Reference) IsAlias ¶
IsAlias reports a registry-assigned shorthand, whose repository is resolved by that registry and recorded in the project lock.
func (Reference) Name ¶
Name returns the registry alias or forge-qualified repository. For a direct declaration it returns the artifact URL without its #sha256= pin.
func (Reference) Registry ¶
Registry returns the normalized catalogue URL, ending in "/". It is empty for a direct declaration.