lmrc-rabbitmq
RabbitMQ management library for the LMRC Stack - comprehensive library for managing RabbitMQ installations on remote servers via SSH.
Features
- SSH-Based Installation: Automated RabbitMQ server installation on Ubuntu/Debian systems
- User Management: Create, delete, and manage RabbitMQ users with tags
- VHost Management: Create, delete, and list virtual hosts
- Permission Management: Set, clear, and list permissions for users on vhosts
- Plugin Management: Enable, disable, and list RabbitMQ plugins
- Service Control: Start, stop, restart, and check status of RabbitMQ service
Installation
Add this to your Cargo.toml:
[]
= "0.3.9"
Quick Start
use ;
async
Usage
Installing RabbitMQ
The manager handles the complete installation process:
let config = builder
.version
.admin_user
.admin_password
.enable_management
.build;
let manager = new
.with_user;
manager.install?;
This will:
- Install Erlang dependencies
- Add official RabbitMQ repositories
- Install RabbitMQ server
- Enable management plugin (if configured)
- Create admin user
- Remove default guest user
- Configure firewall rules (UFW)
Managing Users
use ;
let mut ssh_client = /* ... */;
let mut user_ops = new;
// Create user
let user = RabbitMqUser ;
user_ops.create_user?;
// List users
let users = user_ops.list_users?;
Managing VHosts
use ;
let mut vhost_ops = new;
// Create vhost
let vhost = RabbitMqVHost ;
vhost_ops.create_vhost?;
Managing Permissions
use ;
let mut perm_ops = new;
// Set permissions
let permission = RabbitMqPermission ;
perm_ops.set_permissions?;
Architecture
This library follows hexagonal architecture principles:
- Ports: Defined in
lmrc-portscrate - Adapters: SSH-based implementation using
lmrc-ssh - Domain: RabbitMQ-specific operations and configuration
Error Handling
All operations return Result<T, RabbitMqError> with detailed error types:
use RabbitMqError;
match manager.install
License
Dual licensed under MIT OR Apache-2.0 (user's choice).
Contributing
This library is part of the LMRC Stack project.