Skip to main content

tidepool_gvm/
lib.rs

1//! Tidepool GVM - A high-performance Go Version Manager toolkit
2//!
3//! This is a high-performance Go version management tool written in Rust,
4//! providing a simple command-line interface to manage multiple Go versions.
5
6// Core modules
7pub mod cli;
8pub mod commands;
9pub mod config;
10
11pub mod downloader;
12pub mod error;
13pub mod go;
14pub mod platform;
15pub mod symlink;
16
17// Flattened UI and progress system
18pub mod progress_flat;
19pub mod ui_flat;
20
21// Note: Deprecated nested modules have been removed.
22// Please use the flattened modules directly: ui_flat.rs and progress_flat.rs
23
24// Main type exports
25pub use cli::Cli;
26pub use config::Config;
27pub use downloader::Downloader;
28pub use error::{ErrorUtils, Result};
29pub use go::{GoManager, GoVersionInfo};
30
31// UI and progress system (flattened)
32pub use progress_flat::{BasicProgress, InstallSteps};
33pub use ui_flat::{format_duration, format_size, SimpleProgressBar, SimpleUI};
34
35// Note: Deprecated backward-compatible exports have been removed.
36// Please use the new flattened modules: ui_flat and progress_flat
37
38// Public type definitions
39
40
41
42/// Installation request
43#[derive(Debug, Clone)]
44pub struct InstallRequest {
45    pub version: String,
46    pub install_dir: std::path::PathBuf,
47    pub download_dir: std::path::PathBuf,
48    pub force: bool,
49}
50
51/// Switch request
52#[derive(Debug, Clone)]
53pub struct SwitchRequest {
54    pub version: String,
55    pub base_dir: std::path::PathBuf,
56    pub global: bool,
57    pub force: bool,
58}
59
60/// Uninstall request
61#[derive(Debug, Clone)]
62pub struct UninstallRequest {
63    pub version: String,
64    pub base_dir: std::path::PathBuf,
65}
66
67/// List installed versions request
68#[derive(Debug, Clone)]
69pub struct ListInstalledRequest {
70    pub base_dir: std::path::PathBuf,
71}
72
73/// Status request
74#[derive(Debug, Clone)]
75pub struct StatusRequest {
76    pub base_dir: Option<std::path::PathBuf>,
77}
78
79/// Runtime status
80#[derive(Debug, Clone, Default)]
81pub struct RuntimeStatus {
82    pub current_version: Option<String>,
83    pub current_path: Option<String>,
84    pub environment_vars: std::collections::HashMap<String, String>,
85}
86
87/// Version list
88#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
89pub struct VersionList {
90    pub versions: Vec<GoVersionInfo>,
91    pub total_count: usize,
92}