| Crates.io | kotoba-handler |
| lib.rs | kotoba-handler |
| version | 0.1.22 |
| created_at | 2025-09-19 20:29:03.443999+00 |
| updated_at | 2025-09-19 20:29:03.443999+00 |
| description | Unified Web Handler for Kotoba ecosystem - integrates server, CLI, and WASM execution |
| homepage | https://github.com/com-junkawasaki/kotoba |
| repository | https://github.com/com-junkawasaki/kotoba |
| max_upload_size | |
| id | 1846996 |
| size | 238,463 |
kotoba-handler はKotobaエコシステム全体の統合的なhandlerを提供するクレートです。
// Jsonnet評価機能の統合
#[cfg(feature = "jsonnet-integration")]
use kotoba_handler::integration::jsonnet_integration::JsonnetEvaluationHandler;
let handler = JsonnetEvaluationHandler::new();
let result = handler.evaluate(jsonnet_content, &context)?;
// HTTP設定パーサーの統合
use kotoba_handler::integration::kotobas_integration::KotobasHttpHandler;
let handler = KotobasHttpHandler::new(kotobas_config)?;
let route = handler.find_route("GET", "/api/users")?;
// HTTPサーバー機能の統合
use kotoba_handler::server;
server::run_server("127.0.0.1:3000").await?;
use kotoba_handler::{UnifiedHandler, HandlerContext, execute_simple_handler};
// シンプルな実行
let context = HandlerContext {
method: "GET".to_string(),
path: "/api/test".to_string(),
headers: HashMap::new(),
query_params: HashMap::new(),
body: None,
environment: HashMap::new(),
};
let result = execute_simple_handler(kotoba_content, context).await?;
use kotoba_handler::integration::IntegratedHandler;
// JsonnetとKotobasの両方を統合
let mut handler = IntegratedHandler::new(kotobas_config)?;
let result = handler.process_request(context, Some(jsonnet_content)).await?;
use kotoba_handler::{HandlerExecutor, ExecutionMode};
let executor = HandlerExecutor::new(handler_arc)
.with_mode(ExecutionMode::Async);
let result = executor.execute_batch(requests).await?;
[dependencies]
kotoba-handler = { git = "https://github.com/com-junkawasaki/kotoba", features = ["full"] }
default: CLIとサーバー機能cli: CLI統合server: HTTPサーバー統合wasm: WASM実行環境websocket: WebSocketサポートjsonnet-integration: Jsonnet統合(オプション)full: すべての機能┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ densha │────│ kotoba-handler │────│ kotoba-* │
│ │ │ │ │ crates │
│ - CLI Interface │ │ - Unified API │ │ │
│ - HTTP Server │ │ - Runtime Mgmt │ │ - jsonnet │
│ - File System │ │ - Caching │ │ - kotobas │
└─────────────────┘ │ - Integration │ │ - server │
└──────────────────┘ │ - 2tsx │
└─────────────────┘