use anyhow::Result;
use async_trait::async_trait;
use oxios_gateway::plugin::{ChannelBundle, ChannelContext, ChannelPlugin};
use crate::channel::CliChannel;
pub struct CliPlugin;
impl CliPlugin {
pub fn new() -> Self {
Self
}
}
impl Default for CliPlugin {
fn default() -> Self {
Self::new()
}
}
#[async_trait]
impl ChannelPlugin for CliPlugin {
fn name(&self) -> &str {
"cli"
}
async fn setup(&self, _ctx: ChannelContext) -> Result<ChannelBundle> {
let channel = CliChannel::new(256);
Ok(ChannelBundle {
channel: Box::new(channel),
tasks: vec![],
})
}
}