From b6379f97d23882adc26bcc9277487d4bdd350b80 Mon Sep 17 00:00:00 2001 From: Face <69168154+face-hh@users.noreply.github.com> Date: Tue, 9 Sep 2025 19:01:46 +0300 Subject: [PATCH] rename rust lib from gurt to gurtlib --- dns/Cargo.toml | 2 +- dns/src/auth.rs | 2 +- dns/src/gurt_server.rs | 4 ++-- dns/src/gurt_server/auth_routes.rs | 4 ++-- dns/src/gurt_server/routes.rs | 4 ++-- docs/docs/gurt-client.md | 6 +++--- docs/docs/gurt-server.md | 6 +++--- protocol/cli/Cargo.lock | 4 ++-- protocol/cli/Cargo.toml | 2 +- protocol/cli/src/error.rs | 4 ++-- protocol/cli/src/request_handler.rs | 12 ++++++------ protocol/cli/src/security.rs | 2 +- protocol/cli/src/server.rs | 2 +- protocol/gdextension/Cargo.toml | 2 +- protocol/gdextension/src/lib.rs | 8 ++++---- protocol/gurtca/Cargo.toml | 2 +- protocol/gurtca/src/client.rs | 6 +++--- protocol/library/examples/tls_server.rs | 2 +- search-engine/Cargo.toml | 2 +- search-engine/src/crawler.rs | 2 +- search-engine/src/server.rs | 4 ++-- 21 files changed, 41 insertions(+), 41 deletions(-) diff --git a/dns/Cargo.toml b/dns/Cargo.toml index ee2af9e..a7fba23 100644 --- a/dns/Cargo.toml +++ b/dns/Cargo.toml @@ -17,7 +17,7 @@ anyhow = "1.0.86" futures = "0.3.30" macros-rs = "1.2.1" prettytable = "0.10.0" -gurt = { path = "../protocol/library" } +gurtlib = { path = "../protocol/library" } pretty_env_logger = "0.5.0" clap-verbosity-flag = "2.2.0" diff --git a/dns/src/auth.rs b/dns/src/auth.rs index 4f267f6..9e78a71 100644 --- a/dns/src/auth.rs +++ b/dns/src/auth.rs @@ -1,4 +1,4 @@ -use gurt::prelude::*; +use gurtlib::prelude::*; use jsonwebtoken::{decode, encode, DecodingKey, EncodingKey, Header, Validation, Algorithm}; use serde::{Deserialize, Serialize}; use bcrypt::{hash, verify, DEFAULT_COST}; diff --git a/dns/src/gurt_server.rs b/dns/src/gurt_server.rs index 44ac1be..8462536 100644 --- a/dns/src/gurt_server.rs +++ b/dns/src/gurt_server.rs @@ -8,9 +8,9 @@ use crate::{auth::jwt_middleware_gurt, config::Config, discord_bot}; use colored::Colorize; use macros_rs::fmt::{crashln, string}; use std::{sync::Arc, collections::HashMap}; -use gurt::prelude::*; +use gurtlib::prelude::*; use warp::Filter; -use gurt::{GurtStatusCode, Route}; +use gurtlib::{GurtStatusCode, Route}; #[derive(Debug)] struct CertificateError; diff --git a/dns/src/gurt_server/auth_routes.rs b/dns/src/gurt_server/auth_routes.rs index c9e6d88..9a85972 100644 --- a/dns/src/gurt_server/auth_routes.rs +++ b/dns/src/gurt_server/auth_routes.rs @@ -1,7 +1,7 @@ use super::{models::*, AppState}; use crate::auth::*; -use gurt::prelude::*; -use gurt::GurtStatusCode; +use gurtlib::prelude::*; +use gurtlib::GurtStatusCode; use sqlx::Row; use chrono::Utc; diff --git a/dns/src/gurt_server/routes.rs b/dns/src/gurt_server/routes.rs index c7757f1..5bc2cbd 100644 --- a/dns/src/gurt_server/routes.rs +++ b/dns/src/gurt_server/routes.rs @@ -2,7 +2,7 @@ use super::{models::*, AppState}; use crate::auth::Claims; use crate::discord_bot::{send_domain_approval_request, DomainRegistration}; use base64::{engine::general_purpose, Engine as _}; -use gurt::prelude::*; +use gurtlib::prelude::*; use rand::{rngs::OsRng, Rng}; use sha2::{Digest, Sha256}; use std::time::{SystemTime, UNIX_EPOCH}; @@ -1056,7 +1056,7 @@ pub(crate) async fn get_certificate( .map_err(|_| GurtError::invalid_message("Database error"))?; if txt_records.is_empty() { - return Ok(GurtResponse::new(gurt::GurtStatusCode::Accepted) + return Ok(GurtResponse::new(gurtlib::GurtStatusCode::Accepted) .with_string_body("Challenge not completed yet")); } diff --git a/docs/docs/gurt-client.md b/docs/docs/gurt-client.md index eacae52..286296a 100644 --- a/docs/docs/gurt-client.md +++ b/docs/docs/gurt-client.md @@ -20,7 +20,7 @@ cargo add gurtlib ## Quick Start ```rust -use gurt::prelude::*; +use gurtlib::prelude::*; #[tokio::main] async fn main() -> Result<()> { @@ -223,7 +223,7 @@ The client extracts: ### Error Types ```rust -use gurt::GurtError; +use gurtlib::GurtError; match client.get("gurt://invalid-url").await { Ok(response) => { @@ -268,7 +268,7 @@ We expect the community to implement bindings for other languages, such as Pytho ## Example: Building a GURT API Client ```rust -use gurt::prelude::*; +use gurtlib::prelude::*; use serde::{Deserialize, Serialize}; #[derive(Serialize)] diff --git a/docs/docs/gurt-server.md b/docs/docs/gurt-server.md index a081151..8bcdc71 100644 --- a/docs/docs/gurt-server.md +++ b/docs/docs/gurt-server.md @@ -12,7 +12,7 @@ Add the GURT library to your `Cargo.toml`: ```toml [dependencies] -gurt = "0.1" +gurtlib = "0.1" tokio = { version = "1.0", features = ["full"] } tracing = "0.1" tracing-subscriber = "0.3" @@ -22,7 +22,7 @@ serde_json = "1.0" ## Quick Start ```rust -use gurt::prelude::*; +use gurtlib::prelude::*; use serde_json::json; #[tokio::main] @@ -442,7 +442,7 @@ server.listen("[::1]:4878").await?; #[cfg(test)] mod tests { use super::*; - use gurt::GurtClient; + use gurtlib::GurtClient; #[tokio::test] async fn test_server() { diff --git a/protocol/cli/Cargo.lock b/protocol/cli/Cargo.lock index 00d11dd..6f399f3 100644 --- a/protocol/cli/Cargo.lock +++ b/protocol/cli/Cargo.lock @@ -416,7 +416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" [[package]] -name = "gurt" +name = "gurtlib" version = "0.1.0" dependencies = [ "base64", @@ -440,7 +440,7 @@ dependencies = [ "async-trait", "clap", "colored", - "gurt", + "gurtlib", "indexmap", "mime_guess", "regex", diff --git a/protocol/cli/Cargo.toml b/protocol/cli/Cargo.toml index 1821c62..8342e2f 100644 --- a/protocol/cli/Cargo.toml +++ b/protocol/cli/Cargo.toml @@ -12,7 +12,7 @@ name = "gurty" path = "src/main.rs" [dependencies] -gurt = { path = "../library" } +gurtlib = { path = "../library" } tokio = { version = "1.0", features = ["full"] } serde = { version = "1.0", features = ["derive"] } diff --git a/protocol/cli/src/error.rs b/protocol/cli/src/error.rs index b99c997..4076bbf 100644 --- a/protocol/cli/src/error.rs +++ b/protocol/cli/src/error.rs @@ -29,8 +29,8 @@ impl From for ServerError { } } -impl From for ServerError { - fn from(err: gurt::GurtError) -> Self { +impl From for ServerError { + fn from(err: gurtlib::GurtError) -> Self { ServerError::ServerStartup(err.to_string()) } } diff --git a/protocol/cli/src/request_handler.rs b/protocol/cli/src/request_handler.rs index abff72b..0cfcdef 100644 --- a/protocol/cli/src/request_handler.rs +++ b/protocol/cli/src/request_handler.rs @@ -3,7 +3,7 @@ use crate::{ config::GurtConfig, security::SecurityMiddleware, }; -use gurt::prelude::*; +use gurtlib::prelude::*; use std::path::Path; use std::sync::Arc; use tracing; @@ -238,14 +238,14 @@ impl RequestHandler { } let result = match method { - gurt::message::GurtMethod::GET => { + gurtlib::message::GurtMethod::GET => { if ctx.path() == "/" { self.handle_root_request().await } else { self.handle_file_request(ctx.path()).await } } - gurt::message::GurtMethod::HEAD => { + gurtlib::message::GurtMethod::HEAD => { let mut response = if ctx.path() == "/" { self.handle_root_request().await? } else { @@ -254,7 +254,7 @@ impl RequestHandler { response.body = Vec::new(); Ok(response) } - gurt::message::GurtMethod::OPTIONS => { + gurtlib::message::GurtMethod::OPTIONS => { let allowed_methods = if let Some(config) = &self.config { if let Some(security) = &config.security { security.allowed_methods.join(", ") @@ -272,7 +272,7 @@ impl RequestHandler { Ok(self.apply_global_headers(response)) } _ => { - let response = GurtResponse::new(gurt::protocol::GurtStatusCode::MethodNotAllowed) + let response = GurtResponse::new(gurtlib::protocol::GurtStatusCode::MethodNotAllowed) .with_header("Content-Type", "text/html"); Ok(self.apply_global_headers(response)) } @@ -430,7 +430,7 @@ impl RequestHandler { #[cfg(test)] mod tests { use super::*; - use gurt::GurtStatusCode; + use gurtlib::GurtStatusCode; use std::fs; use std::env; diff --git a/protocol/cli/src/security.rs b/protocol/cli/src/security.rs index f738cc0..7a80063 100644 --- a/protocol/cli/src/security.rs +++ b/protocol/cli/src/security.rs @@ -1,5 +1,5 @@ use crate::config::GurtConfig; -use gurt::{prelude::*, GurtMethod, GurtStatusCode}; +use gurtlib::{prelude::*, GurtMethod, GurtStatusCode}; use std::collections::HashMap; use std::net::IpAddr; use std::sync::{Arc, Mutex}; diff --git a/protocol/cli/src/server.rs b/protocol/cli/src/server.rs index f772f4e..c70fd72 100644 --- a/protocol/cli/src/server.rs +++ b/protocol/cli/src/server.rs @@ -3,7 +3,7 @@ use crate::{ handlers::{FileHandler, DirectoryHandler, DefaultFileHandler, DefaultDirectoryHandler}, request_handler::{RequestHandler, RequestHandlerBuilder}, }; -use gurt::prelude::*; +use gurtlib::prelude::*; use std::{path::PathBuf, sync::Arc}; pub struct FileServerBuilder { diff --git a/protocol/gdextension/Cargo.toml b/protocol/gdextension/Cargo.toml index 9acd6df..845c9de 100644 --- a/protocol/gdextension/Cargo.toml +++ b/protocol/gdextension/Cargo.toml @@ -12,7 +12,7 @@ name = "gurt_godot" crate-type = ["cdylib"] [dependencies] -gurt = { path = "../library" } +gurtlib = { path = "../library" } godot = "0.1" diff --git a/protocol/gdextension/src/lib.rs b/protocol/gdextension/src/lib.rs index 68f7ff6..c123464 100644 --- a/protocol/gdextension/src/lib.rs +++ b/protocol/gdextension/src/lib.rs @@ -1,6 +1,6 @@ use godot::prelude::*; -use gurt::prelude::*; -use gurt::{GurtMethod, GurtClientConfig, GurtRequest}; +use gurtlib::prelude::*; +use gurtlib::{GurtMethod, GurtClientConfig, GurtRequest}; use tokio::runtime::Runtime; use std::sync::Arc; use std::cell::RefCell; @@ -266,12 +266,12 @@ impl GurtProtocolClient { #[func] fn get_version(&self) -> GString { - gurt::GURT_VERSION.to_string().into() + gurtlib::GURT_VERSION.to_string().into() } #[func] fn get_default_port(&self) -> i32 { - gurt::DEFAULT_PORT as i32 + gurtlib::DEFAULT_PORT as i32 } #[func] diff --git a/protocol/gurtca/Cargo.toml b/protocol/gurtca/Cargo.toml index b0fbc3d..c7b45c2 100644 --- a/protocol/gurtca/Cargo.toml +++ b/protocol/gurtca/Cargo.toml @@ -10,7 +10,7 @@ path = "src/main.rs" [dependencies] clap = { version = "4.0", features = ["derive"] } tokio = { version = "1.0", features = ["full"] } -gurt = { path = "../library" } +gurtlib = { path = "../library" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" openssl = "0.10" diff --git a/protocol/gurtca/src/client.rs b/protocol/gurtca/src/client.rs index a48f2b9..386a9fa 100644 --- a/protocol/gurtca/src/client.rs +++ b/protocol/gurtca/src/client.rs @@ -1,6 +1,6 @@ use anyhow::Result; use serde::{Deserialize, Serialize}; -use gurt::prelude::*; +use gurtlib::prelude::*; pub struct GurtCAClient { ca_url: String, @@ -67,9 +67,9 @@ impl GurtCAClient { println!("✅ Fetched CA certificate via HTTP bootstrap"); // Create new client with custom CA - let mut config = gurt::client::GurtClientConfig::default(); + let mut config = gurtlib::client::GurtClientConfig::default(); config.custom_ca_certificates = vec![ca_cert]; - let gurt_client = gurt::GurtClient::with_config(config); + let gurt_client = gurtlib::GurtClient::with_config(config); let client_with_ca = Self { ca_url, gurt_client, diff --git a/protocol/library/examples/tls_server.rs b/protocol/library/examples/tls_server.rs index 7863776..2084cc3 100644 --- a/protocol/library/examples/tls_server.rs +++ b/protocol/library/examples/tls_server.rs @@ -1,4 +1,4 @@ -use gurt::{GurtServer, GurtResponse, ServerContext, Result}; +use gurtlib::{GurtServer, GurtResponse, ServerContext, Result}; #[tokio::main] async fn main() -> Result<()> { diff --git a/search-engine/Cargo.toml b/search-engine/Cargo.toml index 50fc97f..ee18272 100644 --- a/search-engine/Cargo.toml +++ b/search-engine/Cargo.toml @@ -8,7 +8,7 @@ tokio = { version = "1.38.0", features = ["full"] } futures = "0.3.30" tantivy = "0.22" sha2 = "0.10" -gurt = { path = "../protocol/library" } +gurtlib = { path = "../protocol/library" } sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "postgres", "chrono", "uuid"] } scraper = "0.20" lol_html = "1.2" diff --git a/search-engine/src/crawler.rs b/search-engine/src/crawler.rs index b2e47dc..09c6aa3 100644 --- a/search-engine/src/crawler.rs +++ b/search-engine/src/crawler.rs @@ -1,6 +1,6 @@ use anyhow::{Result, Context}; use chrono::Utc; -use gurt::{GurtClient, GurtClientConfig}; +use gurtlib::{GurtClient, GurtClientConfig}; use scraper::{Html, Selector}; use std::collections::{HashSet, VecDeque}; use std::sync::Arc; diff --git a/search-engine/src/server.rs b/search-engine/src/server.rs index 3d8c873..389dbb9 100644 --- a/search-engine/src/server.rs +++ b/search-engine/src/server.rs @@ -1,6 +1,6 @@ use anyhow::{Result, Context}; -use gurt::prelude::*; -use gurt::GurtError; +use gurtlib::prelude::*; +use gurtlib::GurtError; use serde_json::json; use std::sync::Arc; use tracing::{info, error};