mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
33 lines
991 B
Rust
33 lines
991 B
Rust
use rpc_toolkit::{Context, HandlerExt, ParentHandler, from_fn_async};
|
|
|
|
use crate::context::CliContext;
|
|
use crate::prelude::*;
|
|
use crate::util::serde::HandlerExtSerde;
|
|
|
|
pub const SIG_CONTEXT: &str = "startos";
|
|
|
|
pub mod asset;
|
|
pub mod index;
|
|
pub mod version;
|
|
|
|
pub fn os_api<C: Context>() -> ParentHandler<C> {
|
|
ParentHandler::new()
|
|
.subcommand(
|
|
"index",
|
|
from_fn_async(index::get_os_index)
|
|
.with_metadata("authenticated", Value::Bool(false))
|
|
.with_display_serializable()
|
|
.with_about("List index of OS versions")
|
|
.with_call_remote::<CliContext>(),
|
|
)
|
|
.subcommand(
|
|
"asset",
|
|
asset::asset_api::<C>().with_about("Commands to add, sign, or get registry assets"),
|
|
)
|
|
.subcommand(
|
|
"version",
|
|
version::version_api::<C>()
|
|
.with_about("Commands to add, remove, or list versions or version signers"),
|
|
)
|
|
}
|