Skip to content

Commit

Permalink
[wip] Using the dispatcher... taking notes
Browse files Browse the repository at this point in the history
Signed-off-by: dd di cesare <[email protected]>
  • Loading branch information
didierofrivia committed Aug 30, 2024
1 parent 1d41b6a commit 76ae9be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/filter/http_context.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::action_dispatcher::ActionDispatcher;
use crate::configuration::{FailureMode, FilterConfig};
use crate::envoy::{RateLimitResponse, RateLimitResponse_Code};
use crate::policy::Policy;
Expand All @@ -14,6 +15,7 @@ pub struct Filter {
pub config: Rc<FilterConfig>,
pub response_headers_to_add: Vec<(String, String)>,
pub header_resolver: Rc<HeaderResolver>,
pub action_dispatcher: Rc<ActionDispatcher>,

Check warning on line 18 in src/filter/http_context.rs

View workflow job for this annotation

GitHub Actions / Check

field `action_dispatcher` is never read

Check failure on line 18 in src/filter/http_context.rs

View workflow job for this annotation

GitHub Actions / Clippy

field `action_dispatcher` is never read

Check warning on line 18 in src/filter/http_context.rs

View workflow job for this annotation

GitHub Actions / Rustfmt

field `action_dispatcher` is never read

Check warning on line 18 in src/filter/http_context.rs

View workflow job for this annotation

GitHub Actions / Test Suite

field `action_dispatcher` is never read

Check warning on line 18 in src/filter/http_context.rs

View workflow job for this annotation

GitHub Actions / Test Suite

field `action_dispatcher` is never read
}

impl Filter {
Expand All @@ -40,6 +42,9 @@ impl Filter {
return Action::Continue;
}

// ActionDispatcher gets populated with actions, on Pending State
// ActionDispatcher calls next, with service and message. Or probably it needs to initiate the messages on previous step and attach services when created?

// todo(adam-cattermole): For now we just get the first GrpcService but we expect to have
// an action which links to the service that should be used
let rls = self
Expand Down
2 changes: 2 additions & 0 deletions src/filter/root_context.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::action_dispatcher::ActionDispatcher;
use crate::configuration::{FilterConfig, PluginConfiguration};
use crate::filter::http_context::Filter;
use crate::service::HeaderResolver;
Expand Down Expand Up @@ -42,6 +43,7 @@ impl RootContext for FilterRoot {
config: Rc::clone(&self.config),
response_headers_to_add: Vec::default(),
header_resolver: Rc::new(HeaderResolver::new()),
action_dispatcher: Rc::new(ActionDispatcher::default()),
}))
}

Expand Down

0 comments on commit 76ae9be

Please sign in to comment.