mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-06 16:06:08 +00:00
Expose bounded usage readers through Admin, Store, Runtime, and SDK. Preserve snapshot consistency, coverage metadata, cancellation, and parent-call cleanup. Co-authored-by: Zyy <zyycn@users.noreply.github.com> Co-authored-by: Codex <noreply@openai.com>
33 lines
1.2 KiB
Rust
33 lines
1.2 KiB
Rust
//! 通用用量端口的插件管理测试夹具,非本测试调用路径禁止访问
|
|
use super::TestPluginPorts;
|
|
use gateway_admin::{model::usage_data::*, ports::usage_data::*};
|
|
#[async_trait::async_trait]
|
|
impl UsageDataStore for TestPluginPorts {
|
|
async fn open_read(
|
|
&self,
|
|
_: UsageReadQuery,
|
|
_: gateway_core::lifecycle::CancellationToken,
|
|
) -> UsageDataResult<Box<dyn UsageReadSession>> {
|
|
Err(UsageDataError::unavailable("test usage reader unavailable"))
|
|
}
|
|
|
|
async fn get_record(&self, _: GetUsageRecord) -> UsageDataResult<UsageRecord> {
|
|
unreachable!("unexpected usage call")
|
|
}
|
|
async fn list_records(&self, _: ListUsageRecords) -> UsageDataResult<UsageRecordPage> {
|
|
unreachable!("unexpected usage call")
|
|
}
|
|
async fn write_records(&self, _: StoredUsageWrite) -> UsageDataResult<UsageWriteResult> {
|
|
unreachable!("unexpected usage call")
|
|
}
|
|
async fn list_aggregates(&self, _: ListUsageAggregates) -> UsageDataResult<UsageAggregatePage> {
|
|
unreachable!("unexpected usage call")
|
|
}
|
|
async fn write_aggregates(
|
|
&self,
|
|
_: StoredAggregateWrite,
|
|
) -> UsageDataResult<UsageAggregateWriteResult> {
|
|
unreachable!("unexpected usage call")
|
|
}
|
|
}
|