Skip to content

Commit

Permalink
update code comments
Browse files Browse the repository at this point in the history
Signed-off-by: nhu1997 <[email protected]>
  • Loading branch information
nhu1997 committed Nov 2, 2024
1 parent 9d820cb commit 814b198
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 90 deletions.
168 changes: 84 additions & 84 deletions src/OrasProject.Oras/Oci/MediaType.cs
Original file line number Diff line number Diff line change
@@ -1,84 +1,84 @@
// 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.

namespace OrasProject.Oras.Oci;

public static class MediaType
{
/// <summary>
/// Descriptor specifies the media type for a content descriptor.
/// </summary>
public const string Descriptor = "application/vnd.oci.descriptor.v1+json";

/// <summary>
/// LayoutHeader specifies the media type for the oci-layout.
/// </summary>
public const string LayoutHeader = "application/vnd.oci.layout.header.v1+json";

/// <summary>
/// ImageIndex specifies the media type for an image index.
/// </summary>
public const string ImageIndex = "application/vnd.oci.image.index.v1+json";

/// <summary>
/// ImageManifest specifies the media type for an image manifest.
/// </summary>
public const string ImageManifest = "application/vnd.oci.image.manifest.v1+json";

/// <summary>
/// ImageConfig specifies the media type for the image configuration.
/// </summary>
public const string ImageConfig = "application/vnd.oci.image.config.v1+json";

/// <summary>
/// EmptyJSON specifies the media type for an unused blob containing the value "{}".
/// </summary>
public const string EmptyJson = "application/vnd.oci.empty.v1+json";

/// <summary>
/// ImageLayer is the media type used for layers referenced by the manifest.
/// </summary>
public const string ImageLayer = "application/vnd.oci.image.layer.v1.tar";

/// <summary>
/// ImageLayerGzip is the media type used for gzipped layers
/// referenced by the manifest.
/// </summary>
public const string ImageLayerGzip = "application/vnd.oci.image.layer.v1.tar+gzip";

/// <summary>
/// ImageLayerZstd is the media type used for zstd compressed
/// layers referenced by the manifest.
/// </summary>
public const string ImageLayerZstd = "application/vnd.oci.image.layer.v1.tar+zstd";

/// <summary>
/// ImageLayerNonDistributable is the media type for layers referenced by
/// the manifest but with distribution restrictions.
/// </summary>
public const string ImageLayerNonDistributable = "application/vnd.oci.image.layer.nondistributable.v1.tar";

/// <summary>
/// ImageLayerNonDistributableGzip is the media type for
/// gzipped layers referenced by the manifest but with distribution
/// restrictions.
/// </summary>
public const string ImageLayerNonDistributableGzip = "application/vnd.oci.image.layer.nondistributable.v1.tar+gzip";

/// <summary>
/// ImageLayerNonDistributableZstd is the media type for zstd
/// compressed layers referenced by the manifest but with distribution
/// restrictions.
/// </summary>
public const string ImageLayerNonDistributableZstd = "application/vnd.oci.image.layer.nondistributable.v1.tar+zstd";
}
// 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.

namespace OrasProject.Oras.Oci;

public static class MediaType
{
/// <summary>
/// Descriptor specifies the media type for a content descriptor.
/// </summary>
public const string Descriptor = "application/vnd.oci.descriptor.v1+json";

/// <summary>
/// LayoutHeader specifies the media type for the oci-layout.
/// </summary>
public const string LayoutHeader = "application/vnd.oci.layout.header.v1+json";

/// <summary>
/// ImageIndex specifies the media type for an image index.
/// </summary>
public const string ImageIndex = "application/vnd.oci.image.index.v1+json";

/// <summary>
/// ImageManifest specifies the media type for an image manifest.
/// </summary>
public const string ImageManifest = "application/vnd.oci.image.manifest.v1+json";

/// <summary>
/// ImageConfig specifies the media type for the image configuration.
/// </summary>
public const string ImageConfig = "application/vnd.oci.image.config.v1+json";

/// <summary>
/// EmptyJSON specifies the media type for an unused blob containing the value "{}".
/// </summary>
public const string EmptyJson = "application/vnd.oci.empty.v1+json";

/// <summary>
/// ImageLayer is the media type used for layers referenced by the manifest.
/// </summary>
public const string ImageLayer = "application/vnd.oci.image.layer.v1.tar";

/// <summary>
/// ImageLayerGzip is the media type used for gzipped layers
/// referenced by the manifest.
/// </summary>
public const string ImageLayerGzip = "application/vnd.oci.image.layer.v1.tar+gzip";

/// <summary>
/// ImageLayerZstd is the media type used for zstd compressed
/// layers referenced by the manifest.
/// </summary>
public const string ImageLayerZstd = "application/vnd.oci.image.layer.v1.tar+zstd";

/// <summary>
/// ImageLayerNonDistributable is the media type for layers referenced by
/// the manifest but with distribution restrictions.
/// </summary>
public const string ImageLayerNonDistributable = "application/vnd.oci.image.layer.nondistributable.v1.tar";

/// <summary>
/// ImageLayerNonDistributableGzip is the media type for
/// gzipped layers referenced by the manifest but with distribution
/// restrictions.
/// </summary>
public const string ImageLayerNonDistributableGzip = "application/vnd.oci.image.layer.nondistributable.v1.tar+gzip";

/// <summary>
/// ImageLayerNonDistributableZstd is the media type for zstd
/// compressed layers referenced by the manifest but with distribution
/// restrictions.
/// </summary>
public const string ImageLayerNonDistributableZstd = "application/vnd.oci.image.layer.nondistributable.v1.tar+zstd";
}
6 changes: 2 additions & 4 deletions src/OrasProject.Oras/Pack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ public static class Pack
/// </summary>
public enum PackManifestVersion
{
// PackManifestVersion1_0 represents the OCI Image Manifest defined in
// image-spec v1.0.2.
// PackManifestVersion1_0 represents the OCI Image Manifest defined in image-spec v1.0.2.
// Reference: https://github.com/opencontainers/image-spec/blob/v1.0.2/manifest.md
PackManifestVersion1_0 = 1,
// PackManifestVersion1_1 represents the OCI Image Manifest defined in
// image-spec v1.1.0.
// PackManifestVersion1_1 represents the OCI Image Manifest defined in image-spec v1.1.0.
// Reference: https://github.com/opencontainers/image-spec/blob/v1.1.0/manifest.md
PackManifestVersion1_1 = 2
}
Expand Down
4 changes: 2 additions & 2 deletions src/OrasProject.Oras/PackManifestOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public struct PackManifestOptions
public static PackManifestOptions None { get; }

Check warning on line 23 in src/OrasProject.Oras/PackManifestOptions.cs

View check run for this annotation

Codecov / codecov/patch

src/OrasProject.Oras/PackManifestOptions.cs#L23

Added line #L23 was not covered by tests

/// <summary>
/// Config is references a configuration object for a container, by digest
/// Config references a configuration object for a container, by digest
/// For more details: https://github.com/opencontainers/image-spec/blob/v1.1.0/manifest.md#:~:text=This%20REQUIRED%20property%20references,of%20the%20reference%20code.
/// </summary>
public Descriptor Config { get; set; }

/// <summary>
/// Layers is the layers of the manifest
/// Layers is an array of objects, and each object id a Content Descriptor (or simply Descriptor)
/// For more details: https://github.com/opencontainers/image-spec/blob/v1.1.0/manifest.md#:~:text=Each%20item%20in,the%20layers.
/// </summary>
public IList<Descriptor>? Layers { get; set; }
Expand Down

0 comments on commit 814b198

Please sign in to comment.