use zentinel_agent_protocol::RequestMetadata;
use zentinel_common::CorrelationId;
pub struct AgentCallContext {
pub correlation_id: CorrelationId,
pub metadata: RequestMetadata,
pub route_id: Option<String>,
pub upstream_id: Option<String>,
pub request_body: Option<Vec<u8>>,
pub response_body: Option<Vec<u8>>,
}
impl AgentCallContext {
pub fn new(correlation_id: CorrelationId, metadata: RequestMetadata) -> Self {
Self {
correlation_id,
metadata,
route_id: None,
upstream_id: None,
request_body: None,
response_body: None,
}
}
pub fn with_route_id(mut self, route_id: impl Into<String>) -> Self {
self.route_id = Some(route_id.into());
self
}
pub fn with_upstream_id(mut self, upstream_id: impl Into<String>) -> Self {
self.upstream_id = Some(upstream_id.into());
self
}
}