oras.land/oras-go/v2@v2.5.1-0.20240520045656-aef90e4d04c4/internal/spec/artifact.go (about) 1 /* 2 Copyright The ORAS Authors. 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 */ 15 16 package spec 17 18 import ocispec "github.com/opencontainers/image-spec/specs-go/v1" 19 20 const ( 21 // AnnotationArtifactCreated is the annotation key for the date and time on which the artifact was built, conforming to RFC 3339. 22 AnnotationArtifactCreated = "org.opencontainers.artifact.created" 23 24 // AnnotationArtifactDescription is the annotation key for the human readable description for the artifact. 25 AnnotationArtifactDescription = "org.opencontainers.artifact.description" 26 27 // AnnotationReferrersFiltersApplied is the annotation key for the comma separated list of filters applied by the registry in the referrers listing. 28 AnnotationReferrersFiltersApplied = "org.opencontainers.referrers.filtersApplied" 29 ) 30 31 // MediaTypeArtifactManifest specifies the media type for a content descriptor. 32 const MediaTypeArtifactManifest = "application/vnd.oci.artifact.manifest.v1+json" 33 34 // Artifact describes an artifact manifest. 35 // This structure provides `application/vnd.oci.artifact.manifest.v1+json` mediatype when marshalled to JSON. 36 // 37 // This manifest type was introduced in image-spec v1.1.0-rc1 and was removed in 38 // image-spec v1.1.0-rc3. It is not part of the current image-spec and is kept 39 // here for Go compatibility. 40 // 41 // Reference: https://github.com/opencontainers/image-spec/pull/999 42 type Artifact struct { 43 // MediaType is the media type of the object this schema refers to. 44 MediaType string `json:"mediaType"` 45 46 // ArtifactType is the IANA media type of the artifact this schema refers to. 47 ArtifactType string `json:"artifactType"` 48 49 // Blobs is a collection of blobs referenced by this manifest. 50 Blobs []ocispec.Descriptor `json:"blobs,omitempty"` 51 52 // Subject (reference) is an optional link from the artifact to another manifest forming an association between the artifact and the other manifest. 53 Subject *ocispec.Descriptor `json:"subject,omitempty"` 54 55 // Annotations contains arbitrary metadata for the artifact manifest. 56 Annotations map[string]string `json:"annotations,omitempty"` 57 }