forked from TrueCloudLab/distribution
ddfd2335c7
There seems to be a need for a type that represents a way of pointing to an image, irrespective of the implementation. This patch defines a Reference interface and provides 3 implementations: - TagReference: when only a tag is provided - DigestReference: when a digest (according to the digest package) is provided, can include optional tag as well Validation of references are purely syntactic. There is also a strong type for tags, analogous to digests, as well as a strong type for Repository from which clients can access the hostname alone, or the repository name without the hostname, or both together via the String() method. For Repository, the files names.go and names_test.go were moved from the v2 package. Update regexp to support repeated dash and double underscore Add field type for serialization Since reference itself may be represented by multiple types which implement the reference inteface, serialization can lead to ambiguous type which cannot be deserialized. Field wraps the reference object to ensure that the correct type is always deserialized, requiring an extra unwrap of the reference after deserialization. Signed-off-by: Tibor Vass <tibor@docker.com> Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan) |
||
---|---|---|
.. | ||
auth | ||
transport | ||
blob_writer.go | ||
blob_writer_test.go | ||
errors.go | ||
repository.go | ||
repository_test.go |