| // Copyright 2025 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.internal; |
| |
| using fuchsia.pkg; |
| using fuchsia.url; |
| |
| |
| @discoverable |
| closed protocol OtaDownloader { |
| /// Fetches a blob from the given hash and base url. |
| /// |
| /// On success, the blob will be written to the filesystem, but not sync'd, client should call |
| /// `PackageCache.Sync` to guarantee blobs are persisted after all blobs are fetched. |
| /// |
| /// + request `hash` the hash of the blob to fetch. |
| /// + request `base_url` the base URL of the blob, the full URL of the blob will be |
| /// constructed as "$base_url/$delivery_blob_type/$hash". |
| /// * error indicates failure. See `fuchsia.pkg.ResolveError` for values and error |
| /// scenarios. |
| strict FetchBlob(struct { |
| hash fuchsia.pkg.BlobId; |
| base_url fuchsia.url.Url; |
| }) -> () error fuchsia.pkg.ResolveError; |
| }; |