• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

oasisprotocol / oasis-core / #6052

20 May 2025 12:50PM UTC coverage: 47.655% (-0.03%) from 47.681%
#6052

Pull #6197

kostko
go/runtime: Add log manager
Pull Request #6197: go/runtime: Add log manager

0 of 3 new or added lines in 2 files covered. (0.0%)

1 existing line in 1 file now uncovered.

4563 of 9575 relevant lines covered (47.66%)

1.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/runtime/src/host/log_manager.rs
1
use std::collections::BTreeMap;
2

3
use async_trait::async_trait;
4

5
use crate::protocol::Protocol;
6

7
use super::{host_rpc_call, Error};
8

9
/// Name of the local RPC endpoint for the log manager.
10
pub const LOCAL_RPC_ENDPOINT_LOG_MANAGER: &str = "log-manager";
11

12
/// Name of the LogGet method.
13
pub const METHOD_LOG_GET: &str = "LogGet";
14

15
/// Log manager interface.
16
#[async_trait]
17
pub trait LogManager: Send + Sync {
18
    /// Request to host to fetch logs.
19
    ///
20
    /// The `PermissionLogView` permission is required to call this method.
21
    async fn log_get(&self, args: LogGetRequest) -> Result<LogGetResponse, Error>;
22
}
23

24
#[async_trait]
25
impl LogManager for Protocol {
NEW
26
    async fn log_get(&self, args: LogGetRequest) -> Result<LogGetResponse, Error> {
×
NEW
27
        host_rpc_call(self, LOCAL_RPC_ENDPOINT_LOG_MANAGER, METHOD_LOG_GET, args).await
×
28
    }
29
}
30

31
/// Request to add a volume.
32
///
33
/// The `PermissionVolumeAdd` permission is required to call this method.
34
#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
35
pub struct LogGetRequest {
36
    /// Labels to filter the bundles by. All labels must match and only the first bundle is used.
37
    pub labels: BTreeMap<String, String>,
38
    /// Identifier of the component in the bundle.
39
    pub component_id: String,
40
}
41

42
/// Response from the LogGet method.
43
#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
44
pub struct LogGetResponse {
45
    /// Log lines for the given component.
46
    pub logs: Vec<String>,
47
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc