pub struct FederationConfigBuilder<T: Clone> { /* private fields */ }
Expand description
Builder for FederationConfig
.
Implementations§
source§impl<T: Clone + Clone> FederationConfigBuilder<T>
impl<T: Clone + Clone> FederationConfigBuilder<T>
sourcepub fn domain<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn domain<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
The domain where this federated instance is running
sourcepub fn app_data(&mut self, value: T) -> &mut Self
pub fn app_data(&mut self, value: T) -> &mut Self
Data which the application requires in handlers, such as database connection or configuration.
sourcepub fn http_fetch_limit(&mut self, value: u32) -> &mut Self
pub fn http_fetch_limit(&mut self, value: u32) -> &mut Self
Maximum number of outgoing HTTP requests per incoming HTTP request. See crate::fetch::object_id::ObjectId for more details.
sourcepub fn client(&mut self, value: ClientWithMiddleware) -> &mut Self
pub fn client(&mut self, value: ClientWithMiddleware) -> &mut Self
HTTP client used for all outgoing requests. Middleware can be used to add functionality like log tracing or retry of failed requests.
sourcepub fn debug(&mut self, value: bool) -> &mut Self
pub fn debug(&mut self, value: bool) -> &mut Self
Run library in debug mode. This allows usage of http and localhost urls. It also sends outgoing activities synchronously, not in background thread. This helps to make tests more consistent. Do not use for production.
sourcepub fn allow_http_urls(&mut self, value: bool) -> &mut Self
pub fn allow_http_urls(&mut self, value: bool) -> &mut Self
Allow HTTP urls even in production mode
sourcepub fn request_timeout(&mut self, value: Duration) -> &mut Self
pub fn request_timeout(&mut self, value: Duration) -> &mut Self
Timeout for all HTTP requests. HTTP signatures are valid for 10s, so it makes sense to use the same as timeout when sending
sourcepub fn url_verifier(&mut self, value: Box<dyn UrlVerifier + Sync>) -> &mut Self
pub fn url_verifier(&mut self, value: Box<dyn UrlVerifier + Sync>) -> &mut Self
Function used to verify that urls are valid, See UrlVerifier for details.
sourcepub fn http_signature_compat(&mut self, value: bool) -> &mut Self
pub fn http_signature_compat(&mut self, value: bool) -> &mut Self
Enable to sign HTTP signatures according to draft 10, which does not include (created) and (expires) fields. This is required for compatibility with some software like Pleroma. https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-10 https://git.pleroma.social/pleroma/pleroma/-/issues/2939
sourcepub fn queue_worker_count(&mut self, value: usize) -> &mut Self
pub fn queue_worker_count(&mut self, value: usize) -> &mut Self
When sending with activity queue: Number of tasks that can be in-flight concurrently.
Tasks are retried once after a minute, then put into the retry queue.
Setting this count to 0
means that there is no limit to concurrency
sourcepub fn queue_retry_count(&mut self, value: usize) -> &mut Self
pub fn queue_retry_count(&mut self, value: usize) -> &mut Self
When sending with activity queue: Number of concurrent tasks that are being retried
in-flight concurrently. Tasks are retried after an hour, then again in 60 hours.
Setting this count to 0
means that there is no limit to concurrency
source§impl<T: Clone> FederationConfigBuilder<T>
impl<T: Clone> FederationConfigBuilder<T>
sourcepub fn signed_fetch_actor<A: Actor>(&mut self, actor: &A) -> &mut Self
pub fn signed_fetch_actor<A: Actor>(&mut self, actor: &A) -> &mut Self
Sets an actor to use to sign all federated fetch requests
sourcepub fn actor_pkey_cache(&mut self, cache_size: u64) -> &mut Self
pub fn actor_pkey_cache(&mut self, cache_size: u64) -> &mut Self
sets the number of parsed actor private keys to keep in memory
sourcepub async fn build(
&mut self
) -> Result<FederationConfig<T>, FederationConfigBuilderError>
pub async fn build( &mut self ) -> Result<FederationConfig<T>, FederationConfigBuilderError>
Constructs a new config instance with the values supplied to builder.
Values which are not explicitly specified use the defaults. Also initializes the queue for outgoing activities, which is stored internally in the config struct. Requires a tokio runtime for the background queue.