Skip to content

Commit

Permalink
We can make the remote module resolver private to the loader pipeline…
Browse files Browse the repository at this point in the history
… too
  • Loading branch information
itowlson committed Feb 3, 2022
1 parent f589326 commit 2dcbb3a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/handler_loader/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use std::{collections::HashMap, path::Path};
use anyhow::Context;
use serde::Deserialize;

use crate::{wagi_config::WagiConfiguration, bindle_util::{InvoiceUnderstander, WagiHandlerInfo}, module_loader::Loaded};
use crate::{wagi_config::WagiConfiguration, bindle_util::{InvoiceUnderstander, WagiHandlerInfo}};

use super::{emplacer::{EmplacedHandlerConfiguration, Emplacer}, HandlerInfo};
use super::{emplacer::{EmplacedHandlerConfiguration, Emplacer}, HandlerInfo, module_loader::{self, Loaded}};

pub struct LoadedHandlerConfiguration {
pub entries: Vec<LoadedHandlerConfigurationEntry>,
Expand Down Expand Up @@ -107,7 +107,7 @@ async fn handlers_for_bindle(invoice: &bindle::Invoice, emplacer: &Emplacer) ->
}

async fn handler_for_module_map_entry(module_map_entry: &ModuleMapConfigurationEntry, configuration: &WagiConfiguration) -> anyhow::Result<Loaded<ModuleMapConfigurationEntry>> {
crate::module_loader::load_from_module_map_entry(module_map_entry, configuration)
module_loader::load_from_module_map_entry(module_map_entry, configuration)
.await
.map(|v| Loaded::new(module_map_entry, v))
}
Expand Down
2 changes: 1 addition & 1 deletion src/handler_loader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use crate::{wagi_config::WagiConfiguration, wasm_module::WasmModuleSource};

mod emplacer;
mod loader;
mod module_loader;
mod compiler;

pub use loader::ModuleMapConfigurationEntry;
pub use compiler::WasmCompilationSettings;

pub async fn load_handlers(configuration: &WagiConfiguration) -> anyhow::Result<WasmHandlerConfiguration> {
Expand Down
3 changes: 2 additions & 1 deletion src/module_loader.rs → src/handler_loader/module_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ use docker_credential::DockerCredential;
use sha2::{Digest, Sha256};
use url::Url;

use crate::handler_loader::ModuleMapConfigurationEntry;
use crate::wagi_config::WagiConfiguration;

use super::loader::ModuleMapConfigurationEntry;

pub async fn load_from_module_map_entry(module_map_entry: &ModuleMapConfigurationEntry, configuration: &WagiConfiguration) -> anyhow::Result<Vec<u8>> {
let module_ref = module_map_entry.module.clone();
match url::Url::parse(&module_ref) {
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pub(crate) mod dynamic_route;
pub mod handler_loader;
pub(crate) mod handlers;
mod http_util;
pub (crate) mod module_loader;
mod request;
mod tls;
pub mod version;
Expand Down

0 comments on commit 2dcbb3a

Please sign in to comment.