blob: e14dbaeef19b0880393cdb27d4c2c163ae1f2569 [file] [log] [blame]
// Copyright 2020 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.io;
/// A collection of TUF repositories contained in an attached storage device.
@discoverable
protocol LocalMirror {
/// Obtains and returns a named TUF metadata file from an attached storage
/// device.
///
/// + request `repo_url` the URL of the TUF repository for which to return
/// metadata.
/// + request `path` the path of the metadata file, relative to the
/// repository_metadata directory for the specific TUF repository.
/// + request `metadata` a pipelined TUF metadata file to be opened with
/// `fuchsia.io/OpenFlags.RIGHT_READABLE | fuchsia.io/OpenFlags.DESCRIBE`.
/// If the metadata directory exists but the requested file does not, the
/// client end will receive a fuchsia.io/Node.OnOpen with
/// `Status::NOT_FOUND`.
/// * error a `GetMetadataError` value
GetMetadata(resource struct {
repo_url RepositoryUrl;
path string:fuchsia.io.MAX_PATH;
metadata server_end:fuchsia.io.File;
}) -> (struct {}) error GetMetadataError;
/// Obtains and returns a blob from an attached storage device.
///
/// + request `blob_id` the id of the blob to return.
/// + request `blob` a pipelined blob file to be opened with
/// `fuchsia.io/OpenFlags.RIGHT_READABLE | fuchsia.io/OpenFlags.DESCRIBE`.
/// If the blobs directory exists but the requested file does not, the
/// client end will receive a fuchsia.io/Node.OnOpen with
/// `Status::NOT_FOUND`.
/// * error a `GetBlobError` value
GetBlob(resource struct {
blob_id BlobId;
blob server_end:fuchsia.io.File;
}) -> (struct {}) error GetBlobError;
};
/// Error type for [`fuchsia.pkg/LocalMirror.GetMetadata`].
type GetMetadataError = strict enum {
/// An error occurred when opening the requested metadata file. This may (though
/// does not necessarily) indicate the metadata directory does not exist.
ERROR_OPENING_METADATA = 1;
};
/// Error type for [`fuchsia.pkg/LocalMirror.GetBlob`].
type GetBlobError = strict enum {
/// An error occurred when opening the requested blob. This may (though
/// does not necessarily) indicate the blobs directory does not exist.
ERROR_OPENING_BLOB = 1;
};