unifly-core
High-level reactive controller for UniFi networks.
Overview
unifly-core provides business logic and reactive data infrastructure for UniFi Network applications. It sits between the low-level unifly-api transport layer and UI consumers (CLI/TUI), offering:
- Controller lifecycle management with
connect(),disconnect(), andoneshot()modes - Reactive DataStore with lock-free entity collections and watch-based streams for real-time updates
- Domain model with 20+ canonical types (
Device,Client,Network,FirewallPolicy, etc.) - Command dispatch for CRUD operations routed through an
mpscchannel - Automatic data merge from Integration and Legacy APIs into unified domain types
Features
- Controller lifecycle with authentication, background refresh, and WebSocket event processing
- Reactive
DataStorewithEntityStreamsubscriptions for live data updates - Lock-free storage using
DashMapandtokio::sync::watchchannels - Support for both UUID-based (Integration API) and string-based (Legacy API) entity IDs
- 20+ domain model types covering devices, clients, networks, firewall, VPN, DPI, events
- Command processor for mutations with automatic store updates
- Hybrid API support: merges Integration + Legacy API data for complete network view
Quick Example
use ;
use SecretString;
async
For low-level API access without the reactive layer, see unifly-api.
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.