-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmod.rs
More file actions
52 lines (49 loc) · 1.84 KB
/
mod.rs
File metadata and controls
52 lines (49 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Show Command Module
//!
//! This module implements the delivery-agnostic `ShowCommandHandler`
//! for displaying environment information and status.
//!
//! ## Architecture
//!
//! The `ShowCommandHandler` implements the Command Pattern and uses Dependency Injection
//! to interact with infrastructure services through interfaces:
//!
//! - **Repository Pattern**: Loads environment state via `EnvironmentRepository`
//! - **Domain-Driven Design**: Uses domain objects from `domain::environment`
//!
//! ## Design Principles
//!
//! - **Delivery-Agnostic**: Works with CLI, REST API, or any delivery mechanism
//! - **Read-Only Operation**: Never modifies environment state
//! - **No Network Calls**: Displays stored data only (use `test` command for health checks)
//! - **State-Aware Display**: Shows information relevant to each environment state
//! - **Explicit Errors**: All errors implement helpful error messages with actionable guidance
//!
//! ## Information Displayed
//!
//! The command displays state-aware information:
//!
//! - **All states**: Environment name, current state, provider
//! - **Provisioned+**: Infrastructure details (IP, SSH credentials)
//! - **Running**: Service URLs and endpoints
//! - **All states**: Next step guidance based on current state
//!
//! ## State Handling
//!
//! All environment states are displayable, including:
//! - Created, Provisioned, Configured, Released, Running
//! - Failed states (`ProvisionFailed`, `ConfigureFailed`, etc.)
//! - Destroyed (shows historical information)
pub mod errors;
pub mod handler;
pub mod info;
#[cfg(test)]
mod tests;
// Re-export main types for convenience
pub use errors::ShowCommandHandlerError;
pub use handler::ShowCommandHandler;
pub use info::EnvironmentInfo;
pub use info::GrafanaInfo;
pub use info::InfrastructureInfo;
pub use info::PrometheusInfo;
pub use info::ServiceInfo;