1use anyhow::Result;
11use async_trait::async_trait;
12use oxios_gateway::plugin::{ChannelBundle, ChannelContext, ChannelPlugin};
13
14use crate::channel::CliChannel;
15
16pub struct CliPlugin;
18
19impl CliPlugin {
20 pub fn new() -> Self {
22 Self
23 }
24}
25
26impl Default for CliPlugin {
27 fn default() -> Self {
28 Self::new()
29 }
30}
31
32#[async_trait]
33impl ChannelPlugin for CliPlugin {
34 fn name(&self) -> &str {
35 "cli"
36 }
37
38 async fn setup(&self, _ctx: ChannelContext) -> Result<ChannelBundle> {
39 let channel = CliChannel::new(256);
40 Ok(ChannelBundle {
41 channel: Box::new(channel),
42 tasks: vec![],
43 })
44 }
45}