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