docker-network 0.0.2

Docker network management
# Rusty-Docker Network: Advanced Network Management

[![GitHub Stars](https://img.shields.io/github/stars/oovm/opencrab)](https://github.com/oovm/opencrab)

## 🚀 Powerful Network Management for Containers

Rusty-Docker Network is the advanced network management component that powers the Rusty-Docker ecosystem. Designed for reliability, performance, and cross-platform compatibility, it provides comprehensive network operations for containerized applications.

## ✨ Key Features That Simplify Network Management

### 📦 Comprehensive Network Operations
- **Network Creation**: Create custom networks with different drivers and configurations
- **Container Connection**: Connect containers to networks for seamless communication
- **Network Isolation**: Create isolated networks for security and segmentation
- **Network Deletion**: Clean up unused networks to save resources
- **Network Listing**: View all available networks with detailed information

### 🔧 Advanced Network Configuration
- **Multiple Network Drivers**: Support for bridge, overlay, macvlan, and custom drivers
- **IPAM Configuration**: Custom IP address management and subnet allocation
- **Network Options**: Fine-grained control over network parameters
- **Port Mapping**: Seamless port forwarding between host and containers
- **DNS Configuration**: Custom DNS settings for containers

### 🌐 Cross-Platform Compatibility
- **Multi-Platform Support**: Works seamlessly on Linux, Windows, and macOS
- **Platform-Specific Optimizations**: Leverages platform-specific network capabilities
- **Consistent API**: Same network operations across all platforms
- **Network Namespace Support**: Linux network namespace integration

### 🔒 Secure Network Management
- **Network Isolation**: Strong isolation between networks
- **Access Control**: Fine-grained access control for network resources
- **Encryption Support**: Encrypted network communication
- **Network Policies**: Define rules for network traffic between containers

### 🎯 Developer-Friendly API
- **Clean, Intuitive API**: Easy-to-use interface for network operations
- **Async Support**: Non-blocking network operations with async/await
- **Error Handling**: Comprehensive error handling and reporting
- **Documentation**: Well-documented API with examples

## 📋 Core Components

### Network Manager
- **Driver Management**: Support for multiple network drivers
- **Network Lifecycle**: Complete network lifecycle management
- **Container Integration**: Seamless container network integration
- **State Management**: Track network state and configurations

### Driver Plugins
- **Bridge Driver**: Default bridge network for container communication
- **Overlay Driver**: Multi-host network for distributed applications
- **Macvlan Driver**: Assign MAC addresses to containers
- **Custom Drivers**: Support for third-party network drivers

### IPAM (IP Address Management)
- **Subnet Allocation**: Automatic and manual subnet allocation
- **IP Address Assignment**: Dynamic and static IP address assignment
- **CIDR Management**: Classless Inter-Domain Routing support
- **Gateway Configuration**: Custom gateway settings for networks

### Network Utilities
- **DNS Resolution**: Internal DNS for container name resolution
- **Port Forwarding**: Map container ports to host ports
- **Network Diagnostics**: Tools for network troubleshooting
- **Traffic Monitoring**: Network traffic analysis and monitoring

## 🛠️ Quick Start

### Basic Usage

```rust
use docker_network::{new_network_manager, NetworkConfig, NetworkError};

fn main() -> Result<(), NetworkError> {
    // Create network manager
    let mut manager = new_network_manager();
    
    // Configure network
    let config = NetworkConfig {
        name: "my-network".to_string(),
        driver: "bridge".to_string(),
        ipam: None,
        options: None,
    };
    
    // Create network
    let network = manager.create_network(&config)?;
    println!("Created network: {}", network.name);
    
    // Connect container to network
    manager.connect_container("my-container", &network.id)?;
    println!("Connected container to network");
    
    // List networks
    let networks = manager.list_networks()?;
    for net in networks {
        println!("Network: {} ({})\n", net.name, net.driver);
    }
    
    Ok(())
}
```

## 🌟 Why Rusty-Docker Network?

### 🚀 High Performance
Built with Rust, Rusty-Docker Network delivers superior performance with faster network operations and lower latency compared to traditional network management libraries.

### 🔧 Advanced Features
Comprehensive network management capabilities that go beyond basic operations, including multiple driver support and advanced configuration options.

### 📱 Cross-Platform Freedom
Manage networks consistently across Linux, Windows, and macOS, eliminating platform-specific network challenges.

### 🎯 Developer-Friendly
A clean, well-documented API makes it easy to integrate network management into your applications and workflows.

### 🔒 Enhanced Security
Built-in security features to help you maintain secure network configurations and protect your containerized applications.

## 🤝 Contributing

We welcome contributions from the community! Whether you're interested in adding new features, fixing bugs, or improving documentation, your help is greatly appreciated.

---

**Simplifying container network management with advanced features and cross-platform compatibility!** 🦀