From 57b2ee6d2c486a15dd4b7d0132259514b01108ff Mon Sep 17 00:00:00 2001 From: Roman Volosatovs Date: Fri, 27 Sep 2024 16:31:51 +0200 Subject: [PATCH] chore: update dependencies Signed-off-by: Roman Volosatovs --- .../gen/wasi/clocks/wall-clock/wall-clock.wit.go | 5 +++++ .../gen/wasi/filesystem/types/types.wit.go | 3 +++ .../http-client/gen/wasi/http/types/types.wit.go | 3 +++ .../gen/wasi/sockets/network/network.wit.go | 2 ++ .../http-client/gen/wasi/sockets/udp/udp.wit.go | 2 ++ .../gen/wasmcloud/messaging/types/types.wit.go | 1 + .../gen/wasmcloud/secrets/store/store.wit.go | 2 +- _examples/http-client/go.mod | 6 +++--- _examples/http-client/go.sum | 12 ++++++------ .../{wadge_bindings_test.go => bindings.wadge.go} | 4 +++- .../gen/wasi/clocks/wall-clock/wall-clock.wit.go | 5 +++++ .../gen/wasi/filesystem/types/types.wit.go | 3 +++ .../http-server/gen/wasi/http/types/types.wit.go | 3 +++ .../gen/wasi/sockets/network/network.wit.go | 2 ++ .../http-server/gen/wasi/sockets/udp/udp.wit.go | 2 ++ .../gen/wasmcloud/messaging/types/types.wit.go | 1 + .../gen/wasmcloud/secrets/store/store.wit.go | 2 +- _examples/http-server/go.mod | 4 ++-- _examples/http-server/go.sum | 8 ++++---- _examples/http-server/main_test.go | 1 - gen/wasi/clocks/wall-clock/wall-clock.wit.go | 5 +++++ gen/wasi/filesystem/types/types.wit.go | 3 +++ gen/wasi/http/types/types.wit.go | 3 +++ gen/wasi/sockets/network/network.wit.go | 2 ++ gen/wasi/sockets/udp/udp.wit.go | 2 ++ gen/wasmcloud/messaging/handler/abi.go | 2 +- gen/wasmcloud/messaging/types/types.wit.go | 1 + gen/wasmcloud/secrets/store/store.wit.go | 2 +- go.mod | 8 ++++---- go.sum | 8 ++++++++ 30 files changed, 82 insertions(+), 25 deletions(-) rename _examples/http-server/{wadge_bindings_test.go => bindings.wadge.go} (99%) diff --git a/_examples/http-client/gen/wasi/clocks/wall-clock/wall-clock.wit.go b/_examples/http-client/gen/wasi/clocks/wall-clock/wall-clock.wit.go index a59a313..871a2e1 100644 --- a/_examples/http-client/gen/wasi/clocks/wall-clock/wall-clock.wit.go +++ b/_examples/http-client/gen/wasi/clocks/wall-clock/wall-clock.wit.go @@ -18,6 +18,10 @@ // It is intended for reporting the current date and time for humans. package wallclock +import ( + "github.com/bytecodealliance/wasm-tools-go/cm" +) + // DateTime represents the record "wasi:clocks/wall-clock@0.2.0#datetime". // // A time and date in seconds plus nanoseconds. @@ -27,6 +31,7 @@ package wallclock // nanoseconds: u32, // } type DateTime struct { + _ cm.HostLayout Seconds uint64 Nanoseconds uint32 } diff --git a/_examples/http-client/gen/wasi/filesystem/types/types.wit.go b/_examples/http-client/gen/wasi/filesystem/types/types.wit.go index 2c32fce..de3b9b8 100644 --- a/_examples/http-client/gen/wasi/filesystem/types/types.wit.go +++ b/_examples/http-client/gen/wasi/filesystem/types/types.wit.go @@ -227,6 +227,7 @@ type LinkCount uint64 // status-change-timestamp: option, // } type DescriptorStat struct { + _ cm.HostLayout // File type. Type DescriptorType @@ -315,6 +316,7 @@ func (self *NewTimestamp) Timestamp() *wallclock.DateTime { // name: string, // } type DirectoryEntry struct { + _ cm.HostLayout // The type of the file referred to by this directory entry. Type DescriptorType @@ -593,6 +595,7 @@ func (e Advice) String() string { // upper: u64, // } type MetadataHashValue struct { + _ cm.HostLayout // 64 bits of a 128-bit hash value. Lower uint64 diff --git a/_examples/http-client/gen/wasi/http/types/types.wit.go b/_examples/http-client/gen/wasi/http/types/types.wit.go index f4a092b..c95a2dd 100644 --- a/_examples/http-client/gen/wasi/http/types/types.wit.go +++ b/_examples/http-client/gen/wasi/http/types/types.wit.go @@ -194,6 +194,7 @@ func (self *Scheme) Other() *string { // info-code: option, // } type DNSErrorPayload struct { + _ cm.HostLayout Rcode cm.Option[string] InfoCode cm.Option[uint16] } @@ -207,6 +208,7 @@ type DNSErrorPayload struct { // alert-message: option, // } type TLSAlertReceivedPayload struct { + _ cm.HostLayout AlertID cm.Option[uint8] AlertMessage cm.Option[string] } @@ -220,6 +222,7 @@ type TLSAlertReceivedPayload struct { // field-size: option, // } type FieldSizePayload struct { + _ cm.HostLayout FieldName cm.Option[string] FieldSize cm.Option[uint32] } diff --git a/_examples/http-client/gen/wasi/sockets/network/network.wit.go b/_examples/http-client/gen/wasi/sockets/network/network.wit.go index b18bec9..bdc8634 100644 --- a/_examples/http-client/gen/wasi/sockets/network/network.wit.go +++ b/_examples/http-client/gen/wasi/sockets/network/network.wit.go @@ -257,6 +257,7 @@ func (self *IPAddress) IPv6() *IPv6Address { // address: ipv4-address, // } type IPv4SocketAddress struct { + _ cm.HostLayout // sin_port Port uint16 @@ -273,6 +274,7 @@ type IPv4SocketAddress struct { // scope-id: u32, // } type IPv6SocketAddress struct { + _ cm.HostLayout // sin6_port Port uint16 diff --git a/_examples/http-client/gen/wasi/sockets/udp/udp.wit.go b/_examples/http-client/gen/wasi/sockets/udp/udp.wit.go index bce399e..3638261 100644 --- a/_examples/http-client/gen/wasi/sockets/udp/udp.wit.go +++ b/_examples/http-client/gen/wasi/sockets/udp/udp.wit.go @@ -18,6 +18,7 @@ import ( // remote-address: ip-socket-address, // } type IncomingDatagram struct { + _ cm.HostLayout // The payload. // // Theoretical max size: ~64 KiB. In practice, typically less than 1500 bytes. @@ -41,6 +42,7 @@ type IncomingDatagram struct { // remote-address: option, // } type OutgoingDatagram struct { + _ cm.HostLayout // The payload. Data cm.List[uint8] diff --git a/_examples/http-client/gen/wasmcloud/messaging/types/types.wit.go b/_examples/http-client/gen/wasmcloud/messaging/types/types.wit.go index 6fbc9e9..d7cbb6b 100644 --- a/_examples/http-client/gen/wasmcloud/messaging/types/types.wit.go +++ b/_examples/http-client/gen/wasmcloud/messaging/types/types.wit.go @@ -19,6 +19,7 @@ import ( // reply-to: option, // } type BrokerMessage struct { + _ cm.HostLayout Subject string Body cm.List[uint8] ReplyTo cm.Option[string] diff --git a/_examples/http-client/gen/wasmcloud/secrets/store/store.wit.go b/_examples/http-client/gen/wasmcloud/secrets/store/store.wit.go index 06891e7..09dbab5 100644 --- a/_examples/http-client/gen/wasmcloud/secrets/store/store.wit.go +++ b/_examples/http-client/gen/wasmcloud/secrets/store/store.wit.go @@ -72,7 +72,7 @@ func (self *SecretsError) NotFound() bool { // store binary data as a secret. // // variant secret-value { -// string(string), +// %string(string), // bytes(list), // } type SecretValue cm.Variant[uint8, string, cm.List[uint8]] diff --git a/_examples/http-client/go.mod b/_examples/http-client/go.mod index 6880b69..9681361 100644 --- a/_examples/http-client/go.mod +++ b/_examples/http-client/go.mod @@ -3,14 +3,14 @@ module github.com/wasmCloud/component-sdk-go/_examples/http-client go 1.23.0 require ( - github.com/bytecodealliance/wasm-tools-go v0.2.0 - go.wasmcloud.dev/component v0.0.0-20240910182305-2785f866ff0f + github.com/bytecodealliance/wasm-tools-go v0.2.1 + go.wasmcloud.dev/component v0.0.0-20240926175945-14adda9179b6 ) require ( github.com/coreos/go-semver v0.3.1 // indirect github.com/urfave/cli/v3 v3.0.0-alpha9 // indirect - github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect + github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect golang.org/x/mod v0.21.0 // indirect ) diff --git a/_examples/http-client/go.sum b/_examples/http-client/go.sum index d4fb71d..2da8bed 100644 --- a/_examples/http-client/go.sum +++ b/_examples/http-client/go.sum @@ -1,5 +1,5 @@ -github.com/bytecodealliance/wasm-tools-go v0.2.0 h1:JdmiZew7ewHjf+ZGGRE4gZM85Ad/PGW/5I57hepEOjQ= -github.com/bytecodealliance/wasm-tools-go v0.2.0/go.mod h1:2GnJCUlcDrslZ/L6+yYqoUnewDlBvqRS2N/0NW9ro6w= +github.com/bytecodealliance/wasm-tools-go v0.2.1 h1:0o+zGdbgOcam4ZNA8NPS5Xxl1FV57XTeLerOJy4EVsY= +github.com/bytecodealliance/wasm-tools-go v0.2.1/go.mod h1:+h2zz8UoMx8l1F1b2pv6LCbZFc85HFQZDQcRdfa4ovs= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -12,14 +12,14 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/urfave/cli/v3 v3.0.0-alpha9 h1:P0RMy5fQm1AslQS+XCmy9UknDXctOmG/q/FZkUFnJSo= github.com/urfave/cli/v3 v3.0.0-alpha9/go.mod h1:0kK/RUFHyh+yIKSfWxwheGndfnrvYSmYFVeKCh03ZUc= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= +github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= +github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= -golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= +golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/_examples/http-server/wadge_bindings_test.go b/_examples/http-server/bindings.wadge.go similarity index 99% rename from _examples/http-server/wadge_bindings_test.go rename to _examples/http-server/bindings.wadge.go index 3a6d9f0..a2a0ba7 100644 --- a/_examples/http-server/wadge_bindings_test.go +++ b/_examples/http-server/bindings.wadge.go @@ -1,6 +1,8 @@ +//go:build !wasm && !wasi && !wasip1 && !wasip2 && !wasm_unknown && !tinygo.wasm + // Code generated by wadge-bindgen-go DO NOT EDIT -package main_test +package main import ( github_com__bytecodealliance__wasm___tools___go__cm "github.com/bytecodealliance/wasm-tools-go/cm" diff --git a/_examples/http-server/gen/wasi/clocks/wall-clock/wall-clock.wit.go b/_examples/http-server/gen/wasi/clocks/wall-clock/wall-clock.wit.go index a59a313..871a2e1 100644 --- a/_examples/http-server/gen/wasi/clocks/wall-clock/wall-clock.wit.go +++ b/_examples/http-server/gen/wasi/clocks/wall-clock/wall-clock.wit.go @@ -18,6 +18,10 @@ // It is intended for reporting the current date and time for humans. package wallclock +import ( + "github.com/bytecodealliance/wasm-tools-go/cm" +) + // DateTime represents the record "wasi:clocks/wall-clock@0.2.0#datetime". // // A time and date in seconds plus nanoseconds. @@ -27,6 +31,7 @@ package wallclock // nanoseconds: u32, // } type DateTime struct { + _ cm.HostLayout Seconds uint64 Nanoseconds uint32 } diff --git a/_examples/http-server/gen/wasi/filesystem/types/types.wit.go b/_examples/http-server/gen/wasi/filesystem/types/types.wit.go index b2a0f6c..e5977cb 100644 --- a/_examples/http-server/gen/wasi/filesystem/types/types.wit.go +++ b/_examples/http-server/gen/wasi/filesystem/types/types.wit.go @@ -227,6 +227,7 @@ type LinkCount uint64 // status-change-timestamp: option, // } type DescriptorStat struct { + _ cm.HostLayout // File type. Type DescriptorType @@ -315,6 +316,7 @@ func (self *NewTimestamp) Timestamp() *wallclock.DateTime { // name: string, // } type DirectoryEntry struct { + _ cm.HostLayout // The type of the file referred to by this directory entry. Type DescriptorType @@ -593,6 +595,7 @@ func (e Advice) String() string { // upper: u64, // } type MetadataHashValue struct { + _ cm.HostLayout // 64 bits of a 128-bit hash value. Lower uint64 diff --git a/_examples/http-server/gen/wasi/http/types/types.wit.go b/_examples/http-server/gen/wasi/http/types/types.wit.go index 98e7fb6..59255ab 100644 --- a/_examples/http-server/gen/wasi/http/types/types.wit.go +++ b/_examples/http-server/gen/wasi/http/types/types.wit.go @@ -194,6 +194,7 @@ func (self *Scheme) Other() *string { // info-code: option, // } type DNSErrorPayload struct { + _ cm.HostLayout Rcode cm.Option[string] InfoCode cm.Option[uint16] } @@ -207,6 +208,7 @@ type DNSErrorPayload struct { // alert-message: option, // } type TLSAlertReceivedPayload struct { + _ cm.HostLayout AlertID cm.Option[uint8] AlertMessage cm.Option[string] } @@ -220,6 +222,7 @@ type TLSAlertReceivedPayload struct { // field-size: option, // } type FieldSizePayload struct { + _ cm.HostLayout FieldName cm.Option[string] FieldSize cm.Option[uint32] } diff --git a/_examples/http-server/gen/wasi/sockets/network/network.wit.go b/_examples/http-server/gen/wasi/sockets/network/network.wit.go index b18bec9..bdc8634 100644 --- a/_examples/http-server/gen/wasi/sockets/network/network.wit.go +++ b/_examples/http-server/gen/wasi/sockets/network/network.wit.go @@ -257,6 +257,7 @@ func (self *IPAddress) IPv6() *IPv6Address { // address: ipv4-address, // } type IPv4SocketAddress struct { + _ cm.HostLayout // sin_port Port uint16 @@ -273,6 +274,7 @@ type IPv4SocketAddress struct { // scope-id: u32, // } type IPv6SocketAddress struct { + _ cm.HostLayout // sin6_port Port uint16 diff --git a/_examples/http-server/gen/wasi/sockets/udp/udp.wit.go b/_examples/http-server/gen/wasi/sockets/udp/udp.wit.go index 55e1ead..1a384d0 100644 --- a/_examples/http-server/gen/wasi/sockets/udp/udp.wit.go +++ b/_examples/http-server/gen/wasi/sockets/udp/udp.wit.go @@ -18,6 +18,7 @@ import ( // remote-address: ip-socket-address, // } type IncomingDatagram struct { + _ cm.HostLayout // The payload. // // Theoretical max size: ~64 KiB. In practice, typically less than 1500 bytes. @@ -41,6 +42,7 @@ type IncomingDatagram struct { // remote-address: option, // } type OutgoingDatagram struct { + _ cm.HostLayout // The payload. Data cm.List[uint8] diff --git a/_examples/http-server/gen/wasmcloud/messaging/types/types.wit.go b/_examples/http-server/gen/wasmcloud/messaging/types/types.wit.go index 6fbc9e9..d7cbb6b 100644 --- a/_examples/http-server/gen/wasmcloud/messaging/types/types.wit.go +++ b/_examples/http-server/gen/wasmcloud/messaging/types/types.wit.go @@ -19,6 +19,7 @@ import ( // reply-to: option, // } type BrokerMessage struct { + _ cm.HostLayout Subject string Body cm.List[uint8] ReplyTo cm.Option[string] diff --git a/_examples/http-server/gen/wasmcloud/secrets/store/store.wit.go b/_examples/http-server/gen/wasmcloud/secrets/store/store.wit.go index 06891e7..09dbab5 100644 --- a/_examples/http-server/gen/wasmcloud/secrets/store/store.wit.go +++ b/_examples/http-server/gen/wasmcloud/secrets/store/store.wit.go @@ -72,7 +72,7 @@ func (self *SecretsError) NotFound() bool { // store binary data as a secret. // // variant secret-value { -// string(string), +// %string(string), // bytes(list), // } type SecretValue cm.Variant[uint8, string, cm.List[uint8]] diff --git a/_examples/http-server/go.mod b/_examples/http-server/go.mod index 9426411..6767dbb 100644 --- a/_examples/http-server/go.mod +++ b/_examples/http-server/go.mod @@ -3,10 +3,10 @@ module github.com/wasmCloud/component-sdk-go/_examples/http-server go 1.23.0 require ( - github.com/bytecodealliance/wasm-tools-go v0.2.0 + github.com/bytecodealliance/wasm-tools-go v0.2.1 github.com/stretchr/testify v1.9.0 go.wasmcloud.dev/component v0.0.0-20240926162413-717d12d37e0f - go.wasmcloud.dev/wadge v0.4.1 + go.wasmcloud.dev/wadge v0.5.0 ) require ( diff --git a/_examples/http-server/go.sum b/_examples/http-server/go.sum index 70f39a8..a60f25e 100644 --- a/_examples/http-server/go.sum +++ b/_examples/http-server/go.sum @@ -1,5 +1,5 @@ -github.com/bytecodealliance/wasm-tools-go v0.2.0 h1:JdmiZew7ewHjf+ZGGRE4gZM85Ad/PGW/5I57hepEOjQ= -github.com/bytecodealliance/wasm-tools-go v0.2.0/go.mod h1:2GnJCUlcDrslZ/L6+yYqoUnewDlBvqRS2N/0NW9ro6w= +github.com/bytecodealliance/wasm-tools-go v0.2.1 h1:0o+zGdbgOcam4ZNA8NPS5Xxl1FV57XTeLerOJy4EVsY= +github.com/bytecodealliance/wasm-tools-go v0.2.1/go.mod h1:+h2zz8UoMx8l1F1b2pv6LCbZFc85HFQZDQcRdfa4ovs= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -18,8 +18,8 @@ github.com/urfave/cli/v3 v3.0.0-alpha9 h1:P0RMy5fQm1AslQS+XCmy9UknDXctOmG/q/FZkU github.com/urfave/cli/v3 v3.0.0-alpha9/go.mod h1:0kK/RUFHyh+yIKSfWxwheGndfnrvYSmYFVeKCh03ZUc= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= -go.wasmcloud.dev/wadge v0.4.1 h1:ALqkeC0eGTXVXgFtD9tatq+RHYlFLxduy+TTdirHNv0= -go.wasmcloud.dev/wadge v0.4.1/go.mod h1:eBW4rF7xK3jpk+NX7vRxNJXAzo1L29nb/jguwDisXr0= +go.wasmcloud.dev/wadge v0.5.0 h1:MQQN3fN9K0ntw214KEPryH5/8ZUQx9jOY3rnYuIyZpY= +go.wasmcloud.dev/wadge v0.5.0/go.mod h1:BkAxt9wF08UWbRYblfxbTtupn0rQLtsgTKeu22SBGRg= golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= diff --git a/_examples/http-server/main_test.go b/_examples/http-server/main_test.go index c5a9615..5d81cdf 100644 --- a/_examples/http-server/main_test.go +++ b/_examples/http-server/main_test.go @@ -13,7 +13,6 @@ import ( "github.com/stretchr/testify/assert" incominghandler "go.wasmcloud.dev/component/gen/wasi/http/incoming-handler" "go.wasmcloud.dev/wadge" - _ "go.wasmcloud.dev/wadge/bindings" "go.wasmcloud.dev/wadge/wadgehttp" ) diff --git a/gen/wasi/clocks/wall-clock/wall-clock.wit.go b/gen/wasi/clocks/wall-clock/wall-clock.wit.go index a59a313..871a2e1 100644 --- a/gen/wasi/clocks/wall-clock/wall-clock.wit.go +++ b/gen/wasi/clocks/wall-clock/wall-clock.wit.go @@ -18,6 +18,10 @@ // It is intended for reporting the current date and time for humans. package wallclock +import ( + "github.com/bytecodealliance/wasm-tools-go/cm" +) + // DateTime represents the record "wasi:clocks/wall-clock@0.2.0#datetime". // // A time and date in seconds plus nanoseconds. @@ -27,6 +31,7 @@ package wallclock // nanoseconds: u32, // } type DateTime struct { + _ cm.HostLayout Seconds uint64 Nanoseconds uint32 } diff --git a/gen/wasi/filesystem/types/types.wit.go b/gen/wasi/filesystem/types/types.wit.go index 3fd9f9c..3ecbe33 100644 --- a/gen/wasi/filesystem/types/types.wit.go +++ b/gen/wasi/filesystem/types/types.wit.go @@ -227,6 +227,7 @@ type LinkCount uint64 // status-change-timestamp: option, // } type DescriptorStat struct { + _ cm.HostLayout // File type. Type DescriptorType @@ -315,6 +316,7 @@ func (self *NewTimestamp) Timestamp() *wallclock.DateTime { // name: string, // } type DirectoryEntry struct { + _ cm.HostLayout // The type of the file referred to by this directory entry. Type DescriptorType @@ -593,6 +595,7 @@ func (e Advice) String() string { // upper: u64, // } type MetadataHashValue struct { + _ cm.HostLayout // 64 bits of a 128-bit hash value. Lower uint64 diff --git a/gen/wasi/http/types/types.wit.go b/gen/wasi/http/types/types.wit.go index 6424a00..347c324 100644 --- a/gen/wasi/http/types/types.wit.go +++ b/gen/wasi/http/types/types.wit.go @@ -194,6 +194,7 @@ func (self *Scheme) Other() *string { // info-code: option, // } type DNSErrorPayload struct { + _ cm.HostLayout Rcode cm.Option[string] InfoCode cm.Option[uint16] } @@ -207,6 +208,7 @@ type DNSErrorPayload struct { // alert-message: option, // } type TLSAlertReceivedPayload struct { + _ cm.HostLayout AlertID cm.Option[uint8] AlertMessage cm.Option[string] } @@ -220,6 +222,7 @@ type TLSAlertReceivedPayload struct { // field-size: option, // } type FieldSizePayload struct { + _ cm.HostLayout FieldName cm.Option[string] FieldSize cm.Option[uint32] } diff --git a/gen/wasi/sockets/network/network.wit.go b/gen/wasi/sockets/network/network.wit.go index b18bec9..bdc8634 100644 --- a/gen/wasi/sockets/network/network.wit.go +++ b/gen/wasi/sockets/network/network.wit.go @@ -257,6 +257,7 @@ func (self *IPAddress) IPv6() *IPv6Address { // address: ipv4-address, // } type IPv4SocketAddress struct { + _ cm.HostLayout // sin_port Port uint16 @@ -273,6 +274,7 @@ type IPv4SocketAddress struct { // scope-id: u32, // } type IPv6SocketAddress struct { + _ cm.HostLayout // sin6_port Port uint16 diff --git a/gen/wasi/sockets/udp/udp.wit.go b/gen/wasi/sockets/udp/udp.wit.go index b6f9c8d..b66c9cd 100644 --- a/gen/wasi/sockets/udp/udp.wit.go +++ b/gen/wasi/sockets/udp/udp.wit.go @@ -18,6 +18,7 @@ import ( // remote-address: ip-socket-address, // } type IncomingDatagram struct { + _ cm.HostLayout // The payload. // // Theoretical max size: ~64 KiB. In practice, typically less than 1500 bytes. @@ -41,6 +42,7 @@ type IncomingDatagram struct { // remote-address: option, // } type OutgoingDatagram struct { + _ cm.HostLayout // The payload. Data cm.List[uint8] diff --git a/gen/wasmcloud/messaging/handler/abi.go b/gen/wasmcloud/messaging/handler/abi.go index e2b9148..95b5082 100644 --- a/gen/wasmcloud/messaging/handler/abi.go +++ b/gen/wasmcloud/messaging/handler/abi.go @@ -11,7 +11,7 @@ func lift_OptionString(f0 uint32, f1 *uint8, f2 uint32) (v cm.Option[string]) { if f0 == 0 { return } - return cm.Some[string](cm.LiftString[string]((*uint8)(f1), (uint32)(f2))) + return (cm.Option[string])(cm.Some[string](cm.LiftString[string]((*uint8)(f1), (uint32)(f2)))) } func lift_BrokerMessage(f0 *uint8, f1 uint32, f2 *uint8, f3 uint32, f4 uint32, f5 *uint8, f6 uint32) (v types.BrokerMessage) { diff --git a/gen/wasmcloud/messaging/types/types.wit.go b/gen/wasmcloud/messaging/types/types.wit.go index 6fbc9e9..d7cbb6b 100644 --- a/gen/wasmcloud/messaging/types/types.wit.go +++ b/gen/wasmcloud/messaging/types/types.wit.go @@ -19,6 +19,7 @@ import ( // reply-to: option, // } type BrokerMessage struct { + _ cm.HostLayout Subject string Body cm.List[uint8] ReplyTo cm.Option[string] diff --git a/gen/wasmcloud/secrets/store/store.wit.go b/gen/wasmcloud/secrets/store/store.wit.go index 06891e7..09dbab5 100644 --- a/gen/wasmcloud/secrets/store/store.wit.go +++ b/gen/wasmcloud/secrets/store/store.wit.go @@ -72,7 +72,7 @@ func (self *SecretsError) NotFound() bool { // store binary data as a secret. // // variant secret-value { -// string(string), +// %string(string), // bytes(list), // } type SecretValue cm.Variant[uint8, string, cm.List[uint8]] diff --git a/go.mod b/go.mod index 95eeb6d..f1b5e54 100644 --- a/go.mod +++ b/go.mod @@ -3,15 +3,15 @@ module go.wasmcloud.dev/component go 1.23.0 require ( - github.com/bytecodealliance/wasm-tools-go v0.2.0 + github.com/bytecodealliance/wasm-tools-go v0.2.1 github.com/samber/slog-common v0.17.1 ) require ( github.com/coreos/go-semver v0.3.1 // indirect - github.com/samber/lo v1.44.0 // indirect + github.com/samber/lo v1.47.0 // indirect github.com/urfave/cli/v3 v3.0.0-alpha9 // indirect - github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect + github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect golang.org/x/mod v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/text v0.18.0 // indirect ) diff --git a/go.sum b/go.sum index def9360..8074012 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/bytecodealliance/wasm-tools-go v0.2.0 h1:JdmiZew7ewHjf+ZGGRE4gZM85Ad/PGW/5I57hepEOjQ= github.com/bytecodealliance/wasm-tools-go v0.2.0/go.mod h1:2GnJCUlcDrslZ/L6+yYqoUnewDlBvqRS2N/0NW9ro6w= +github.com/bytecodealliance/wasm-tools-go v0.2.1 h1:0o+zGdbgOcam4ZNA8NPS5Xxl1FV57XTeLerOJy4EVsY= +github.com/bytecodealliance/wasm-tools-go v0.2.1/go.mod h1:+h2zz8UoMx8l1F1b2pv6LCbZFc85HFQZDQcRdfa4ovs= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -8,6 +10,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/samber/lo v1.44.0 h1:5il56KxRE+GHsm1IR+sZ/6J42NODigFiqCWpSc2dybA= github.com/samber/lo v1.44.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU= +github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc= +github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU= github.com/samber/slog-common v0.17.1 h1:jTqqLBgoJshpoxlPSGiypyOanjH6tY+i9bwyYmIbjhI= github.com/samber/slog-common v0.17.1/go.mod h1:mZSJhinB4aqHziR0SKPqpVZjJ0JO35JfH+dDIWqaCBk= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= @@ -18,12 +22,16 @@ github.com/urfave/cli/v3 v3.0.0-alpha9 h1:P0RMy5fQm1AslQS+XCmy9UknDXctOmG/q/FZkU github.com/urfave/cli/v3 v3.0.0-alpha9/go.mod h1:0kK/RUFHyh+yIKSfWxwheGndfnrvYSmYFVeKCh03ZUc= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= +github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= +github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=