blob: ea3cb9cf298e49e39c6a8ff5fd07d4b65ae0de84 [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.sys2;
using fuchsia.component;
using fuchsia.io2;
/// Declares a capability defined by this component.
flexible union CapabilityDecl {
1: ServiceDecl service;
2: ProtocolDecl protocol;
3: DirectoryDecl directory;
4: StorageDecl storage;
5: RunnerDecl runner;
6: ResolverDecl resolver;
};
/// Declares a service capability backed by this component.
///
/// To learn more about services, see:
/// https://fuchsia.dev/fuchsia-src/glossary#service
table ServiceDecl {
/// The name of this service.
1: fuchsia.component.name name;
/// The path to the service in the component's outgoing directory.
2: string:fuchsia.component.MAX_PATH_LENGTH source_path;
};
/// Declares a protocol capability backed by this component.
///
/// To learn more about protocols, see:
/// https://fuchsia.dev/fuchsia-src/glossary#protocol
table ProtocolDecl {
/// The name of this protocol.
1: fuchsia.component.name name;
/// The path to the protocol in the component's outgoing directory.
2: string:fuchsia.component.MAX_PATH_LENGTH source_path;
};
/// Declares a directory capability backed by this component.
///
/// To learn more about directories, see:
/// https://fuchsia.dev/fuchsia-src/glossary#directory
table DirectoryDecl {
/// The name of this directory.
1: fuchsia.component.name name;
/// The path to the directory in the component's outgoing directory.
2: string:fuchsia.component.MAX_PATH_LENGTH source_path;
/// The maximum rights that can be set by a component using this directory.
3: fuchsia.io2.Rights rights;
};
/// Declares a storage capability backed by a directory from which data, cache,
/// or meta storage can be offered.
table StorageDecl {
/// The name of this storage
1: fuchsia.component.name name;
/// The provider of the backing directory capability relative to the
/// component itself. Must be `parent`, `self`, or `child`.
2: Ref source;
/// The name of the directory capability from `source` that backs the
/// storage.
3: fuchsia.component.name backing_dir;
/// The subdirectory of the source directory that will back the storage
4: string:fuchsia.component.MAX_PATH_LENGTH subdir;
};
/// Declares a runner capability backed by a service.
table RunnerDecl {
/// The name of this runner.
1: fuchsia.component.name name;
/// The provider of the underlying service relative to the component itself.
/// Must be `parent`, `self`, or `child`.
2: Ref source;
/// The path of the capability within the specified source.
3: string:fuchsia.component.MAX_PATH_LENGTH source_path;
};
/// Declares a resolver which is responsible for resolving component URLs to actual components.
/// See `fuchsia.sys2.ComponentResolver` for the protocol resolvers are expected to implement.
table ResolverDecl {
/// The name of this resolver.
/// Must be non-empty, unique among resolvers declared in the same `ComponentDecl`, and
/// contain only the following characters: [a-z0-9-_.].
1: fuchsia.component.name name;
/// The path of the capability in the declaring component's namespace.
2: string:fuchsia.component.MAX_PATH_LENGTH source_path;
};