pub mod http1;
use gateway_common::{error::BoxError, FusenFuture};
#[derive(Clone, Debug)]
pub enum ProtocolType {
HTTP,
HTTP2,
HTTP3,
}
#[derive(Clone)]
pub struct Protocol {
p_type: ProtocolType,
port: String,
}
impl Protocol {
pub fn new(p_type: ProtocolType, port: String) -> Self {
Self { p_type, port }
}
pub fn get_port(&self) -> &String {
&self.port
}
pub fn get_type(&self) -> &ProtocolType {
&self.p_type
}
}
pub trait StreamHandler: Send + Sync {
fn handler(self) -> FusenFuture<Result<(), BoxError>>;
fn boxed(self) -> Box<dyn StreamHandler>;
}