diff --git a/Cargo.lock b/Cargo.lock index 3b321d5..0a4d64e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -781,7 +781,9 @@ dependencies = [ "futures-util", "golem-client", "golem-examples", + "h2", "http 1.0.0", + "hyper", "indoc", "itertools", "libtest-mimic", @@ -803,6 +805,7 @@ dependencies = [ "tokio-tungstenite", "tonic", "tonic-health", + "tower", "tracing", "tracing-subscriber", "tungstenite", @@ -812,9 +815,9 @@ dependencies = [ [[package]] name = "golem-client" -version = "0.0.60" +version = "0.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53724dee78bac0a83d83e0eac7aca899b011950ba9fc76bcb109a845ff792b89" +checksum = "a4065eef9f11a5de373bbccda58c585123a745242a628e3cfba122094079cc34" dependencies = [ "async-trait", "bytes", @@ -2403,6 +2406,7 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", diff --git a/Cargo.toml b/Cargo.toml index 985dea3..2482016 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ clap = { version = "4.4.12", features = ["derive"] } clap-verbosity-flag = "2.1.1" derive_more = "0.99.17" futures-util = "0.3.30" -golem-client = "0.0.60" +golem-client = "0.0.62" golem-examples = "0.1.11" http = "1.0.0" indoc = "2.0.4" @@ -43,6 +43,10 @@ url = "2.5.0" uuid = "1.6.1" dirs = "5.0.1" tracing-subscriber = "0.3.18" +h2 = "0.3.24" +hyper = "0.14.28" +tower = "0.4.13" +testcontainers-modules = { version = "0.3.2", features = ["postgres", "redis"] } [dev-dependencies] env_logger = "0.11.1" diff --git a/src/clients/template.rs b/src/clients/template.rs index 109ed81..98bc5ef 100644 --- a/src/clients/template.rs +++ b/src/clients/template.rs @@ -17,7 +17,8 @@ use std::io::Read; use async_trait::async_trait; use golem_client::model::{ Export, ExportFunction, ExportInstance, FunctionParameter, FunctionResult, NameOptionTypePair, - NameTypePair, Template, Type, TypeEnum, TypeFlags, TypeRecord, TypeTuple, TypeVariant, + NameTypePair, ResourceMode, Template, Type, TypeEnum, TypeFlags, TypeRecord, TypeTuple, + TypeVariant, }; use serde::{Deserialize, Serialize}; use tokio::fs::File; @@ -151,6 +152,10 @@ fn render_type(typ: &Type) -> String { Type::U8 { .. } => "u8".to_string(), Type::S8 { .. } => "s8".to_string(), Type::Bool { .. } => "bool".to_string(), + Type::Handle(handle) => match handle.mode { + ResourceMode::Borrowed => format!("&handle<{}>", handle.resource_id), + ResourceMode::Owned => format!("handle<{}>", handle.resource_id), + }, } } @@ -187,7 +192,7 @@ impl TemplateClient for Temp let name = name.map(|n| n.0); - let templates: Vec