MCPcopy Create free account
hub / github.com/NodeSeekDev/NodeGet / Rpc

Interface Rpc

server/src/rpc_nodeget.rs:35–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33/// 命名空间分隔符为 `_`(自定义 jsonrpsee fork)。
34#[rpc(server, namespace = "nodeget-server")]
35pub trait Rpc {
36 /// 返回服务器运行状态确认字符串
37 #[method(name = "hello")]
38 async fn hello(&self) -> String;
39
40 /// 返回服务器版本信息(语义化版本 + 构建信息)
41 #[method(name = "version")]
42 async fn version(&self) -> Value;
43
44 /// 返回服务器 UUID(从全局 Config 读取)
45 #[method(name = "uuid")]
46 async fn uuid(&self) -> String;
47
48 /// 读取服务器配置文件内容
49 ///
50 /// - token:身份认证凭据
51 #[method(name = "read_config")]
52 async fn read_config(&self, token: String) -> RpcResult<String>;
53
54 /// 编辑服务器配置文件并触发热重载
55 ///
56 /// - token:身份认证凭据
57 /// - `config_string`:完整的 TOML 配置文本
58 #[method(name = "edit_config")]
59 async fn edit_config(&self, token: String, config_string: String) -> RpcResult<bool>;
60
61 /// 查询数据库存储占用(表大小、行数等)
62 ///
63 /// - token:身份认证凭据
64 #[method(name = "database_storage")]
65 async fn database_storage(&self, token: String) -> RpcResult<Box<RawValue>>;
66
67 /// 查询内存日志缓冲区中的历史日志
68 ///
69 /// - token:身份认证凭据(需 Super Token)
70 #[method(name = "log")]
71 async fn log(&self, token: String) -> RpcResult<Box<RawValue>>;
72
73 /// 实时日志流订阅
74 ///
75 /// - token:身份认证凭据(需 Super Token)
76 /// - `log_filter`:`EnvFilter` 格式的过滤器字符串,如 `"info,server=debug"`
77 #[subscription(name = "stream_log", item = Value, unsubscribe = "unsubscribe_stream_log")]
78 async fn stream_log(&self, token: String, log_filter: String) -> SubscriptionResult;
79
80 /// 服务器二进制自更新
81 ///
82 /// - token:身份认证凭据(需 Super Token)
83 /// - tag:目标版本标签,如 `"v0.5.0"`
84 #[method(name = "self_update")]
85 async fn self_update(&self, token: String, tag: String) -> RpcResult<()>;
86
87 /// 执行原始 SQL 语句
88 ///
89 /// - token:身份认证凭据
90 /// - sql:SQL 语句文本
91 /// - params:可选的参数绑定(JSON 对象)
92 #[method(name = "exec_sql")]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected