cue-labs / oci

Go modules related to OCI (Open Container Initiative) registries
Apache License 2.0
23 stars 4 forks source link

ociref: new package #8

Closed rogpeppe closed 1 year ago

rogpeppe commented 1 year ago

This is the start of implementing the package described in issue #7.

I started with the regular expressions defined in the distribution reference package at commit 97b1d649c4938d0f608d96454d6a8326b1f96acd and worked from there.

I made a few changes, some or all of which may be misguided :)

The most significant of the changes is that a reference of the form a/b is parsed as the (relative) repository name a/b rather than host a followed by repository b. This means that it's always unambiguous whether a reference is relative or absolute.

The distinction is made based on whether the first component is unambiguously a host name; specifically one of:

rogpeppe commented 1 year ago

landed directly (unintentionally, but might as well go with it)