| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.pkg; |
| |
| using fuchsia.url; |
| |
| /// A content-addressed merkle root that describes an artifact that is tracked by the |
| /// packaging system. |
| type BlobId = struct { |
| merkle_root array<uint8, 32>; |
| }; |
| |
| /// A tuple of the content-addressed merkle root for an artifact, along with that |
| /// artifact's length in bytes. |
| type BlobInfo = struct { |
| blob_id BlobId; |
| length uint64; |
| }; |
| |
| /// A fuchsia-pkg:// URL indicating a package. |
| /// https://fuchsia.dev/fuchsia-src/concepts/packages/package_url#package_identity |
| type PackageUrl = struct { |
| url string:fuchsia.url.MAX_URL_LENGTH; |
| }; |
| |
| /// A fuchsia-pkg:// URL indicating a repository. |
| /// https://fuchsia.dev/fuchsia-src/concepts/packages/package_url#repository_identity |
| type RepositoryUrl = struct { |
| url string:fuchsia.url.MAX_URL_LENGTH; |
| }; |
| |
| /// A single entry in the package index. |
| type PackageIndexEntry = struct { |
| package_url PackageUrl; |
| meta_far_blob_id BlobId; |
| }; |
| |
| /// A package resolution context, used when resolving package URLs relative to |
| /// another package. |
| type ResolutionContext = struct { |
| bytes vector<uint8>:MAX_RESOLUTION_CONTEXT_SIZE; |
| }; |
| |
| // TODO(https://fxbug.dev/42050722): Change this length to something smaller once |
| // fuchsia.pkg implements subpackages, assuming fuchsia.pkg implements the |
| // package context value as a much smaller lookup key (such as a package hash to |
| // the package containing the subpackage map). Make a related change to |
| // the component's MAX_RESOLUTION_CONTEXT_SIZE in |
| // //sdk/fidl/fuchsia.component.resolution/component.fidl |
| |
| /// The maximum number of bytes for a `ResolutionContext`. |
| /// |
| /// Note that this value must be less than or equal to |
| /// `fuchsia.component.resolution::MAX_RESOLUTION_CONTEXT_SIZE`, since the |
| /// component resolver is expected to copy or contain the context provided by |
| /// the package resolver. |
| const MAX_RESOLUTION_CONTEXT_SIZE uint32 = 8192; |