From 0c1c73cd71a3abbd248cd7fef34113b5154842d3 Mon Sep 17 00:00:00 2001 From: Daniel Vigovszky Date: Fri, 23 Feb 2024 10:03:54 +0100 Subject: [PATCH 1/5] Support the new handle type --- src/clients/template.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/clients/template.rs b/src/clients/template.rs index 109ed81..a527802 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), + }, } } From 401266b4ad8702d0629346e974484f90e77200b9 Mon Sep 17 00:00:00 2001 From: Simon Popugaev Date: Wed, 21 Feb 2024 21:35:59 +0300 Subject: [PATCH 2/5] operationId support --- src/clients/template.rs | 10 +++++----- src/clients/worker.rs | 24 ++++++++---------------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/clients/template.rs b/src/clients/template.rs index a527802..98bc5ef 100644 --- a/src/clients/template.rs +++ b/src/clients/template.rs @@ -192,7 +192,7 @@ impl TemplateClient for Temp let name = name.map(|n| n.0); - let templates: Vec