Skip to main content

Crate arminius_lib_component

Crate arminius_lib_component 

Source
Expand description

Allows defining Components, which can represent one microservice in Arminius. Components can also be combined, letting us host the entire application as a monolith.

Modules§

error
Easy error handling types for the Matrix API
message_token 🔒
Types to represent positions for the /messages endpoint
probes
Module containing Axum routes and handlers for the observability probe endpoints
request_source
Module containing an Axum extractor for extracting IP addresses
ruma_requests
Utilities when using ruma. Either they convert between ruma and axum, or they convert between the different representations of the same data that ruma has.

Macros§

compose_components
For a list of components ComponentA, ComponentB, ComponentC constructs a type ComposedComponent<ComponentA, ComposedComponent<ComponentB, ComponentC>>.
new_server_state
Create a new server state while automatically setting the component name on NATS

Structs§

ArminiusConfig
The configuration for an instance of Arminius
ComposedComponent
A component composed of two components. Initializing this component is equivalent to initializing the two components one after the other. Running it is equivalent to running them as a monolith.
EmptyComponent
A component with no endpoints - useful for healthchecks for services that don’t expose their own HTTP endpoints otherwise
EndpointNotFound
Error returned when the user used an unknown endpoint.
MessagesToken
Token representing position in the /messages endpoint
MethodNotAllowed
Error returned when the user used a disallowed method.
Server
Represents the “microservice”, which is composed out of one or more components handing specific functions.
ServerState
The state required for running a component

Enums§

ComponentInitializationError
Signals an error during component creation / initialization
MaintenanceModeLayerError
Error type for the maintenance mode middleware layer.
MessageTokenParseError
Error that occurs when parsing a messages token

Traits§

Component
Represents a component in the microservice

Functions§

await_shutdown_signal
Future that completes when a SIGTERM or SIGINT is received, or immediately if no listener can be registered.
maintenance_mode_layer 🔒
Middleware layer that returns a maintenance mode error if the service is currently in maintenance mode.
method_not_allowed_endpoint 🔒
Always returns METHOD_NOT_ALLOWED. Called as a method_not_allowed_fallback
unknown_endpoint 🔒
Always returns NOT_FOUND. Called as a fallback option