diff options
| author | Lia Lenckowski <lialenck@protonmail.com> | 2025-11-14 23:57:00 +0100 |
|---|---|---|
| committer | Lia Lenckowski <lialenck@protonmail.com> | 2025-11-15 00:01:43 +0100 |
| commit | 2dfcf261b81a8846608b52f64da54a12259a931c (patch) | |
| tree | 0f6eac532c152b679833f824dc01f126dc439fe5 /src/modules | |
| parent | a4d828cfa4ba9ff7ae4e21df49b2f3f9c695e4fa (diff) | |
| download | gnix-2dfcf261b81a8846608b52f64da54a12259a931c.tar gnix-2dfcf261b81a8846608b52f64da54a12259a931c.tar.bz2 gnix-2dfcf261b81a8846608b52f64da54a12259a931c.tar.zst | |
fix typo: instanciate -> instantiate
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/accesslog.rs | 4 | ||||
| -rw-r--r-- | src/modules/auth/basic.rs | 4 | ||||
| -rw-r--r-- | src/modules/auth/cookie.rs | 6 | ||||
| -rw-r--r-- | src/modules/auth/openid.rs | 4 | ||||
| -rw-r--r-- | src/modules/cache.rs | 4 | ||||
| -rw-r--r-- | src/modules/cgi.rs | 2 | ||||
| -rw-r--r-- | src/modules/debug.rs | 2 | ||||
| -rw-r--r-- | src/modules/delay.rs | 4 | ||||
| -rw-r--r-- | src/modules/error.rs | 2 | ||||
| -rw-r--r-- | src/modules/fallback.rs | 4 | ||||
| -rw-r--r-- | src/modules/file.rs | 2 | ||||
| -rw-r--r-- | src/modules/files.rs | 2 | ||||
| -rw-r--r-- | src/modules/headers.rs | 4 | ||||
| -rw-r--r-- | src/modules/hosts.rs | 4 | ||||
| -rw-r--r-- | src/modules/inspect.rs | 4 | ||||
| -rw-r--r-- | src/modules/limits.rs | 4 | ||||
| -rw-r--r-- | src/modules/loadbalance.rs | 4 | ||||
| -rw-r--r-- | src/modules/log.rs | 4 | ||||
| -rw-r--r-- | src/modules/mod.rs | 2 | ||||
| -rw-r--r-- | src/modules/paths.rs | 4 | ||||
| -rw-r--r-- | src/modules/proxy.rs | 2 | ||||
| -rw-r--r-- | src/modules/ratelimit.rs | 4 | ||||
| -rw-r--r-- | src/modules/redirect.rs | 2 | ||||
| -rw-r--r-- | src/modules/semaphore.rs | 4 | ||||
| -rw-r--r-- | src/modules/switch.rs | 6 | ||||
| -rw-r--r-- | src/modules/upgrade_insecure.rs | 4 |
26 files changed, 46 insertions, 46 deletions
diff --git a/src/modules/accesslog.rs b/src/modules/accesslog.rs index 5b91949..9925f87 100644 --- a/src/modules/accesslog.rs +++ b/src/modules/accesslog.rs @@ -42,10 +42,10 @@ impl NodeKind for AccessLogKind { fn name(&self) -> &'static str { "access_log" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { let config: AccessLogConfig = ic.config().parse()?; Ok(Arc::new(AccessLog { - next: ic.instanciate_child(config.next.clone())?, + next: ic.instantiate_child(config.next.clone())?, config, file: Default::default(), })) diff --git a/src/modules/auth/basic.rs b/src/modules/auth/basic.rs index b8b3e52..1910193 100644 --- a/src/modules/auth/basic.rs +++ b/src/modules/auth/basic.rs @@ -27,10 +27,10 @@ impl NodeKind for HttpBasicAuthKind { fn name(&self) -> &'static str { "http_basic_auth" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { let config: HttpBasicAuth<DynNodeConfig> = ic.config().parse()?; Ok(Arc::new(HttpBasicAuth { - next: ic.instanciate_child(config.next)?, + next: ic.instantiate_child(config.next)?, realm: config.realm, users: config.users, })) diff --git a/src/modules/auth/cookie.rs b/src/modules/auth/cookie.rs index 81fc50a..7161a64 100644 --- a/src/modules/auth/cookie.rs +++ b/src/modules/auth/cookie.rs @@ -35,14 +35,14 @@ impl NodeKind for CookieAuthKind { fn name(&self) -> &'static str { "cookie_auth" } - fn instanciate(&self, ic: InstContext) -> Result<Arc<dyn Node>> { + fn instantiate(&self, ic: InstContext) -> Result<Arc<dyn Node>> { let config: CookieAuth<DynNodeConfig> = ic.config().parse()?; Ok(Arc::new(CookieAuth { expire: config.expire, secure: config.secure, users: config.users, - fail: ic.instanciate_child(config.fail)?, - next: ic.instanciate_child(config.next)?, + fail: ic.instantiate_child(config.fail)?, + next: ic.instantiate_child(config.next)?, })) } } diff --git a/src/modules/auth/openid.rs b/src/modules/auth/openid.rs index 175fa22..7ff3316 100644 --- a/src/modules/auth/openid.rs +++ b/src/modules/auth/openid.rs @@ -41,14 +41,14 @@ impl NodeKind for OpenIDAuthKind { fn name(&self) -> &'static str { "openid_auth" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { let config: OpenIDAuth<DynNodeConfig> = ic.config().parse()?; Ok(Arc::new(OpenIDAuth { authorize_endpoint: config.authorize_endpoint, authorized_emails: config.authorized_emails, client_id: config.client_id, client_secret: config.client_secret, - next: ic.instanciate_child(config.next)?, + next: ic.instantiate_child(config.next)?, salt: config.salt, scope: config.scope, token_endpoint: config.token_endpoint, diff --git a/src/modules/cache.rs b/src/modules/cache.rs index 13858bd..417dcb6 100644 --- a/src/modules/cache.rs +++ b/src/modules/cache.rs @@ -48,10 +48,10 @@ impl NodeKind for CacheKind { fn name(&self) -> &'static str { "cache" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { let config: CacheConfig = ic.config().parse()?; Ok(Arc::new(Cache { - next: ic.instanciate_child(config.next.clone())?, + next: ic.instantiate_child(config.next.clone())?, _config: config, entries: HashMap::new().into(), })) diff --git a/src/modules/cgi.rs b/src/modules/cgi.rs index b687398..1cc1943 100644 --- a/src/modules/cgi.rs +++ b/src/modules/cgi.rs @@ -47,7 +47,7 @@ impl NodeKind for CgiKind { fn name(&self) -> &'static str { "cgi" } - fn instanciate(&self, ic: InstContext) -> Result<Arc<dyn Node>> { + fn instantiate(&self, ic: InstContext) -> Result<Arc<dyn Node>> { Ok(Arc::new(Cgi::new(ic.config().parse()?)?)) } } diff --git a/src/modules/debug.rs b/src/modules/debug.rs index f9cad9a..72a3146 100644 --- a/src/modules/debug.rs +++ b/src/modules/debug.rs @@ -20,7 +20,7 @@ impl NodeKind for DebugKind { fn name(&self) -> &'static str { "debug" } - fn instanciate(&self, _ic: InstContext) -> anyhow::Result<Arc<dyn Node>> { + fn instantiate(&self, _ic: InstContext) -> anyhow::Result<Arc<dyn Node>> { Ok(Arc::new(Debug)) } } diff --git a/src/modules/delay.rs b/src/modules/delay.rs index 59f6a71..bfdfbc8 100644 --- a/src/modules/delay.rs +++ b/src/modules/delay.rs @@ -28,12 +28,12 @@ impl NodeKind for DelayKind { fn name(&self) -> &'static str { "delay" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { let config: Delay<DynNodeConfig> = ic.config().parse()?; Ok(Arc::new(Delay { duration: config.duration, stdev: config.stdev, - next: ic.instanciate_child(config.next)?, + next: ic.instantiate_child(config.next)?, })) } } diff --git a/src/modules/error.rs b/src/modules/error.rs index 4ec5c6b..1ef3fa1 100644 --- a/src/modules/error.rs +++ b/src/modules/error.rs @@ -20,7 +20,7 @@ impl NodeKind for ErrorKind { fn name(&self) -> &'static str { "error" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { Ok(Arc::new(ic.config().parse::<Error>()?)) } } diff --git a/src/modules/fallback.rs b/src/modules/fallback.rs index 5b518bd..2c53e09 100644 --- a/src/modules/fallback.rs +++ b/src/modules/fallback.rs @@ -22,12 +22,12 @@ impl NodeKind for FallbackKind { fn name(&self) -> &'static str { "fallback" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { let config: Vec<DynNodeConfig> = ic.config().parse()?; Ok(Arc::new(Fallback( config .into_iter() - .map(|c| ic.instanciate_child(c)) + .map(|c| ic.instantiate_child(c)) .collect::<Result<_>>()?, ))) } diff --git a/src/modules/file.rs b/src/modules/file.rs index d6273aa..3c79173 100644 --- a/src/modules/file.rs +++ b/src/modules/file.rs @@ -34,7 +34,7 @@ impl NodeKind for FileKind { fn name(&self) -> &'static str { "file" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { let conf = ic.config().parse::<FileConfig>()?; Ok(Arc::new(File { content: conf diff --git a/src/modules/files.rs b/src/modules/files.rs index 1d2706c..edae74b 100644 --- a/src/modules/files.rs +++ b/src/modules/files.rs @@ -73,7 +73,7 @@ impl NodeKind for FilesKind { fn name(&self) -> &'static str { "files" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { Ok(Arc::new(ic.config().parse::<Files>()?)) } } diff --git a/src/modules/headers.rs b/src/modules/headers.rs index 5ca0663..2118f0e 100644 --- a/src/modules/headers.rs +++ b/src/modules/headers.rs @@ -33,12 +33,12 @@ impl NodeKind for HeadersKind { fn name(&self) -> &'static str { "headers" } - fn instanciate(&self, ic: InstContext) -> Result<Arc<dyn Node>> { + fn instantiate(&self, ic: InstContext) -> Result<Arc<dyn Node>> { let config: Headers<DynNodeConfig> = ic.config().parse()?; Ok(Arc::new(Headers { request: config.request, response: config.response, - next: ic.instanciate_child(config.next)?, + next: ic.instantiate_child(config.next)?, })) } } diff --git a/src/modules/hosts.rs b/src/modules/hosts.rs index f486738..4cb8984 100644 --- a/src/modules/hosts.rs +++ b/src/modules/hosts.rs @@ -24,13 +24,13 @@ impl NodeKind for HostsKind { fn name(&self) -> &'static str { "hosts" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { let config: Hosts<DynNodeConfig> = ic.config().parse()?; Ok(Arc::new(Hosts( config .0 .into_iter() - .map(|(k, v)| anyhow::Ok((k, ic.instanciate_child(v)?))) + .map(|(k, v)| anyhow::Ok((k, ic.instantiate_child(v)?))) .collect::<Result<_>>()?, ))) } diff --git a/src/modules/inspect.rs b/src/modules/inspect.rs index a0c68e6..2424947 100644 --- a/src/modules/inspect.rs +++ b/src/modules/inspect.rs @@ -26,10 +26,10 @@ impl NodeKind for InspectKind { fn name(&self) -> &'static str { "inspect" } - fn instanciate(&self, ic: InstContext) -> Result<Arc<dyn Node>> { + fn instantiate(&self, ic: InstContext) -> Result<Arc<dyn Node>> { let config: Inspect<DynNodeConfig> = ic.config().parse()?; Ok(Arc::new(Inspect { - next: ic.instanciate_child(config.next)?, + next: ic.instantiate_child(config.next)?, })) } } diff --git a/src/modules/limits.rs b/src/modules/limits.rs index 4f8e85e..512ef0c 100644 --- a/src/modules/limits.rs +++ b/src/modules/limits.rs @@ -44,12 +44,12 @@ impl NodeKind for LimitsKind { fn name(&self) -> &'static str { "limits" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { let config: Limits<DynNodeConfig> = ic.config().parse()?; Ok(Arc::new(Limits { request: config.request, response: config.response, - next: ic.instanciate_child(config.next)?, + next: ic.instantiate_child(config.next)?, })) } } diff --git a/src/modules/loadbalance.rs b/src/modules/loadbalance.rs index 1b09c86..6f6437f 100644 --- a/src/modules/loadbalance.rs +++ b/src/modules/loadbalance.rs @@ -38,14 +38,14 @@ impl NodeKind for LoadBalanceKind { fn name(&self) -> &'static str { "loadbalance" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { let config: LoadBalanceConfig = ic.config().parse()?; Ok(Arc::new(LoadBalance { load: config.0.iter().map(|_| AtomicUsize::new(0)).collect(), nodes: config .0 .into_iter() - .map(|c| ic.instanciate_child(c)) + .map(|c| ic.instantiate_child(c)) .collect::<Result<_>>()?, })) } diff --git a/src/modules/log.rs b/src/modules/log.rs index e1a6205..413c42c 100644 --- a/src/modules/log.rs +++ b/src/modules/log.rs @@ -77,10 +77,10 @@ impl NodeKind for LogKind { fn name(&self) -> &'static str { "log" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { let config: LogConfig = ic.config().parse()?; Ok(Arc::new(Log { - next: ic.instanciate_child(config.next.clone())?, + next: ic.instantiate_child(config.next.clone())?, config, file: Default::default(), })) diff --git a/src/modules/mod.rs b/src/modules/mod.rs index 308fe4f..8b8da98 100644 --- a/src/modules/mod.rs +++ b/src/modules/mod.rs @@ -77,7 +77,7 @@ pub struct NodeContext { pub trait NodeKind: Send + Sync + 'static { fn name(&self) -> &'static str; - fn instanciate(&self, context: InstContext) -> Result<DynNode>; + fn instantiate(&self, context: InstContext) -> Result<DynNode>; } pub trait Node: Send + Sync + 'static { fn handle<'a>( diff --git a/src/modules/paths.rs b/src/modules/paths.rs index 8818502..362c4fe 100644 --- a/src/modules/paths.rs +++ b/src/modules/paths.rs @@ -33,14 +33,14 @@ impl NodeKind for PathsKind { fn name(&self) -> &'static str { "paths" } - fn instanciate(&self, ic: InstContext) -> anyhow::Result<Arc<dyn Node>> { + fn instantiate(&self, ic: InstContext) -> anyhow::Result<Arc<dyn Node>> { let routes = ic.config().parse::<SeqOrMap<DynNodeConfig>>()?.0; let mut handlers = Vec::new(); let mut patterns = Vec::new(); let mut extractors = Vec::new(); for (pattern, config) in routes { let pattern = format!("^{pattern}$"); - handlers.push(ic.instanciate_child(config)?); + handlers.push(ic.instantiate_child(config)?); extractors.push(Regex::new(&pattern)?); patterns.push(pattern); } diff --git a/src/modules/proxy.rs b/src/modules/proxy.rs index 252e482..0b0ea7b 100644 --- a/src/modules/proxy.rs +++ b/src/modules/proxy.rs @@ -53,7 +53,7 @@ impl NodeKind for ProxyKind { fn name(&self) -> &'static str { "proxy" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { Ok(Arc::new(ic.config().parse::<Proxy>()?)) } } diff --git a/src/modules/ratelimit.rs b/src/modules/ratelimit.rs index 34a8bca..db7ef4c 100644 --- a/src/modules/ratelimit.rs +++ b/src/modules/ratelimit.rs @@ -78,11 +78,11 @@ impl NodeKind for RatelimitKind { fn name(&self) -> &'static str { "ratelimit" } - fn instanciate(&self, ic: InstContext) -> Result<Arc<dyn Node>> { + fn instantiate(&self, ic: InstContext) -> Result<Arc<dyn Node>> { let config: RatelimitConfig = ic.config().parse()?; Ok(Arc::new(Ratelimit { state: Arc::new(Mutex::new(HashMap::new())), - next: ic.instanciate_child(config.next.clone())?, + next: ic.instantiate_child(config.next.clone())?, config, })) } diff --git a/src/modules/redirect.rs b/src/modules/redirect.rs index 5163013..58c4ea6 100644 --- a/src/modules/redirect.rs +++ b/src/modules/redirect.rs @@ -21,7 +21,7 @@ impl NodeKind for RedirectKind { fn name(&self) -> &'static str { "redirect" } - fn instanciate(&self, ic: InstContext) -> Result<Arc<dyn Node>> { + fn instantiate(&self, ic: InstContext) -> Result<Arc<dyn Node>> { Ok(Arc::new(ic.config().parse::<Redirect>()?)) } } diff --git a/src/modules/semaphore.rs b/src/modules/semaphore.rs index 8fed518..48c41ab 100644 --- a/src/modules/semaphore.rs +++ b/src/modules/semaphore.rs @@ -31,11 +31,11 @@ impl NodeKind for SemaphoreKind { fn name(&self) -> &'static str { "semaphore" } - fn instanciate(&self, ic: InstContext) -> Result<Arc<dyn Node>> { + fn instantiate(&self, ic: InstContext) -> Result<Arc<dyn Node>> { let config = ic.config().parse::<SemaphoreConfig>()?; Ok(Arc::new(SemaphoreState { semaphore: Semaphore::new(config.permits), - next: ic.instanciate_child(config.next)?, + next: ic.instantiate_child(config.next)?, })) } } diff --git a/src/modules/switch.rs b/src/modules/switch.rs index c42216e..ab73a79 100644 --- a/src/modules/switch.rs +++ b/src/modules/switch.rs @@ -30,12 +30,12 @@ impl NodeKind for SwitchKind { fn name(&self) -> &'static str { "switch" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { let config: Switch<DynNodeConfig> = ic.config().parse()?; Ok(Arc::new(Switch { condition: config.condition, - case_true: ic.instanciate_child(config.case_true)?, - case_false: ic.instanciate_child(config.case_false)?, + case_true: ic.instantiate_child(config.case_true)?, + case_false: ic.instantiate_child(config.case_false)?, })) } } diff --git a/src/modules/upgrade_insecure.rs b/src/modules/upgrade_insecure.rs index c06caa7..d5489e4 100644 --- a/src/modules/upgrade_insecure.rs +++ b/src/modules/upgrade_insecure.rs @@ -30,10 +30,10 @@ impl NodeKind for UpgradeInsecureKind { fn name(&self) -> &'static str { "upgrade_insecure" } - fn instanciate(&self, ic: InstContext) -> Result<DynNode> { + fn instantiate(&self, ic: InstContext) -> Result<DynNode> { let config = ic.config().parse::<UpgradeInsecure<DynNodeConfig>>()?; Ok(Arc::new(UpgradeInsecure::<DynNode> { - next: ic.instanciate_child(config.next)?, + next: ic.instantiate_child(config.next)?, })) } } |