Documentation ¶
Overview ¶
Copyright The ORAS Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright The ORAS Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func Tags(ctx context.Context, repo Repository) ([]string, error)
- type Reference
- func (r Reference) Digest() (digest.Digest, error)
- func (r Reference) Host() string
- func (r Reference) ReferenceOrDefault() string
- func (r Reference) String() string
- func (r Reference) Validate() error
- func (r Reference) ValidateReference() error
- func (r Reference) ValidateRegistry() error
- func (r Reference) ValidateRepository() error
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Reference ¶
type Reference struct { // Registry is the name of the registry. // It is usually the domain name of the registry optionally with a port. Registry string // Repository is the name of the repository. Repository string // Reference is the reference of the object in the repository. // A reference can be a tag or a digest. Reference string }
Reference references to a descriptor in the registry.
func ParseReference ¶
ParseReference parses a string into a artifact reference. If the reference contains both the tag and the digest, the tag will be dropped. Digest is recognized only if the corresponding algorithm is available.
func (Reference) ReferenceOrDefault ¶
ReferenceOrDefault returns the reference or the default reference if empty.
func (Reference) String ¶
String implements `fmt.Stringer` and returns the reference string. The resulted string is meaningful only if the reference is valid.
func (Reference) ValidateReference ¶
ValidateReference validates the reference.
func (Reference) ValidateRegistry ¶
ValidateRegistry validates the registry.
func (Reference) ValidateRepository ¶
ValidateRepository validates the repository.
type Repository ¶
type Repository interface { // Tags lists the tags available in the repository. // Since the returned tag list may be paginated by the underlying // implementation, a function should be passed in to process the paginated // tag list. // Note: When implemented by a remote registry, the tags API is called. // However, not all registries supports pagination or conforms the // specification. // References: // - https://github.com/opencontainers/distribution-spec/blob/main/spec.md#content-discovery // - https://docs.docker.com/registry/spec/api/#tags // See also `Tags()` in this package. Tags(ctx context.Context, fn func(tags []string) error) error }
Repository is an ORAS target and an union of the blob and the manifest CASs. As specified by https://docs.docker.com/registry/spec/api/, it is natural to assume that content.Resolver interface only works for manifests. Tagging a blob may be resulted in an `ErrUnsupported` error. However, this interface does not restrict tagging blobs. Since a repository is an union of the blob and the manifest CASs, all operations defined in the `BlobStore` are executed depending on the media type of the given descriptor accordingly. Furthurmore, this interface also provides the ability to enforce the separation of the blob and the manifests CASs.