|
| 1 | +// Copyright 2016 The Linux Foundation |
| 2 | +// |
| 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 | +package v2 |
| 16 | + |
| 17 | +import digest "github.com/opencontainers/go-digest" |
| 18 | + |
| 19 | +// Descriptor describes the disposition of targeted content. |
| 20 | +// This structure provides `application/vnd.oci.descriptor.v1+json` mediatype |
| 21 | +// when marshalled to JSON. |
| 22 | +type Descriptor struct { |
| 23 | + // MediaType is the media type of the object this schema refers to. |
| 24 | + MediaType string `json:"mediaType,omitempty"` |
| 25 | + |
| 26 | + // Digest is the digest of the targeted content. |
| 27 | + Digest digest.Digest `json:"digest"` |
| 28 | + |
| 29 | + // Size specifies the size in bytes of the blob. |
| 30 | + Size int64 `json:"size"` |
| 31 | + |
| 32 | + // URLs specifies a list of URLs from which this object MAY be downloaded |
| 33 | + URLs []string `json:"urls,omitempty"` |
| 34 | + |
| 35 | + // Annotations contains arbitrary metadata relating to the targeted content. |
| 36 | + Annotations map[string]string `json:"annotations,omitempty"` |
| 37 | + |
| 38 | + // Platform describes the platform which the image in the manifest runs on. |
| 39 | + // |
| 40 | + // This should only be used when referring to a manifest. |
| 41 | + Platform *Platform `json:"platform,omitempty"` |
| 42 | +} |
| 43 | + |
| 44 | +// Platform describes the platform which the image in the manifest runs on. |
| 45 | +type Platform struct { |
| 46 | + // Architecture field specifies the CPU architecture, for example |
| 47 | + // `amd64` or `ppc64`. |
| 48 | + Architecture string `json:"architecture"` |
| 49 | + |
| 50 | + // OS specifies the operating system, for example `linux` or `windows`. |
| 51 | + OS string `json:"os"` |
| 52 | + |
| 53 | + // OSVersion is an optional field specifying the operating system |
| 54 | + // version, for example on Windows `10.0.14393.1066`. |
| 55 | + OSVersion string `json:"os.version,omitempty"` |
| 56 | + |
| 57 | + // OSFeatures is an optional field specifying an array of strings, |
| 58 | + // each listing a required OS feature (for example on Windows `win32k`). |
| 59 | + OSFeatures []string `json:"os.features,omitempty"` |
| 60 | + |
| 61 | + // Variant is an optional field specifying a variant of the CPU, for |
| 62 | + // example `v7` to specify ARMv7 when architecture is `arm`. |
| 63 | + Variant string `json:"variant,omitempty"` |
| 64 | +} |
0 commit comments