├── .github ├── CODEOWNERS └── workflows │ ├── go.yaml │ └── wit.yaml ├── .gitignore ├── .golangci.yaml ├── LICENSE ├── MAINTAINERS.md ├── README.md ├── _examples ├── http-client │ ├── .gitignore │ ├── build │ │ └── .gitignore │ ├── gen │ │ ├── example │ │ │ └── http-client │ │ │ │ └── example │ │ │ │ ├── example.wit │ │ │ │ └── example.wit.go │ │ ├── wasi │ │ │ ├── cli │ │ │ │ ├── environment │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── environment.wasm.go │ │ │ │ │ └── environment.wit.go │ │ │ │ ├── exit │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── exit.wasm.go │ │ │ │ │ └── exit.wit.go │ │ │ │ ├── stderr │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── stderr.wasm.go │ │ │ │ │ └── stderr.wit.go │ │ │ │ ├── stdin │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── stdin.wasm.go │ │ │ │ │ └── stdin.wit.go │ │ │ │ ├── stdout │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── stdout.wasm.go │ │ │ │ │ └── stdout.wit.go │ │ │ │ ├── terminal-input │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── terminal-input.wit.go │ │ │ │ │ └── terminalinput.wasm.go │ │ │ │ ├── terminal-output │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── terminal-output.wit.go │ │ │ │ │ └── terminaloutput.wasm.go │ │ │ │ ├── terminal-stderr │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── terminal-stderr.wit.go │ │ │ │ │ └── terminalstderr.wasm.go │ │ │ │ ├── terminal-stdin │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── terminal-stdin.wit.go │ │ │ │ │ └── terminalstdin.wasm.go │ │ │ │ └── terminal-stdout │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── terminal-stdout.wit.go │ │ │ │ │ └── terminalstdout.wasm.go │ │ │ ├── clocks │ │ │ │ ├── monotonic-clock │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── monotonic-clock.wit.go │ │ │ │ │ └── monotonicclock.wasm.go │ │ │ │ └── wall-clock │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── wall-clock.wit.go │ │ │ │ │ └── wallclock.wasm.go │ │ │ ├── config │ │ │ │ └── runtime │ │ │ │ │ ├── abi.go │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── runtime.wasm.go │ │ │ │ │ └── runtime.wit.go │ │ │ ├── filesystem │ │ │ │ ├── preopens │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── preopens.wasm.go │ │ │ │ │ └── preopens.wit.go │ │ │ │ └── types │ │ │ │ │ ├── abi.go │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── types.wasm.go │ │ │ │ │ └── types.wit.go │ │ │ ├── http │ │ │ │ ├── incoming-handler │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── incoming-handler.exports.go │ │ │ │ │ ├── incoming-handler.wit.go │ │ │ │ │ └── incominghandler.wasm.go │ │ │ │ ├── outgoing-handler │ │ │ │ │ ├── abi.go │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── outgoing-handler.wit.go │ │ │ │ │ └── outgoinghandler.wasm.go │ │ │ │ └── types │ │ │ │ │ ├── abi.go │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── types.wasm.go │ │ │ │ │ └── types.wit.go │ │ │ ├── io │ │ │ │ ├── error │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── error.wit.go │ │ │ │ │ └── ioerror.wasm.go │ │ │ │ ├── poll │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── poll.wasm.go │ │ │ │ │ └── poll.wit.go │ │ │ │ └── streams │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── streams.wasm.go │ │ │ │ │ └── streams.wit.go │ │ │ ├── logging │ │ │ │ └── logging │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── logging.wasm.go │ │ │ │ │ └── logging.wit.go │ │ │ ├── random │ │ │ │ ├── insecure-seed │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── insecure-seed.wit.go │ │ │ │ │ └── insecureseed.wasm.go │ │ │ │ ├── insecure │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── insecure.wasm.go │ │ │ │ │ └── insecure.wit.go │ │ │ │ └── random │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── random.wasm.go │ │ │ │ │ └── random.wit.go │ │ │ └── sockets │ │ │ │ ├── instance-network │ │ │ │ ├── empty.s │ │ │ │ ├── instance-network.wit.go │ │ │ │ └── instancenetwork.wasm.go │ │ │ │ ├── ip-name-lookup │ │ │ │ ├── abi.go │ │ │ │ ├── empty.s │ │ │ │ ├── ip-name-lookup.wit.go │ │ │ │ └── ipnamelookup.wasm.go │ │ │ │ ├── network │ │ │ │ ├── abi.go │ │ │ │ ├── empty.s │ │ │ │ ├── network.wasm.go │ │ │ │ └── network.wit.go │ │ │ │ ├── tcp-create-socket │ │ │ │ ├── empty.s │ │ │ │ ├── tcp-create-socket.wit.go │ │ │ │ └── tcpcreatesocket.wasm.go │ │ │ │ ├── tcp │ │ │ │ ├── abi.go │ │ │ │ ├── empty.s │ │ │ │ ├── tcp.wasm.go │ │ │ │ └── tcp.wit.go │ │ │ │ ├── udp-create-socket │ │ │ │ ├── empty.s │ │ │ │ ├── udp-create-socket.wit.go │ │ │ │ └── udpcreatesocket.wasm.go │ │ │ │ └── udp │ │ │ │ ├── abi.go │ │ │ │ ├── empty.s │ │ │ │ ├── udp.wasm.go │ │ │ │ └── udp.wit.go │ │ └── wasmcloud │ │ │ ├── bus │ │ │ └── lattice │ │ │ │ ├── empty.s │ │ │ │ ├── lattice.wasm.go │ │ │ │ └── lattice.wit.go │ │ │ └── secrets │ │ │ ├── reveal │ │ │ ├── empty.s │ │ │ ├── reveal.wasm.go │ │ │ └── reveal.wit.go │ │ │ └── store │ │ │ ├── abi.go │ │ │ ├── empty.s │ │ │ ├── store.wasm.go │ │ │ └── store.wit.go │ ├── go.mod │ ├── go.sum │ ├── main.go │ ├── tools.go │ ├── wadm.yaml │ ├── wasmcloud.toml │ ├── wit │ │ ├── deps │ │ │ ├── wasi-cli-0.2.0 │ │ │ │ └── package.wit │ │ │ ├── wasi-clocks-0.2.0 │ │ │ │ └── package.wit │ │ │ ├── wasi-config-0.2.0-draft │ │ │ │ └── package.wit │ │ │ ├── wasi-filesystem-0.2.0 │ │ │ │ └── package.wit │ │ │ ├── wasi-http-0.2.0 │ │ │ │ └── package.wit │ │ │ ├── wasi-io-0.2.0 │ │ │ │ └── package.wit │ │ │ ├── wasi-logging-0.1.0-draft │ │ │ │ └── package.wit │ │ │ ├── wasi-random-0.2.0 │ │ │ │ └── package.wit │ │ │ ├── wasi-sockets-0.2.0 │ │ │ │ └── package.wit │ │ │ ├── wasmcloud-bus-1.0.0 │ │ │ │ └── package.wit │ │ │ ├── wasmcloud-component-go-0.1.0 │ │ │ │ └── package.wit │ │ │ └── wasmcloud-secrets-0.1.0-draft │ │ │ │ └── package.wit │ │ └── world.wit │ └── wkg.lock ├── http-server │ ├── .gitignore │ ├── bindings.wadge_test.go │ ├── build │ │ └── .gitignore │ ├── gen │ │ ├── example │ │ │ └── http-server │ │ │ │ └── example │ │ │ │ ├── example.wit │ │ │ │ └── example.wit.go │ │ ├── wasi │ │ │ ├── cli │ │ │ │ ├── environment │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── environment.wasm.go │ │ │ │ │ └── environment.wit.go │ │ │ │ ├── exit │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── exit.wasm.go │ │ │ │ │ └── exit.wit.go │ │ │ │ ├── stderr │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── stderr.wasm.go │ │ │ │ │ └── stderr.wit.go │ │ │ │ ├── stdin │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── stdin.wasm.go │ │ │ │ │ └── stdin.wit.go │ │ │ │ ├── stdout │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── stdout.wasm.go │ │ │ │ │ └── stdout.wit.go │ │ │ │ ├── terminal-input │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── terminal-input.wit.go │ │ │ │ │ └── terminalinput.wasm.go │ │ │ │ ├── terminal-output │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── terminal-output.wit.go │ │ │ │ │ └── terminaloutput.wasm.go │ │ │ │ ├── terminal-stderr │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── terminal-stderr.wit.go │ │ │ │ │ └── terminalstderr.wasm.go │ │ │ │ ├── terminal-stdin │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── terminal-stdin.wit.go │ │ │ │ │ └── terminalstdin.wasm.go │ │ │ │ └── terminal-stdout │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── terminal-stdout.wit.go │ │ │ │ │ └── terminalstdout.wasm.go │ │ │ ├── clocks │ │ │ │ ├── monotonic-clock │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── monotonic-clock.wit.go │ │ │ │ │ └── monotonicclock.wasm.go │ │ │ │ └── wall-clock │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── wall-clock.wit.go │ │ │ │ │ └── wallclock.wasm.go │ │ │ ├── config │ │ │ │ └── runtime │ │ │ │ │ ├── abi.go │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── runtime.wasm.go │ │ │ │ │ └── runtime.wit.go │ │ │ ├── filesystem │ │ │ │ ├── preopens │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── preopens.wasm.go │ │ │ │ │ └── preopens.wit.go │ │ │ │ └── types │ │ │ │ │ ├── abi.go │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── types.wasm.go │ │ │ │ │ └── types.wit.go │ │ │ ├── http │ │ │ │ ├── incoming-handler │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── incoming-handler.exports.go │ │ │ │ │ ├── incoming-handler.wit.go │ │ │ │ │ └── incominghandler.wasm.go │ │ │ │ ├── outgoing-handler │ │ │ │ │ ├── abi.go │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── outgoing-handler.wit.go │ │ │ │ │ └── outgoinghandler.wasm.go │ │ │ │ └── types │ │ │ │ │ ├── abi.go │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── types.wasm.go │ │ │ │ │ └── types.wit.go │ │ │ ├── io │ │ │ │ ├── error │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── error.wit.go │ │ │ │ │ └── ioerror.wasm.go │ │ │ │ ├── poll │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── poll.wasm.go │ │ │ │ │ └── poll.wit.go │ │ │ │ └── streams │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── streams.wasm.go │ │ │ │ │ └── streams.wit.go │ │ │ ├── logging │ │ │ │ └── logging │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── logging.wasm.go │ │ │ │ │ └── logging.wit.go │ │ │ ├── random │ │ │ │ ├── insecure-seed │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── insecure-seed.wit.go │ │ │ │ │ └── insecureseed.wasm.go │ │ │ │ ├── insecure │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── insecure.wasm.go │ │ │ │ │ └── insecure.wit.go │ │ │ │ └── random │ │ │ │ │ ├── empty.s │ │ │ │ │ ├── random.wasm.go │ │ │ │ │ └── random.wit.go │ │ │ └── sockets │ │ │ │ ├── instance-network │ │ │ │ ├── empty.s │ │ │ │ ├── instance-network.wit.go │ │ │ │ └── instancenetwork.wasm.go │ │ │ │ ├── ip-name-lookup │ │ │ │ ├── abi.go │ │ │ │ ├── empty.s │ │ │ │ ├── ip-name-lookup.wit.go │ │ │ │ └── ipnamelookup.wasm.go │ │ │ │ ├── network │ │ │ │ ├── abi.go │ │ │ │ ├── empty.s │ │ │ │ ├── network.wasm.go │ │ │ │ └── network.wit.go │ │ │ │ ├── tcp-create-socket │ │ │ │ ├── empty.s │ │ │ │ ├── tcp-create-socket.wit.go │ │ │ │ └── tcpcreatesocket.wasm.go │ │ │ │ ├── tcp │ │ │ │ ├── abi.go │ │ │ │ ├── empty.s │ │ │ │ ├── tcp.wasm.go │ │ │ │ └── tcp.wit.go │ │ │ │ ├── udp-create-socket │ │ │ │ ├── empty.s │ │ │ │ ├── udp-create-socket.wit.go │ │ │ │ └── udpcreatesocket.wasm.go │ │ │ │ └── udp │ │ │ │ ├── abi.go │ │ │ │ ├── empty.s │ │ │ │ ├── udp.wasm.go │ │ │ │ └── udp.wit.go │ │ └── wasmcloud │ │ │ ├── bus │ │ │ └── lattice │ │ │ │ ├── empty.s │ │ │ │ ├── lattice.wasm.go │ │ │ │ └── lattice.wit.go │ │ │ └── secrets │ │ │ ├── reveal │ │ │ ├── empty.s │ │ │ ├── reveal.wasm.go │ │ │ └── reveal.wit.go │ │ │ └── store │ │ │ ├── abi.go │ │ │ ├── empty.s │ │ │ ├── store.wasm.go │ │ │ └── store.wit.go │ ├── go.mod │ ├── go.sum │ ├── main.go │ ├── main_test.go │ ├── tools.go │ ├── wadm.yaml │ ├── wasmcloud.toml │ ├── wit │ │ ├── deps │ │ │ ├── wasi-cli-0.2.0 │ │ │ │ └── package.wit │ │ │ ├── wasi-clocks-0.2.0 │ │ │ │ └── package.wit │ │ │ ├── wasi-config-0.2.0-draft │ │ │ │ └── package.wit │ │ │ ├── wasi-filesystem-0.2.0 │ │ │ │ └── package.wit │ │ │ ├── wasi-http-0.2.0 │ │ │ │ └── package.wit │ │ │ ├── wasi-io-0.2.0 │ │ │ │ └── package.wit │ │ │ ├── wasi-logging-0.1.0-draft │ │ │ │ └── package.wit │ │ │ ├── wasi-random-0.2.0 │ │ │ │ └── package.wit │ │ │ ├── wasi-sockets-0.2.0 │ │ │ │ └── package.wit │ │ │ ├── wasmcloud-bus-1.0.0 │ │ │ │ └── package.wit │ │ │ ├── wasmcloud-component-go-0.1.0 │ │ │ │ └── package.wit │ │ │ └── wasmcloud-secrets-0.1.0-draft │ │ │ │ └── package.wit │ │ └── world.wit │ └── wkg.lock └── invoke │ ├── .gitignore │ ├── README.md │ ├── bindings.wadge_test.go │ ├── build │ └── .gitignore │ ├── gen │ ├── example │ │ └── invoker │ │ │ ├── example │ │ │ ├── example.wit │ │ │ └── example.wit.go │ │ │ └── invoker │ │ │ ├── empty.s │ │ │ ├── invoker.exports.go │ │ │ ├── invoker.wasm.go │ │ │ └── invoker.wit.go │ ├── wasi │ │ ├── cli │ │ │ ├── environment │ │ │ │ ├── empty.s │ │ │ │ ├── environment.wasm.go │ │ │ │ └── environment.wit.go │ │ │ ├── exit │ │ │ │ ├── empty.s │ │ │ │ ├── exit.wasm.go │ │ │ │ └── exit.wit.go │ │ │ ├── stderr │ │ │ │ ├── empty.s │ │ │ │ ├── stderr.wasm.go │ │ │ │ └── stderr.wit.go │ │ │ ├── stdin │ │ │ │ ├── empty.s │ │ │ │ ├── stdin.wasm.go │ │ │ │ └── stdin.wit.go │ │ │ ├── stdout │ │ │ │ ├── empty.s │ │ │ │ ├── stdout.wasm.go │ │ │ │ └── stdout.wit.go │ │ │ ├── terminal-input │ │ │ │ ├── empty.s │ │ │ │ ├── terminal-input.wit.go │ │ │ │ └── terminalinput.wasm.go │ │ │ ├── terminal-output │ │ │ │ ├── empty.s │ │ │ │ ├── terminal-output.wit.go │ │ │ │ └── terminaloutput.wasm.go │ │ │ ├── terminal-stderr │ │ │ │ ├── empty.s │ │ │ │ ├── terminal-stderr.wit.go │ │ │ │ └── terminalstderr.wasm.go │ │ │ ├── terminal-stdin │ │ │ │ ├── empty.s │ │ │ │ ├── terminal-stdin.wit.go │ │ │ │ └── terminalstdin.wasm.go │ │ │ └── terminal-stdout │ │ │ │ ├── empty.s │ │ │ │ ├── terminal-stdout.wit.go │ │ │ │ └── terminalstdout.wasm.go │ │ ├── clocks │ │ │ ├── monotonic-clock │ │ │ │ ├── empty.s │ │ │ │ ├── monotonic-clock.wit.go │ │ │ │ └── monotonicclock.wasm.go │ │ │ └── wall-clock │ │ │ │ ├── empty.s │ │ │ │ ├── wall-clock.wit.go │ │ │ │ └── wallclock.wasm.go │ │ ├── config │ │ │ └── runtime │ │ │ │ ├── abi.go │ │ │ │ ├── empty.s │ │ │ │ ├── runtime.wasm.go │ │ │ │ └── runtime.wit.go │ │ ├── filesystem │ │ │ ├── preopens │ │ │ │ ├── empty.s │ │ │ │ ├── preopens.wasm.go │ │ │ │ └── preopens.wit.go │ │ │ └── types │ │ │ │ ├── abi.go │ │ │ │ ├── empty.s │ │ │ │ ├── types.wasm.go │ │ │ │ └── types.wit.go │ │ ├── http │ │ │ ├── outgoing-handler │ │ │ │ ├── abi.go │ │ │ │ ├── empty.s │ │ │ │ ├── outgoing-handler.wit.go │ │ │ │ └── outgoinghandler.wasm.go │ │ │ └── types │ │ │ │ ├── abi.go │ │ │ │ ├── empty.s │ │ │ │ ├── types.wasm.go │ │ │ │ └── types.wit.go │ │ ├── io │ │ │ ├── error │ │ │ │ ├── empty.s │ │ │ │ ├── error.wit.go │ │ │ │ └── ioerror.wasm.go │ │ │ ├── poll │ │ │ │ ├── empty.s │ │ │ │ ├── poll.wasm.go │ │ │ │ └── poll.wit.go │ │ │ └── streams │ │ │ │ ├── abi.go │ │ │ │ ├── empty.s │ │ │ │ ├── streams.wasm.go │ │ │ │ └── streams.wit.go │ │ ├── logging │ │ │ └── logging │ │ │ │ ├── empty.s │ │ │ │ ├── logging.wasm.go │ │ │ │ └── logging.wit.go │ │ ├── random │ │ │ ├── insecure-seed │ │ │ │ ├── empty.s │ │ │ │ ├── insecure-seed.wit.go │ │ │ │ └── insecureseed.wasm.go │ │ │ ├── insecure │ │ │ │ ├── empty.s │ │ │ │ ├── insecure.wasm.go │ │ │ │ └── insecure.wit.go │ │ │ └── random │ │ │ │ ├── empty.s │ │ │ │ ├── random.wasm.go │ │ │ │ └── random.wit.go │ │ └── sockets │ │ │ ├── instance-network │ │ │ ├── empty.s │ │ │ ├── instance-network.wit.go │ │ │ └── instancenetwork.wasm.go │ │ │ ├── ip-name-lookup │ │ │ ├── abi.go │ │ │ ├── empty.s │ │ │ ├── ip-name-lookup.wit.go │ │ │ └── ipnamelookup.wasm.go │ │ │ ├── network │ │ │ ├── abi.go │ │ │ ├── empty.s │ │ │ ├── network.wasm.go │ │ │ └── network.wit.go │ │ │ ├── tcp-create-socket │ │ │ ├── empty.s │ │ │ ├── tcp-create-socket.wit.go │ │ │ └── tcpcreatesocket.wasm.go │ │ │ ├── tcp │ │ │ ├── abi.go │ │ │ ├── empty.s │ │ │ ├── tcp.wasm.go │ │ │ └── tcp.wit.go │ │ │ ├── udp-create-socket │ │ │ ├── empty.s │ │ │ ├── udp-create-socket.wit.go │ │ │ └── udpcreatesocket.wasm.go │ │ │ └── udp │ │ │ ├── abi.go │ │ │ ├── empty.s │ │ │ ├── udp.wasm.go │ │ │ └── udp.wit.go │ └── wasmcloud │ │ ├── bus │ │ └── lattice │ │ │ ├── empty.s │ │ │ ├── lattice.wasm.go │ │ │ └── lattice.wit.go │ │ └── secrets │ │ ├── reveal │ │ ├── empty.s │ │ ├── reveal.wasm.go │ │ └── reveal.wit.go │ │ └── store │ │ ├── abi.go │ │ ├── empty.s │ │ ├── store.wasm.go │ │ └── store.wit.go │ ├── go.mod │ ├── go.sum │ ├── main.go │ ├── main_test.go │ ├── tools.go │ ├── wadm.yaml │ ├── wasmcloud.toml │ ├── wit │ ├── deps │ │ ├── wasi-cli-0.2.0 │ │ │ └── package.wit │ │ ├── wasi-clocks-0.2.0 │ │ │ └── package.wit │ │ ├── wasi-config-0.2.0-draft │ │ │ └── package.wit │ │ ├── wasi-filesystem-0.2.0 │ │ │ └── package.wit │ │ ├── wasi-http-0.2.0 │ │ │ └── package.wit │ │ ├── wasi-io-0.2.0 │ │ │ └── package.wit │ │ ├── wasi-logging-0.1.0-draft │ │ │ └── package.wit │ │ ├── wasi-random-0.2.0 │ │ │ └── package.wit │ │ ├── wasi-sockets-0.2.0 │ │ │ └── package.wit │ │ ├── wasmcloud-bus-1.0.0 │ │ │ └── package.wit │ │ ├── wasmcloud-component-go-0.1.0 │ │ │ └── package.wit │ │ └── wasmcloud-secrets-0.1.0-draft │ │ │ └── package.wit │ └── world.wit │ └── wkg.lock ├── gen ├── wasi │ ├── cli │ │ ├── environment │ │ │ ├── empty.s │ │ │ ├── environment.wasm.go │ │ │ └── environment.wit.go │ │ ├── exit │ │ │ ├── empty.s │ │ │ ├── exit.wasm.go │ │ │ └── exit.wit.go │ │ ├── stderr │ │ │ ├── empty.s │ │ │ ├── stderr.wasm.go │ │ │ └── stderr.wit.go │ │ ├── stdin │ │ │ ├── empty.s │ │ │ ├── stdin.wasm.go │ │ │ └── stdin.wit.go │ │ ├── stdout │ │ │ ├── empty.s │ │ │ ├── stdout.wasm.go │ │ │ └── stdout.wit.go │ │ ├── terminal-input │ │ │ ├── empty.s │ │ │ ├── terminal-input.wit.go │ │ │ └── terminalinput.wasm.go │ │ ├── terminal-output │ │ │ ├── empty.s │ │ │ ├── terminal-output.wit.go │ │ │ └── terminaloutput.wasm.go │ │ ├── terminal-stderr │ │ │ ├── empty.s │ │ │ ├── terminal-stderr.wit.go │ │ │ └── terminalstderr.wasm.go │ │ ├── terminal-stdin │ │ │ ├── empty.s │ │ │ ├── terminal-stdin.wit.go │ │ │ └── terminalstdin.wasm.go │ │ └── terminal-stdout │ │ │ ├── empty.s │ │ │ ├── terminal-stdout.wit.go │ │ │ └── terminalstdout.wasm.go │ ├── clocks │ │ ├── monotonic-clock │ │ │ ├── empty.s │ │ │ ├── monotonic-clock.wit.go │ │ │ └── monotonicclock.wasm.go │ │ └── wall-clock │ │ │ ├── empty.s │ │ │ ├── wall-clock.wit.go │ │ │ └── wallclock.wasm.go │ ├── config │ │ └── runtime │ │ │ ├── abi.go │ │ │ ├── empty.s │ │ │ ├── runtime.wasm.go │ │ │ └── runtime.wit.go │ ├── filesystem │ │ ├── preopens │ │ │ ├── empty.s │ │ │ ├── preopens.wasm.go │ │ │ └── preopens.wit.go │ │ └── types │ │ │ ├── abi.go │ │ │ ├── empty.s │ │ │ ├── types.wasm.go │ │ │ └── types.wit.go │ ├── http │ │ ├── incoming-handler │ │ │ ├── empty.s │ │ │ ├── incoming-handler.exports.go │ │ │ ├── incoming-handler.wit.go │ │ │ └── incominghandler.wasm.go │ │ ├── outgoing-handler │ │ │ ├── abi.go │ │ │ ├── empty.s │ │ │ ├── outgoing-handler.wit.go │ │ │ └── outgoinghandler.wasm.go │ │ └── types │ │ │ ├── abi.go │ │ │ ├── empty.s │ │ │ ├── types.wasm.go │ │ │ └── types.wit.go │ ├── io │ │ ├── error │ │ │ ├── empty.s │ │ │ ├── error.wit.go │ │ │ └── ioerror.wasm.go │ │ ├── poll │ │ │ ├── empty.s │ │ │ ├── poll.wasm.go │ │ │ └── poll.wit.go │ │ └── streams │ │ │ ├── empty.s │ │ │ ├── streams.wasm.go │ │ │ └── streams.wit.go │ ├── logging │ │ └── logging │ │ │ ├── empty.s │ │ │ ├── logging.wasm.go │ │ │ └── logging.wit.go │ ├── random │ │ ├── insecure-seed │ │ │ ├── empty.s │ │ │ ├── insecure-seed.wit.go │ │ │ └── insecureseed.wasm.go │ │ ├── insecure │ │ │ ├── empty.s │ │ │ ├── insecure.wasm.go │ │ │ └── insecure.wit.go │ │ └── random │ │ │ ├── empty.s │ │ │ ├── random.wasm.go │ │ │ └── random.wit.go │ └── sockets │ │ ├── instance-network │ │ ├── empty.s │ │ ├── instance-network.wit.go │ │ └── instancenetwork.wasm.go │ │ ├── ip-name-lookup │ │ ├── abi.go │ │ ├── empty.s │ │ ├── ip-name-lookup.wit.go │ │ └── ipnamelookup.wasm.go │ │ ├── network │ │ ├── abi.go │ │ ├── empty.s │ │ ├── network.wasm.go │ │ └── network.wit.go │ │ ├── tcp-create-socket │ │ ├── empty.s │ │ ├── tcp-create-socket.wit.go │ │ └── tcpcreatesocket.wasm.go │ │ ├── tcp │ │ ├── abi.go │ │ ├── empty.s │ │ ├── tcp.wasm.go │ │ └── tcp.wit.go │ │ ├── udp-create-socket │ │ ├── empty.s │ │ ├── udp-create-socket.wit.go │ │ └── udpcreatesocket.wasm.go │ │ └── udp │ │ ├── abi.go │ │ ├── empty.s │ │ ├── udp.wasm.go │ │ └── udp.wit.go └── wasmcloud │ ├── bus │ └── lattice │ │ ├── empty.s │ │ ├── lattice.wasm.go │ │ └── lattice.wit.go │ ├── component-go │ └── sdk │ │ ├── sdk.wit │ │ └── sdk.wit.go │ └── secrets │ ├── reveal │ ├── empty.s │ ├── reveal.wasm.go │ └── reveal.wit.go │ └── store │ ├── abi.go │ ├── empty.s │ ├── store.wasm.go │ └── store.wit.go ├── go.mod ├── go.sum ├── log └── wasilog │ ├── slog.go │ └── slog_test.go ├── net └── wasihttp │ ├── adapter.go │ ├── roundtripper.go │ ├── server.go │ └── streams.go ├── sdk.go ├── tools.go ├── wasmcloud.lock ├── wasmcloud ├── config.go ├── link.go └── secret.go ├── wit ├── deps │ ├── wasi-cli-0.2.0 │ │ └── package.wit │ ├── wasi-clocks-0.2.0 │ │ └── package.wit │ ├── wasi-config-0.2.0-draft │ │ └── package.wit │ ├── wasi-filesystem-0.2.0 │ │ └── package.wit │ ├── wasi-http-0.2.0 │ │ └── package.wit │ ├── wasi-io-0.2.0 │ │ └── package.wit │ ├── wasi-logging-0.1.0-draft │ │ └── package.wit │ ├── wasi-random-0.2.0 │ │ └── package.wit │ ├── wasi-sockets-0.2.0 │ │ └── package.wit │ ├── wasmcloud-bus-1.0.0 │ │ └── package.wit │ └── wasmcloud-secrets-0.1.0-draft │ │ └── package.wit └── world.wit └── x └── wasitel ├── README.md ├── go.mod ├── go.sum ├── wasitellog ├── client.go ├── config.go ├── exporter.go └── internal │ ├── convert │ └── log.go │ └── types │ ├── common.go │ ├── context.go │ ├── logs.go │ ├── logs_service.go │ └── resource.go ├── wasitelmetric ├── client.go ├── config.go ├── exporter.go └── internal │ ├── convert │ └── metrics.go │ └── types │ ├── common.go │ ├── context.go │ ├── metrics.go │ ├── metrics_service.go │ └── resource.go └── wasiteltrace ├── client.go ├── config.go ├── exporter.go └── internal ├── convert ├── attribute.go ├── instrumentation.go ├── resource.go └── span.go └── types ├── common.go ├── context.go ├── resource.go ├── trace.go └── trace_service.go /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @wasmcloud/go-maintainers 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # TODO: Once the new version of wash is released, we can add this ignore back and remove deps 2 | # wit/deps/ 3 | -------------------------------------------------------------------------------- /MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | # MAINTAINERS 2 | 3 | The following individuals are responsible for reviewing code, managing issues, and ensuring the overall quality of `component-sdk-go`. 4 | 5 | ## @wasmCloud/go-maintainers 6 | 7 | Name: Joonas Bergius 8 | GitHub: @joonas 9 | 10 | Name: Lucas Fontes 11 | GitHub: @lxfontes 12 | 13 | Name: Bailey Hayes 14 | GitHub: @ricochet 15 | 16 | Name: Taylor Thomas 17 | GitHub: @thomastaylor312 18 | 19 | Name: Brooks Townsend 20 | GitHub: @brooksmtownsend 21 | 22 | Name: Roman Volosatovs 23 | GitHub: @rvolosatovs 24 | 25 | Name: Jordan Rash 26 | GitHub: @jordan-rash 27 | 28 | -------------------------------------------------------------------------------- /_examples/http-client/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wasmCloud/component-sdk-go/54a8f9df29a7a2ef6a4df0494874624fa860f35c/_examples/http-client/.gitignore -------------------------------------------------------------------------------- /_examples/http-client/build/.gitignore: -------------------------------------------------------------------------------- 1 | # Keep the directory but ignore all files. Dir is required to exist by the build process 2 | * 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/example/http-client/example/example.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package example represents the world "example:http-client/example". 4 | package example 5 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/environment/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/environment/environment.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package environment 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/environment@0.2.0 get-environment 12 | //go:noescape 13 | func wasmimport_GetEnvironment(result *cm.List[[2]string]) 14 | 15 | //go:wasmimport wasi:cli/environment@0.2.0 get-arguments 16 | //go:noescape 17 | func wasmimport_GetArguments(result *cm.List[string]) 18 | 19 | //go:wasmimport wasi:cli/environment@0.2.0 initial-cwd 20 | //go:noescape 21 | func wasmimport_InitialCWD(result *cm.Option[string]) 22 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/exit/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/exit/exit.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package exit 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/exit@0.2.0 exit 8 | //go:noescape 9 | func wasmimport_Exit(status0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/exit/exit.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package exit represents the imported interface "wasi:cli/exit@0.2.0". 4 | package exit 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | ) 9 | 10 | // Exit represents the imported function "exit". 11 | // 12 | // exit: func(status: result) 13 | // 14 | //go:nosplit 15 | func Exit(status cm.BoolResult) { 16 | status0 := cm.BoolToU32(status) 17 | wasmimport_Exit((uint32)(status0)) 18 | return 19 | } 20 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/stderr/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/stderr/stderr.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package stderr 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/stderr@0.2.0 get-stderr 8 | //go:noescape 9 | func wasmimport_GetStderr() (result0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/stderr/stderr.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package stderr represents the imported interface "wasi:cli/stderr@0.2.0". 4 | package stderr 5 | 6 | import ( 7 | "github.com/wasmCloud/component-sdk-go/_examples/http-client/gen/wasi/io/streams" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // OutputStream represents the imported type alias "wasi:cli/stderr@0.2.0#output-stream". 12 | // 13 | // See [streams.OutputStream] for more information. 14 | type OutputStream = streams.OutputStream 15 | 16 | // GetStderr represents the imported function "get-stderr". 17 | // 18 | // get-stderr: func() -> output-stream 19 | // 20 | //go:nosplit 21 | func GetStderr() (result OutputStream) { 22 | result0 := wasmimport_GetStderr() 23 | result = cm.Reinterpret[OutputStream]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/stdin/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/stdin/stdin.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package stdin 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/stdin@0.2.0 get-stdin 8 | //go:noescape 9 | func wasmimport_GetStdin() (result0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/stdin/stdin.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package stdin represents the imported interface "wasi:cli/stdin@0.2.0". 4 | package stdin 5 | 6 | import ( 7 | "github.com/wasmCloud/component-sdk-go/_examples/http-client/gen/wasi/io/streams" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // InputStream represents the imported type alias "wasi:cli/stdin@0.2.0#input-stream". 12 | // 13 | // See [streams.InputStream] for more information. 14 | type InputStream = streams.InputStream 15 | 16 | // GetStdin represents the imported function "get-stdin". 17 | // 18 | // get-stdin: func() -> input-stream 19 | // 20 | //go:nosplit 21 | func GetStdin() (result InputStream) { 22 | result0 := wasmimport_GetStdin() 23 | result = cm.Reinterpret[InputStream]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/stdout/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/stdout/stdout.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package stdout 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/stdout@0.2.0 get-stdout 8 | //go:noescape 9 | func wasmimport_GetStdout() (result0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/stdout/stdout.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package stdout represents the imported interface "wasi:cli/stdout@0.2.0". 4 | package stdout 5 | 6 | import ( 7 | "github.com/wasmCloud/component-sdk-go/_examples/http-client/gen/wasi/io/streams" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // OutputStream represents the imported type alias "wasi:cli/stdout@0.2.0#output-stream". 12 | // 13 | // See [streams.OutputStream] for more information. 14 | type OutputStream = streams.OutputStream 15 | 16 | // GetStdout represents the imported function "get-stdout". 17 | // 18 | // get-stdout: func() -> output-stream 19 | // 20 | //go:nosplit 21 | func GetStdout() (result OutputStream) { 22 | result0 := wasmimport_GetStdout() 23 | result = cm.Reinterpret[OutputStream]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/terminal-input/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/terminal-input/terminal-input.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package terminalinput represents the imported interface "wasi:cli/terminal-input@0.2.0". 4 | package terminalinput 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | ) 9 | 10 | // TerminalInput represents the imported resource "wasi:cli/terminal-input@0.2.0#terminal-input". 11 | // 12 | // resource terminal-input 13 | type TerminalInput cm.Resource 14 | 15 | // ResourceDrop represents the imported resource-drop for resource "terminal-input". 16 | // 17 | // Drops a resource handle. 18 | // 19 | //go:nosplit 20 | func (self TerminalInput) ResourceDrop() { 21 | self0 := cm.Reinterpret[uint32](self) 22 | wasmimport_TerminalInputResourceDrop((uint32)(self0)) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/terminal-input/terminalinput.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalinput 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/terminal-input@0.2.0 [resource-drop]terminal-input 8 | //go:noescape 9 | func wasmimport_TerminalInputResourceDrop(self0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/terminal-output/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/terminal-output/terminal-output.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package terminaloutput represents the imported interface "wasi:cli/terminal-output@0.2.0". 4 | package terminaloutput 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | ) 9 | 10 | // TerminalOutput represents the imported resource "wasi:cli/terminal-output@0.2.0#terminal-output". 11 | // 12 | // resource terminal-output 13 | type TerminalOutput cm.Resource 14 | 15 | // ResourceDrop represents the imported resource-drop for resource "terminal-output". 16 | // 17 | // Drops a resource handle. 18 | // 19 | //go:nosplit 20 | func (self TerminalOutput) ResourceDrop() { 21 | self0 := cm.Reinterpret[uint32](self) 22 | wasmimport_TerminalOutputResourceDrop((uint32)(self0)) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/terminal-output/terminaloutput.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminaloutput 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/terminal-output@0.2.0 [resource-drop]terminal-output 8 | //go:noescape 9 | func wasmimport_TerminalOutputResourceDrop(self0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/terminal-stderr/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package terminalstderr represents the imported interface "wasi:cli/terminal-stderr@0.2.0". 4 | package terminalstderr 5 | 6 | import ( 7 | terminaloutput "github.com/wasmCloud/component-sdk-go/_examples/http-client/gen/wasi/cli/terminal-output" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // TerminalOutput represents the imported type alias "wasi:cli/terminal-stderr@0.2.0#terminal-output". 12 | // 13 | // See [terminaloutput.TerminalOutput] for more information. 14 | type TerminalOutput = terminaloutput.TerminalOutput 15 | 16 | // GetTerminalStderr represents the imported function "get-terminal-stderr". 17 | // 18 | // get-terminal-stderr: func() -> option 19 | // 20 | //go:nosplit 21 | func GetTerminalStderr() (result cm.Option[TerminalOutput]) { 22 | wasmimport_GetTerminalStderr(&result) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalstderr 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/terminal-stderr@0.2.0 get-terminal-stderr 12 | //go:noescape 13 | func wasmimport_GetTerminalStderr(result *cm.Option[TerminalOutput]) 14 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/terminal-stdin/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package terminalstdin represents the imported interface "wasi:cli/terminal-stdin@0.2.0". 4 | package terminalstdin 5 | 6 | import ( 7 | terminalinput "github.com/wasmCloud/component-sdk-go/_examples/http-client/gen/wasi/cli/terminal-input" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // TerminalInput represents the imported type alias "wasi:cli/terminal-stdin@0.2.0#terminal-input". 12 | // 13 | // See [terminalinput.TerminalInput] for more information. 14 | type TerminalInput = terminalinput.TerminalInput 15 | 16 | // GetTerminalStdin represents the imported function "get-terminal-stdin". 17 | // 18 | // get-terminal-stdin: func() -> option 19 | // 20 | //go:nosplit 21 | func GetTerminalStdin() (result cm.Option[TerminalInput]) { 22 | wasmimport_GetTerminalStdin(&result) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalstdin 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/terminal-stdin@0.2.0 get-terminal-stdin 12 | //go:noescape 13 | func wasmimport_GetTerminalStdin(result *cm.Option[TerminalInput]) 14 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/terminal-stdout/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalstdout 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/terminal-stdout@0.2.0 get-terminal-stdout 12 | //go:noescape 13 | func wasmimport_GetTerminalStdout(result *cm.Option[TerminalOutput]) 14 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/clocks/monotonic-clock/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package monotonicclock 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". 6 | 7 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 now 8 | //go:noescape 9 | func wasmimport_Now() (result0 uint64) 10 | 11 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 resolution 12 | //go:noescape 13 | func wasmimport_Resolution() (result0 uint64) 14 | 15 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-instant 16 | //go:noescape 17 | func wasmimport_SubscribeInstant(when0 uint64) (result0 uint32) 18 | 19 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-duration 20 | //go:noescape 21 | func wasmimport_SubscribeDuration(when0 uint64) (result0 uint32) 22 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/clocks/wall-clock/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/clocks/wall-clock/wallclock.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package wallclock 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". 6 | 7 | //go:wasmimport wasi:clocks/wall-clock@0.2.0 now 8 | //go:noescape 9 | func wasmimport_Now(result *DateTime) 10 | 11 | //go:wasmimport wasi:clocks/wall-clock@0.2.0 resolution 12 | //go:noescape 13 | func wasmimport_Resolution(result *DateTime) 14 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/config/runtime/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package runtime 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // OptionStringShape is used for storage in variant or result types. 11 | type OptionStringShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(cm.Option[string]{})]byte 14 | } 15 | 16 | // ConfigErrorShape is used for storage in variant or result types. 17 | type ConfigErrorShape struct { 18 | _ cm.HostLayout 19 | shape [unsafe.Sizeof(ConfigError{})]byte 20 | } 21 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/config/runtime/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/config/runtime/runtime.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package runtime 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:config@0.2.0-draft". 10 | 11 | //go:wasmimport wasi:config/runtime@0.2.0-draft get 12 | //go:noescape 13 | func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[OptionStringShape, cm.Option[string], ConfigError]) 14 | 15 | //go:wasmimport wasi:config/runtime@0.2.0-draft get-all 16 | //go:noescape 17 | func wasmimport_GetAll(result *cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) 18 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/filesystem/preopens/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/filesystem/preopens/preopens.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package preopens 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". 10 | 11 | //go:wasmimport wasi:filesystem/preopens@0.2.0 get-directories 12 | //go:noescape 13 | func wasmimport_GetDirectories(result *cm.List[cm.Tuple[Descriptor, string]]) 14 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/filesystem/preopens/preopens.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package preopens represents the imported interface "wasi:filesystem/preopens@0.2.0". 4 | package preopens 5 | 6 | import ( 7 | "github.com/wasmCloud/component-sdk-go/_examples/http-client/gen/wasi/filesystem/types" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // Descriptor represents the imported type alias "wasi:filesystem/preopens@0.2.0#descriptor". 12 | // 13 | // See [types.Descriptor] for more information. 14 | type Descriptor = types.Descriptor 15 | 16 | // GetDirectories represents the imported function "get-directories". 17 | // 18 | // get-directories: func() -> list> 19 | // 20 | //go:nosplit 21 | func GetDirectories() (result cm.List[cm.Tuple[Descriptor, string]]) { 22 | wasmimport_GetDirectories(&result) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/filesystem/types/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/http/incoming-handler/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/http/incoming-handler/incominghandler.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package incominghandler 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". 10 | 11 | //go:wasmexport wasi:http/incoming-handler@0.2.0#handle 12 | //export wasi:http/incoming-handler@0.2.0#handle 13 | func wasmexport_Handle(request0 uint32, responseOut0 uint32) { 14 | request := cm.Reinterpret[IncomingRequest]((uint32)(request0)) 15 | responseOut := cm.Reinterpret[ResponseOutparam]((uint32)(responseOut0)) 16 | Exports.Handle(request, responseOut) 17 | return 18 | } 19 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/http/outgoing-handler/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package outgoinghandler 4 | 5 | import ( 6 | "github.com/wasmCloud/component-sdk-go/_examples/http-client/gen/wasi/http/types" 7 | "go.bytecodealliance.org/cm" 8 | "unsafe" 9 | ) 10 | 11 | // ErrorCodeShape is used for storage in variant or result types. 12 | type ErrorCodeShape struct { 13 | _ cm.HostLayout 14 | shape [unsafe.Sizeof(types.ErrorCode{})]byte 15 | } 16 | 17 | func lower_OptionRequestOptions(v cm.Option[RequestOptions]) (f0 uint32, f1 uint32) { 18 | some := v.Some() 19 | if some != nil { 20 | f0 = 1 21 | v1 := cm.Reinterpret[uint32](*some) 22 | f1 = (uint32)(v1) 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/http/outgoing-handler/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package outgoinghandler 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". 10 | 11 | //go:wasmimport wasi:http/outgoing-handler@0.2.0 handle 12 | //go:noescape 13 | func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32, result *cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) 14 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/http/types/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/io/error/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/io/error/ioerror.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package ioerror 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". 6 | 7 | //go:wasmimport wasi:io/error@0.2.0 [resource-drop]error 8 | //go:noescape 9 | func wasmimport_ErrorResourceDrop(self0 uint32) 10 | 11 | //go:wasmimport wasi:io/error@0.2.0 [method]error.to-debug-string 12 | //go:noescape 13 | func wasmimport_ErrorToDebugString(self0 uint32, result *string) 14 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/io/poll/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/io/poll/poll.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package poll 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". 10 | 11 | //go:wasmimport wasi:io/poll@0.2.0 [resource-drop]pollable 12 | //go:noescape 13 | func wasmimport_PollableResourceDrop(self0 uint32) 14 | 15 | //go:wasmimport wasi:io/poll@0.2.0 [method]pollable.block 16 | //go:noescape 17 | func wasmimport_PollableBlock(self0 uint32) 18 | 19 | //go:wasmimport wasi:io/poll@0.2.0 [method]pollable.ready 20 | //go:noescape 21 | func wasmimport_PollableReady(self0 uint32) (result0 uint32) 22 | 23 | //go:wasmimport wasi:io/poll@0.2.0 poll 24 | //go:noescape 25 | func wasmimport_Poll(in0 *Pollable, in1 uint32, result *cm.List[uint32]) 26 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/io/streams/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/logging/logging/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/logging/logging/logging.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package logging 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:logging@0.1.0-draft". 6 | 7 | //go:wasmimport wasi:logging/logging@0.1.0-draft log 8 | //go:noescape 9 | func wasmimport_Log(level0 uint32, context0 *uint8, context1 uint32, message0 *uint8, message1 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/random/insecure-seed/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/random/insecure-seed/insecure-seed.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package insecureseed represents the imported interface "wasi:random/insecure-seed@0.2.0". 4 | package insecureseed 5 | 6 | // InsecureSeed represents the imported function "insecure-seed". 7 | // 8 | // insecure-seed: func() -> tuple 9 | // 10 | //go:nosplit 11 | func InsecureSeed() (result [2]uint64) { 12 | wasmimport_InsecureSeed(&result) 13 | return 14 | } 15 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/random/insecure-seed/insecureseed.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package insecureseed 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". 6 | 7 | //go:wasmimport wasi:random/insecure-seed@0.2.0 insecure-seed 8 | //go:noescape 9 | func wasmimport_InsecureSeed(result *[2]uint64) 10 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/random/insecure/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/random/insecure/insecure.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package insecure 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". 10 | 11 | //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-bytes 12 | //go:noescape 13 | func wasmimport_GetInsecureRandomBytes(len0 uint64, result *cm.List[uint8]) 14 | 15 | //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-u64 16 | //go:noescape 17 | func wasmimport_GetInsecureRandomU64() (result0 uint64) 18 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/random/random/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/random/random/random.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package random 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". 10 | 11 | //go:wasmimport wasi:random/random@0.2.0 get-random-bytes 12 | //go:noescape 13 | func wasmimport_GetRandomBytes(len0 uint64, result *cm.List[uint8]) 14 | 15 | //go:wasmimport wasi:random/random@0.2.0 get-random-u64 16 | //go:noescape 17 | func wasmimport_GetRandomU64() (result0 uint64) 18 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/random/random/random.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package random represents the imported interface "wasi:random/random@0.2.0". 4 | package random 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | ) 9 | 10 | // GetRandomBytes represents the imported function "get-random-bytes". 11 | // 12 | // get-random-bytes: func(len: u64) -> list 13 | // 14 | //go:nosplit 15 | func GetRandomBytes(len_ uint64) (result cm.List[uint8]) { 16 | len0 := (uint64)(len_) 17 | wasmimport_GetRandomBytes((uint64)(len0), &result) 18 | return 19 | } 20 | 21 | // GetRandomU64 represents the imported function "get-random-u64". 22 | // 23 | // get-random-u64: func() -> u64 24 | // 25 | //go:nosplit 26 | func GetRandomU64() (result uint64) { 27 | result0 := wasmimport_GetRandomU64() 28 | result = (uint64)((uint64)(result0)) 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/sockets/instance-network/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/sockets/instance-network/instance-network.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package instancenetwork represents the imported interface "wasi:sockets/instance-network@0.2.0". 4 | package instancenetwork 5 | 6 | import ( 7 | "github.com/wasmCloud/component-sdk-go/_examples/http-client/gen/wasi/sockets/network" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // Network represents the imported type alias "wasi:sockets/instance-network@0.2.0#network". 12 | // 13 | // See [network.Network] for more information. 14 | type Network = network.Network 15 | 16 | // InstanceNetwork represents the imported function "instance-network". 17 | // 18 | // instance-network: func() -> network 19 | // 20 | //go:nosplit 21 | func InstanceNetwork() (result Network) { 22 | result0 := wasmimport_InstanceNetwork() 23 | result = cm.Reinterpret[Network]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/sockets/instance-network/instancenetwork.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package instancenetwork 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 6 | 7 | //go:wasmimport wasi:sockets/instance-network@0.2.0 instance-network 8 | //go:noescape 9 | func wasmimport_InstanceNetwork() (result0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/sockets/ip-name-lookup/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package ipnamelookup 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // OptionIPAddressShape is used for storage in variant or result types. 11 | type OptionIPAddressShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(cm.Option[IPAddress]{})]byte 14 | } 15 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/sockets/ip-name-lookup/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/sockets/network/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package network 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // IPv6SocketAddressShape is used for storage in variant or result types. 11 | type IPv6SocketAddressShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(IPv6SocketAddress{})]byte 14 | } 15 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/sockets/network/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/sockets/network/network.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package network 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 6 | 7 | //go:wasmimport wasi:sockets/network@0.2.0 [resource-drop]network 8 | //go:noescape 9 | func wasmimport_NetworkResourceDrop(self0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/sockets/tcp-create-socket/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package tcpcreatesocket 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 10 | 11 | //go:wasmimport wasi:sockets/tcp-create-socket@0.2.0 create-tcp-socket 12 | //go:noescape 13 | func wasmimport_CreateTCPSocket(addressFamily0 uint32, result *cm.Result[TCPSocket, TCPSocket, ErrorCode]) 14 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/sockets/tcp/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/sockets/udp-create-socket/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package udpcreatesocket 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 10 | 11 | //go:wasmimport wasi:sockets/udp-create-socket@0.2.0 create-udp-socket 12 | //go:noescape 13 | func wasmimport_CreateUDPSocket(addressFamily0 uint32, result *cm.Result[UDPSocket, UDPSocket, ErrorCode]) 14 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasi/sockets/udp/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasmcloud/bus/lattice/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasmcloud/bus/lattice/lattice.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package lattice 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasmcloud:bus@1.0.0". 6 | 7 | //go:wasmimport wasmcloud:bus/lattice@1.0.0 [resource-drop]call-target-interface 8 | //go:noescape 9 | func wasmimport_CallTargetInterfaceResourceDrop(self0 uint32) 10 | 11 | //go:wasmimport wasmcloud:bus/lattice@1.0.0 [constructor]call-target-interface 12 | //go:noescape 13 | func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) (result0 uint32) 14 | 15 | //go:wasmimport wasmcloud:bus/lattice@1.0.0 set-link-name 16 | //go:noescape 17 | func wasmimport_SetLinkName(name0 *uint8, name1 uint32, interfaces0 *CallTargetInterface, interfaces1 uint32) 18 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasmcloud/secrets/reveal/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasmcloud/secrets/reveal/reveal.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package reveal 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". 6 | 7 | //go:wasmimport wasmcloud:secrets/reveal@0.1.0-draft reveal 8 | //go:noescape 9 | func wasmimport_Reveal(s0 uint32, result *SecretValue) 10 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasmcloud/secrets/store/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package store 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // SecretsErrorShape is used for storage in variant or result types. 11 | type SecretsErrorShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(SecretsError{})]byte 14 | } 15 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasmcloud/secrets/store/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-client/gen/wasmcloud/secrets/store/store.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package store 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". 10 | 11 | //go:wasmimport wasmcloud:secrets/store@0.1.0-draft [resource-drop]secret 12 | //go:noescape 13 | func wasmimport_SecretResourceDrop(self0 uint32) 14 | 15 | //go:wasmimport wasmcloud:secrets/store@0.1.0-draft get 16 | //go:noescape 17 | func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[SecretsErrorShape, Secret, SecretsError]) 18 | -------------------------------------------------------------------------------- /_examples/http-client/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/wasmCloud/component-sdk-go/_examples/http-client 2 | 3 | go 1.23.0 4 | 5 | require ( 6 | go.bytecodealliance.org v0.4.1 7 | go.wasmcloud.dev/component v0.0.5 8 | ) 9 | 10 | require ( 11 | github.com/coreos/go-semver v0.3.1 // indirect 12 | github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect 13 | github.com/klauspost/compress v1.17.11 // indirect 14 | github.com/opencontainers/go-digest v1.0.0 // indirect 15 | github.com/regclient/regclient v0.7.2 // indirect 16 | github.com/sirupsen/logrus v1.9.3 // indirect 17 | github.com/ulikunitz/xz v0.5.12 // indirect 18 | github.com/urfave/cli/v3 v3.0.0-beta1 // indirect 19 | golang.org/x/mod v0.22.0 // indirect 20 | golang.org/x/sys v0.28.0 // indirect 21 | ) 22 | 23 | // NOTE(lxf): Remove this line if running outside of component-sdk-go repository 24 | replace go.wasmcloud.dev/component => ../.. 25 | -------------------------------------------------------------------------------- /_examples/http-client/tools.go: -------------------------------------------------------------------------------- 1 | //go:build tools 2 | 3 | package main 4 | 5 | import ( 6 | _ "go.bytecodealliance.org/cmd/wit-bindgen-go" 7 | ) 8 | -------------------------------------------------------------------------------- /_examples/http-client/wasmcloud.toml: -------------------------------------------------------------------------------- 1 | name = "http_client" 2 | language = "tinygo" 3 | type = "component" 4 | version = "0.1.0" 5 | 6 | [component] 7 | wit_world = "example" 8 | wasm_target = "wasm32-wasi-preview2" 9 | destination = "build/http_client_s.wasm" 10 | -------------------------------------------------------------------------------- /_examples/http-client/wit/deps/wasi-clocks-0.2.0/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:clocks@0.2.0; 2 | 3 | interface monotonic-clock { 4 | use wasi:io/poll@0.2.0.{pollable}; 5 | 6 | type instant = u64; 7 | 8 | type duration = u64; 9 | 10 | now: func() -> instant; 11 | 12 | resolution: func() -> duration; 13 | 14 | subscribe-instant: func(when: instant) -> pollable; 15 | 16 | subscribe-duration: func(when: duration) -> pollable; 17 | } 18 | 19 | interface wall-clock { 20 | record datetime { 21 | seconds: u64, 22 | nanoseconds: u32, 23 | } 24 | 25 | now: func() -> datetime; 26 | 27 | resolution: func() -> datetime; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /_examples/http-client/wit/deps/wasi-config-0.2.0-draft/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:config@0.2.0-draft; 2 | 3 | interface runtime { 4 | variant config-error { 5 | upstream(string), 6 | io(string), 7 | } 8 | 9 | get: func(key: string) -> result, config-error>; 10 | 11 | get-all: func() -> result>, config-error>; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /_examples/http-client/wit/deps/wasi-logging-0.1.0-draft/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:logging@0.1.0-draft; 2 | 3 | interface logging { 4 | enum level { 5 | trace, 6 | debug, 7 | info, 8 | warn, 9 | error, 10 | critical, 11 | } 12 | 13 | log: func(level: level, context: string, message: string); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /_examples/http-client/wit/deps/wasi-random-0.2.0/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:random@0.2.0; 2 | 3 | interface random { 4 | get-random-bytes: func(len: u64) -> list; 5 | 6 | get-random-u64: func() -> u64; 7 | } 8 | 9 | interface insecure { 10 | get-insecure-random-bytes: func(len: u64) -> list; 11 | 12 | get-insecure-random-u64: func() -> u64; 13 | } 14 | 15 | interface insecure-seed { 16 | insecure-seed: func() -> tuple; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /_examples/http-client/wit/deps/wasmcloud-bus-1.0.0/package.wit: -------------------------------------------------------------------------------- 1 | package wasmcloud:bus@1.0.0; 2 | 3 | interface lattice { 4 | resource call-target-interface { 5 | constructor(namespace: string, %package: string, %interface: string); 6 | } 7 | 8 | set-link-name: func(name: string, interfaces: list); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /_examples/http-client/wit/deps/wasmcloud-secrets-0.1.0-draft/package.wit: -------------------------------------------------------------------------------- 1 | package wasmcloud:secrets@0.1.0-draft; 2 | 3 | interface store { 4 | variant secrets-error { 5 | upstream(string), 6 | io(string), 7 | not-found, 8 | } 9 | 10 | variant secret-value { 11 | %string(string), 12 | bytes(list), 13 | } 14 | 15 | resource secret; 16 | 17 | get: func(key: string) -> result; 18 | } 19 | 20 | interface reveal { 21 | use store.{secret, secret-value}; 22 | 23 | reveal: func(s: borrow) -> secret-value; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /_examples/http-client/wit/world.wit: -------------------------------------------------------------------------------- 1 | package example:http-client; 2 | 3 | world example { 4 | include wasmcloud:component-go/imports@0.1.0; 5 | 6 | import wasi:http/outgoing-handler@0.2.0; 7 | export wasi:http/incoming-handler@0.2.0; 8 | } 9 | -------------------------------------------------------------------------------- /_examples/http-client/wkg.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically generated. 2 | # It is not intended for manual editing. 3 | version = 1 4 | 5 | [[packages]] 6 | name = "wasi:http" 7 | registry = "wasi.dev" 8 | 9 | [[packages.versions]] 10 | requirement = "=0.2.0" 11 | version = "0.2.0" 12 | digest = "sha256:5a568e6e2d60c1ce51220e1833cdd5b88db9f615720edc762a9b4a6f36b383bd" 13 | 14 | [[packages]] 15 | name = "wasmcloud:component-go" 16 | registry = "wasmcloud.com" 17 | 18 | [[packages.versions]] 19 | requirement = "=0.1.0" 20 | version = "0.1.0" 21 | digest = "sha256:de3e9af7dedd0d9e882f68f1bee533c7af9c6a1947eb40cbf1ef6163b7d41784" 22 | -------------------------------------------------------------------------------- /_examples/http-server/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wasmCloud/component-sdk-go/54a8f9df29a7a2ef6a4df0494874624fa860f35c/_examples/http-server/.gitignore -------------------------------------------------------------------------------- /_examples/http-server/build/.gitignore: -------------------------------------------------------------------------------- 1 | # Keep the directory but ignore all files. Dir is required to exist by the build process 2 | * 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/example/http-server/example/example.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package example represents the world "example:http-server/example". 4 | package example 5 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/environment/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/environment/environment.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package environment 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/environment@0.2.0 get-environment 12 | //go:noescape 13 | func wasmimport_GetEnvironment(result *cm.List[[2]string]) 14 | 15 | //go:wasmimport wasi:cli/environment@0.2.0 get-arguments 16 | //go:noescape 17 | func wasmimport_GetArguments(result *cm.List[string]) 18 | 19 | //go:wasmimport wasi:cli/environment@0.2.0 initial-cwd 20 | //go:noescape 21 | func wasmimport_InitialCWD(result *cm.Option[string]) 22 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/exit/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/exit/exit.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package exit 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/exit@0.2.0 exit 8 | //go:noescape 9 | func wasmimport_Exit(status0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/exit/exit.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package exit represents the imported interface "wasi:cli/exit@0.2.0". 4 | package exit 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | ) 9 | 10 | // Exit represents the imported function "exit". 11 | // 12 | // exit: func(status: result) 13 | // 14 | //go:nosplit 15 | func Exit(status cm.BoolResult) { 16 | status0 := cm.BoolToU32(status) 17 | wasmimport_Exit((uint32)(status0)) 18 | return 19 | } 20 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/stderr/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/stderr/stderr.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package stderr 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/stderr@0.2.0 get-stderr 8 | //go:noescape 9 | func wasmimport_GetStderr() (result0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/stderr/stderr.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package stderr represents the imported interface "wasi:cli/stderr@0.2.0". 4 | package stderr 5 | 6 | import ( 7 | "github.com/wasmCloud/component-sdk-go/_examples/http-server/gen/wasi/io/streams" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // OutputStream represents the imported type alias "wasi:cli/stderr@0.2.0#output-stream". 12 | // 13 | // See [streams.OutputStream] for more information. 14 | type OutputStream = streams.OutputStream 15 | 16 | // GetStderr represents the imported function "get-stderr". 17 | // 18 | // get-stderr: func() -> output-stream 19 | // 20 | //go:nosplit 21 | func GetStderr() (result OutputStream) { 22 | result0 := wasmimport_GetStderr() 23 | result = cm.Reinterpret[OutputStream]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/stdin/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/stdin/stdin.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package stdin 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/stdin@0.2.0 get-stdin 8 | //go:noescape 9 | func wasmimport_GetStdin() (result0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/stdin/stdin.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package stdin represents the imported interface "wasi:cli/stdin@0.2.0". 4 | package stdin 5 | 6 | import ( 7 | "github.com/wasmCloud/component-sdk-go/_examples/http-server/gen/wasi/io/streams" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // InputStream represents the imported type alias "wasi:cli/stdin@0.2.0#input-stream". 12 | // 13 | // See [streams.InputStream] for more information. 14 | type InputStream = streams.InputStream 15 | 16 | // GetStdin represents the imported function "get-stdin". 17 | // 18 | // get-stdin: func() -> input-stream 19 | // 20 | //go:nosplit 21 | func GetStdin() (result InputStream) { 22 | result0 := wasmimport_GetStdin() 23 | result = cm.Reinterpret[InputStream]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/stdout/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/stdout/stdout.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package stdout 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/stdout@0.2.0 get-stdout 8 | //go:noescape 9 | func wasmimport_GetStdout() (result0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/stdout/stdout.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package stdout represents the imported interface "wasi:cli/stdout@0.2.0". 4 | package stdout 5 | 6 | import ( 7 | "github.com/wasmCloud/component-sdk-go/_examples/http-server/gen/wasi/io/streams" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // OutputStream represents the imported type alias "wasi:cli/stdout@0.2.0#output-stream". 12 | // 13 | // See [streams.OutputStream] for more information. 14 | type OutputStream = streams.OutputStream 15 | 16 | // GetStdout represents the imported function "get-stdout". 17 | // 18 | // get-stdout: func() -> output-stream 19 | // 20 | //go:nosplit 21 | func GetStdout() (result OutputStream) { 22 | result0 := wasmimport_GetStdout() 23 | result = cm.Reinterpret[OutputStream]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/terminal-input/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/terminal-input/terminal-input.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package terminalinput represents the imported interface "wasi:cli/terminal-input@0.2.0". 4 | package terminalinput 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | ) 9 | 10 | // TerminalInput represents the imported resource "wasi:cli/terminal-input@0.2.0#terminal-input". 11 | // 12 | // resource terminal-input 13 | type TerminalInput cm.Resource 14 | 15 | // ResourceDrop represents the imported resource-drop for resource "terminal-input". 16 | // 17 | // Drops a resource handle. 18 | // 19 | //go:nosplit 20 | func (self TerminalInput) ResourceDrop() { 21 | self0 := cm.Reinterpret[uint32](self) 22 | wasmimport_TerminalInputResourceDrop((uint32)(self0)) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/terminal-input/terminalinput.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalinput 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/terminal-input@0.2.0 [resource-drop]terminal-input 8 | //go:noescape 9 | func wasmimport_TerminalInputResourceDrop(self0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/terminal-output/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/terminal-output/terminal-output.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package terminaloutput represents the imported interface "wasi:cli/terminal-output@0.2.0". 4 | package terminaloutput 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | ) 9 | 10 | // TerminalOutput represents the imported resource "wasi:cli/terminal-output@0.2.0#terminal-output". 11 | // 12 | // resource terminal-output 13 | type TerminalOutput cm.Resource 14 | 15 | // ResourceDrop represents the imported resource-drop for resource "terminal-output". 16 | // 17 | // Drops a resource handle. 18 | // 19 | //go:nosplit 20 | func (self TerminalOutput) ResourceDrop() { 21 | self0 := cm.Reinterpret[uint32](self) 22 | wasmimport_TerminalOutputResourceDrop((uint32)(self0)) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/terminal-output/terminaloutput.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminaloutput 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/terminal-output@0.2.0 [resource-drop]terminal-output 8 | //go:noescape 9 | func wasmimport_TerminalOutputResourceDrop(self0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/terminal-stderr/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalstderr 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/terminal-stderr@0.2.0 get-terminal-stderr 12 | //go:noescape 13 | func wasmimport_GetTerminalStderr(result *cm.Option[TerminalOutput]) 14 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/terminal-stdin/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package terminalstdin represents the imported interface "wasi:cli/terminal-stdin@0.2.0". 4 | package terminalstdin 5 | 6 | import ( 7 | terminalinput "github.com/wasmCloud/component-sdk-go/_examples/http-server/gen/wasi/cli/terminal-input" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // TerminalInput represents the imported type alias "wasi:cli/terminal-stdin@0.2.0#terminal-input". 12 | // 13 | // See [terminalinput.TerminalInput] for more information. 14 | type TerminalInput = terminalinput.TerminalInput 15 | 16 | // GetTerminalStdin represents the imported function "get-terminal-stdin". 17 | // 18 | // get-terminal-stdin: func() -> option 19 | // 20 | //go:nosplit 21 | func GetTerminalStdin() (result cm.Option[TerminalInput]) { 22 | wasmimport_GetTerminalStdin(&result) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalstdin 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/terminal-stdin@0.2.0 get-terminal-stdin 12 | //go:noescape 13 | func wasmimport_GetTerminalStdin(result *cm.Option[TerminalInput]) 14 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/terminal-stdout/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalstdout 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/terminal-stdout@0.2.0 get-terminal-stdout 12 | //go:noescape 13 | func wasmimport_GetTerminalStdout(result *cm.Option[TerminalOutput]) 14 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/clocks/monotonic-clock/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package monotonicclock 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". 6 | 7 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 now 8 | //go:noescape 9 | func wasmimport_Now() (result0 uint64) 10 | 11 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 resolution 12 | //go:noescape 13 | func wasmimport_Resolution() (result0 uint64) 14 | 15 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-instant 16 | //go:noescape 17 | func wasmimport_SubscribeInstant(when0 uint64) (result0 uint32) 18 | 19 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-duration 20 | //go:noescape 21 | func wasmimport_SubscribeDuration(when0 uint64) (result0 uint32) 22 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/clocks/wall-clock/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/clocks/wall-clock/wallclock.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package wallclock 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". 6 | 7 | //go:wasmimport wasi:clocks/wall-clock@0.2.0 now 8 | //go:noescape 9 | func wasmimport_Now(result *DateTime) 10 | 11 | //go:wasmimport wasi:clocks/wall-clock@0.2.0 resolution 12 | //go:noescape 13 | func wasmimport_Resolution(result *DateTime) 14 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/config/runtime/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package runtime 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // OptionStringShape is used for storage in variant or result types. 11 | type OptionStringShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(cm.Option[string]{})]byte 14 | } 15 | 16 | // ConfigErrorShape is used for storage in variant or result types. 17 | type ConfigErrorShape struct { 18 | _ cm.HostLayout 19 | shape [unsafe.Sizeof(ConfigError{})]byte 20 | } 21 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/config/runtime/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/config/runtime/runtime.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package runtime 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:config@0.2.0-draft". 10 | 11 | //go:wasmimport wasi:config/runtime@0.2.0-draft get 12 | //go:noescape 13 | func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[OptionStringShape, cm.Option[string], ConfigError]) 14 | 15 | //go:wasmimport wasi:config/runtime@0.2.0-draft get-all 16 | //go:noescape 17 | func wasmimport_GetAll(result *cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) 18 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/filesystem/preopens/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/filesystem/preopens/preopens.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package preopens 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". 10 | 11 | //go:wasmimport wasi:filesystem/preopens@0.2.0 get-directories 12 | //go:noescape 13 | func wasmimport_GetDirectories(result *cm.List[cm.Tuple[Descriptor, string]]) 14 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/filesystem/preopens/preopens.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package preopens represents the imported interface "wasi:filesystem/preopens@0.2.0". 4 | package preopens 5 | 6 | import ( 7 | "github.com/wasmCloud/component-sdk-go/_examples/http-server/gen/wasi/filesystem/types" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // Descriptor represents the imported type alias "wasi:filesystem/preopens@0.2.0#descriptor". 12 | // 13 | // See [types.Descriptor] for more information. 14 | type Descriptor = types.Descriptor 15 | 16 | // GetDirectories represents the imported function "get-directories". 17 | // 18 | // get-directories: func() -> list> 19 | // 20 | //go:nosplit 21 | func GetDirectories() (result cm.List[cm.Tuple[Descriptor, string]]) { 22 | wasmimport_GetDirectories(&result) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/filesystem/types/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/http/incoming-handler/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/http/incoming-handler/incominghandler.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package incominghandler 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". 10 | 11 | //go:wasmexport wasi:http/incoming-handler@0.2.0#handle 12 | //export wasi:http/incoming-handler@0.2.0#handle 13 | func wasmexport_Handle(request0 uint32, responseOut0 uint32) { 14 | request := cm.Reinterpret[IncomingRequest]((uint32)(request0)) 15 | responseOut := cm.Reinterpret[ResponseOutparam]((uint32)(responseOut0)) 16 | Exports.Handle(request, responseOut) 17 | return 18 | } 19 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/http/outgoing-handler/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package outgoinghandler 4 | 5 | import ( 6 | "github.com/wasmCloud/component-sdk-go/_examples/http-server/gen/wasi/http/types" 7 | "go.bytecodealliance.org/cm" 8 | "unsafe" 9 | ) 10 | 11 | // ErrorCodeShape is used for storage in variant or result types. 12 | type ErrorCodeShape struct { 13 | _ cm.HostLayout 14 | shape [unsafe.Sizeof(types.ErrorCode{})]byte 15 | } 16 | 17 | func lower_OptionRequestOptions(v cm.Option[RequestOptions]) (f0 uint32, f1 uint32) { 18 | some := v.Some() 19 | if some != nil { 20 | f0 = 1 21 | v1 := cm.Reinterpret[uint32](*some) 22 | f1 = (uint32)(v1) 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/http/outgoing-handler/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package outgoinghandler 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". 10 | 11 | //go:wasmimport wasi:http/outgoing-handler@0.2.0 handle 12 | //go:noescape 13 | func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32, result *cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) 14 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/http/types/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/io/error/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/io/error/ioerror.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package ioerror 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". 6 | 7 | //go:wasmimport wasi:io/error@0.2.0 [resource-drop]error 8 | //go:noescape 9 | func wasmimport_ErrorResourceDrop(self0 uint32) 10 | 11 | //go:wasmimport wasi:io/error@0.2.0 [method]error.to-debug-string 12 | //go:noescape 13 | func wasmimport_ErrorToDebugString(self0 uint32, result *string) 14 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/io/poll/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/io/poll/poll.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package poll 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". 10 | 11 | //go:wasmimport wasi:io/poll@0.2.0 [resource-drop]pollable 12 | //go:noescape 13 | func wasmimport_PollableResourceDrop(self0 uint32) 14 | 15 | //go:wasmimport wasi:io/poll@0.2.0 [method]pollable.block 16 | //go:noescape 17 | func wasmimport_PollableBlock(self0 uint32) 18 | 19 | //go:wasmimport wasi:io/poll@0.2.0 [method]pollable.ready 20 | //go:noescape 21 | func wasmimport_PollableReady(self0 uint32) (result0 uint32) 22 | 23 | //go:wasmimport wasi:io/poll@0.2.0 poll 24 | //go:noescape 25 | func wasmimport_Poll(in0 *Pollable, in1 uint32, result *cm.List[uint32]) 26 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/io/streams/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/logging/logging/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/logging/logging/logging.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package logging 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:logging@0.1.0-draft". 6 | 7 | //go:wasmimport wasi:logging/logging@0.1.0-draft log 8 | //go:noescape 9 | func wasmimport_Log(level0 uint32, context0 *uint8, context1 uint32, message0 *uint8, message1 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/random/insecure-seed/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/random/insecure-seed/insecure-seed.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package insecureseed represents the imported interface "wasi:random/insecure-seed@0.2.0". 4 | package insecureseed 5 | 6 | // InsecureSeed represents the imported function "insecure-seed". 7 | // 8 | // insecure-seed: func() -> tuple 9 | // 10 | //go:nosplit 11 | func InsecureSeed() (result [2]uint64) { 12 | wasmimport_InsecureSeed(&result) 13 | return 14 | } 15 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/random/insecure-seed/insecureseed.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package insecureseed 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". 6 | 7 | //go:wasmimport wasi:random/insecure-seed@0.2.0 insecure-seed 8 | //go:noescape 9 | func wasmimport_InsecureSeed(result *[2]uint64) 10 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/random/insecure/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/random/insecure/insecure.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package insecure 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". 10 | 11 | //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-bytes 12 | //go:noescape 13 | func wasmimport_GetInsecureRandomBytes(len0 uint64, result *cm.List[uint8]) 14 | 15 | //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-u64 16 | //go:noescape 17 | func wasmimport_GetInsecureRandomU64() (result0 uint64) 18 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/random/random/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/random/random/random.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package random 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". 10 | 11 | //go:wasmimport wasi:random/random@0.2.0 get-random-bytes 12 | //go:noescape 13 | func wasmimport_GetRandomBytes(len0 uint64, result *cm.List[uint8]) 14 | 15 | //go:wasmimport wasi:random/random@0.2.0 get-random-u64 16 | //go:noescape 17 | func wasmimport_GetRandomU64() (result0 uint64) 18 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/random/random/random.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package random represents the imported interface "wasi:random/random@0.2.0". 4 | package random 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | ) 9 | 10 | // GetRandomBytes represents the imported function "get-random-bytes". 11 | // 12 | // get-random-bytes: func(len: u64) -> list 13 | // 14 | //go:nosplit 15 | func GetRandomBytes(len_ uint64) (result cm.List[uint8]) { 16 | len0 := (uint64)(len_) 17 | wasmimport_GetRandomBytes((uint64)(len0), &result) 18 | return 19 | } 20 | 21 | // GetRandomU64 represents the imported function "get-random-u64". 22 | // 23 | // get-random-u64: func() -> u64 24 | // 25 | //go:nosplit 26 | func GetRandomU64() (result uint64) { 27 | result0 := wasmimport_GetRandomU64() 28 | result = (uint64)((uint64)(result0)) 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/sockets/instance-network/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/sockets/instance-network/instance-network.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package instancenetwork represents the imported interface "wasi:sockets/instance-network@0.2.0". 4 | package instancenetwork 5 | 6 | import ( 7 | "github.com/wasmCloud/component-sdk-go/_examples/http-server/gen/wasi/sockets/network" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // Network represents the imported type alias "wasi:sockets/instance-network@0.2.0#network". 12 | // 13 | // See [network.Network] for more information. 14 | type Network = network.Network 15 | 16 | // InstanceNetwork represents the imported function "instance-network". 17 | // 18 | // instance-network: func() -> network 19 | // 20 | //go:nosplit 21 | func InstanceNetwork() (result Network) { 22 | result0 := wasmimport_InstanceNetwork() 23 | result = cm.Reinterpret[Network]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/sockets/instance-network/instancenetwork.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package instancenetwork 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 6 | 7 | //go:wasmimport wasi:sockets/instance-network@0.2.0 instance-network 8 | //go:noescape 9 | func wasmimport_InstanceNetwork() (result0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/sockets/ip-name-lookup/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package ipnamelookup 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // OptionIPAddressShape is used for storage in variant or result types. 11 | type OptionIPAddressShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(cm.Option[IPAddress]{})]byte 14 | } 15 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/sockets/ip-name-lookup/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/sockets/network/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package network 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // IPv6SocketAddressShape is used for storage in variant or result types. 11 | type IPv6SocketAddressShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(IPv6SocketAddress{})]byte 14 | } 15 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/sockets/network/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/sockets/network/network.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package network 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 6 | 7 | //go:wasmimport wasi:sockets/network@0.2.0 [resource-drop]network 8 | //go:noescape 9 | func wasmimport_NetworkResourceDrop(self0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/sockets/tcp-create-socket/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package tcpcreatesocket 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 10 | 11 | //go:wasmimport wasi:sockets/tcp-create-socket@0.2.0 create-tcp-socket 12 | //go:noescape 13 | func wasmimport_CreateTCPSocket(addressFamily0 uint32, result *cm.Result[TCPSocket, TCPSocket, ErrorCode]) 14 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/sockets/tcp/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/sockets/udp-create-socket/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package udpcreatesocket 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 10 | 11 | //go:wasmimport wasi:sockets/udp-create-socket@0.2.0 create-udp-socket 12 | //go:noescape 13 | func wasmimport_CreateUDPSocket(addressFamily0 uint32, result *cm.Result[UDPSocket, UDPSocket, ErrorCode]) 14 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasi/sockets/udp/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasmcloud/bus/lattice/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasmcloud/bus/lattice/lattice.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package lattice 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasmcloud:bus@1.0.0". 6 | 7 | //go:wasmimport wasmcloud:bus/lattice@1.0.0 [resource-drop]call-target-interface 8 | //go:noescape 9 | func wasmimport_CallTargetInterfaceResourceDrop(self0 uint32) 10 | 11 | //go:wasmimport wasmcloud:bus/lattice@1.0.0 [constructor]call-target-interface 12 | //go:noescape 13 | func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) (result0 uint32) 14 | 15 | //go:wasmimport wasmcloud:bus/lattice@1.0.0 set-link-name 16 | //go:noescape 17 | func wasmimport_SetLinkName(name0 *uint8, name1 uint32, interfaces0 *CallTargetInterface, interfaces1 uint32) 18 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasmcloud/secrets/reveal/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasmcloud/secrets/reveal/reveal.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package reveal 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". 6 | 7 | //go:wasmimport wasmcloud:secrets/reveal@0.1.0-draft reveal 8 | //go:noescape 9 | func wasmimport_Reveal(s0 uint32, result *SecretValue) 10 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasmcloud/secrets/store/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package store 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // SecretsErrorShape is used for storage in variant or result types. 11 | type SecretsErrorShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(SecretsError{})]byte 14 | } 15 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasmcloud/secrets/store/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/http-server/gen/wasmcloud/secrets/store/store.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package store 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". 10 | 11 | //go:wasmimport wasmcloud:secrets/store@0.1.0-draft [resource-drop]secret 12 | //go:noescape 13 | func wasmimport_SecretResourceDrop(self0 uint32) 14 | 15 | //go:wasmimport wasmcloud:secrets/store@0.1.0-draft get 16 | //go:noescape 17 | func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[SecretsErrorShape, Secret, SecretsError]) 18 | -------------------------------------------------------------------------------- /_examples/http-server/tools.go: -------------------------------------------------------------------------------- 1 | //go:build tools 2 | 3 | package main 4 | 5 | import ( 6 | _ "go.bytecodealliance.org/cmd/wit-bindgen-go" 7 | _ "go.wasmcloud.dev/wadge/cmd/wadge-bindgen-go" 8 | ) 9 | -------------------------------------------------------------------------------- /_examples/http-server/wasmcloud.toml: -------------------------------------------------------------------------------- 1 | name = "http_server" 2 | language = "tinygo" 3 | type = "component" 4 | version = "0.1.0" 5 | 6 | [component] 7 | wit_world = "example" 8 | wasm_target = "wasm32-wasi-preview2" 9 | -------------------------------------------------------------------------------- /_examples/http-server/wit/deps/wasi-clocks-0.2.0/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:clocks@0.2.0; 2 | 3 | interface monotonic-clock { 4 | use wasi:io/poll@0.2.0.{pollable}; 5 | 6 | type instant = u64; 7 | 8 | type duration = u64; 9 | 10 | now: func() -> instant; 11 | 12 | resolution: func() -> duration; 13 | 14 | subscribe-instant: func(when: instant) -> pollable; 15 | 16 | subscribe-duration: func(when: duration) -> pollable; 17 | } 18 | 19 | interface wall-clock { 20 | record datetime { 21 | seconds: u64, 22 | nanoseconds: u32, 23 | } 24 | 25 | now: func() -> datetime; 26 | 27 | resolution: func() -> datetime; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /_examples/http-server/wit/deps/wasi-config-0.2.0-draft/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:config@0.2.0-draft; 2 | 3 | interface runtime { 4 | variant config-error { 5 | upstream(string), 6 | io(string), 7 | } 8 | 9 | get: func(key: string) -> result, config-error>; 10 | 11 | get-all: func() -> result>, config-error>; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /_examples/http-server/wit/deps/wasi-logging-0.1.0-draft/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:logging@0.1.0-draft; 2 | 3 | interface logging { 4 | enum level { 5 | trace, 6 | debug, 7 | info, 8 | warn, 9 | error, 10 | critical, 11 | } 12 | 13 | log: func(level: level, context: string, message: string); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /_examples/http-server/wit/deps/wasi-random-0.2.0/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:random@0.2.0; 2 | 3 | interface random { 4 | get-random-bytes: func(len: u64) -> list; 5 | 6 | get-random-u64: func() -> u64; 7 | } 8 | 9 | interface insecure { 10 | get-insecure-random-bytes: func(len: u64) -> list; 11 | 12 | get-insecure-random-u64: func() -> u64; 13 | } 14 | 15 | interface insecure-seed { 16 | insecure-seed: func() -> tuple; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /_examples/http-server/wit/deps/wasmcloud-bus-1.0.0/package.wit: -------------------------------------------------------------------------------- 1 | package wasmcloud:bus@1.0.0; 2 | 3 | interface lattice { 4 | resource call-target-interface { 5 | constructor(namespace: string, %package: string, %interface: string); 6 | } 7 | 8 | set-link-name: func(name: string, interfaces: list); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /_examples/http-server/wit/deps/wasmcloud-secrets-0.1.0-draft/package.wit: -------------------------------------------------------------------------------- 1 | package wasmcloud:secrets@0.1.0-draft; 2 | 3 | interface store { 4 | variant secrets-error { 5 | upstream(string), 6 | io(string), 7 | not-found, 8 | } 9 | 10 | variant secret-value { 11 | %string(string), 12 | bytes(list), 13 | } 14 | 15 | resource secret; 16 | 17 | get: func(key: string) -> result; 18 | } 19 | 20 | interface reveal { 21 | use store.{secret, secret-value}; 22 | 23 | reveal: func(s: borrow) -> secret-value; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /_examples/http-server/wit/world.wit: -------------------------------------------------------------------------------- 1 | package example:http-server; 2 | 3 | world example { 4 | include wasmcloud:component-go/imports@0.1.0; 5 | export wasi:http/incoming-handler@0.2.0; 6 | } 7 | -------------------------------------------------------------------------------- /_examples/http-server/wkg.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically generated. 2 | # It is not intended for manual editing. 3 | version = 1 4 | 5 | [[packages]] 6 | name = "wasi:http" 7 | registry = "wasi.dev" 8 | 9 | [[packages.versions]] 10 | requirement = "=0.2.0" 11 | version = "0.2.0" 12 | digest = "sha256:5a568e6e2d60c1ce51220e1833cdd5b88db9f615720edc762a9b4a6f36b383bd" 13 | 14 | [[packages]] 15 | name = "wasmcloud:component-go" 16 | registry = "wasmcloud.com" 17 | 18 | [[packages.versions]] 19 | requirement = "=0.1.0" 20 | version = "0.1.0" 21 | digest = "sha256:de3e9af7dedd0d9e882f68f1bee533c7af9c6a1947eb40cbf1ef6163b7d41784" 22 | -------------------------------------------------------------------------------- /_examples/invoke/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wasmCloud/component-sdk-go/54a8f9df29a7a2ef6a4df0494874624fa860f35c/_examples/invoke/.gitignore -------------------------------------------------------------------------------- /_examples/invoke/README.md: -------------------------------------------------------------------------------- 1 | # Custom WIT example 2 | 3 | This example shows how to combine the component-sdk with your custom interfaces. 4 | 5 | Build the example: 6 | 7 | ```bash 8 | wash build 9 | ``` 10 | 11 | Deploy 12 | 13 | ```bash 14 | wash app deploy ./wadm.yaml 15 | ``` 16 | 17 | Call the custom interface: 18 | 19 | ```bash 20 | wash call invoke_example-invoker example:invoker/invoker.call 21 | ``` 22 | -------------------------------------------------------------------------------- /_examples/invoke/build/.gitignore: -------------------------------------------------------------------------------- 1 | # Keep the directory but ignore all files. Dir is required to exist by the build process 2 | * 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/example/invoker/example/example.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package example represents the world "example:invoker/example". 4 | package example 5 | -------------------------------------------------------------------------------- /_examples/invoke/gen/example/invoker/invoker/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/example/invoker/invoker/invoker.exports.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package invoker 4 | 5 | // Exports represents the caller-defined exports from "example:invoker/invoker". 6 | var Exports struct { 7 | // Call represents the caller-defined, exported function "call". 8 | // 9 | // call: func() -> string 10 | Call func() (result string) 11 | } 12 | -------------------------------------------------------------------------------- /_examples/invoke/gen/example/invoker/invoker/invoker.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package invoker 4 | 5 | // This file contains wasmimport and wasmexport declarations for "example:invoker". 6 | 7 | //go:wasmexport example:invoker/invoker#call 8 | //export example:invoker/invoker#call 9 | func wasmexport_Call() (result *string) { 10 | result_ := Exports.Call() 11 | result = &result_ 12 | return 13 | } 14 | -------------------------------------------------------------------------------- /_examples/invoke/gen/example/invoker/invoker/invoker.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package invoker represents the exported interface "example:invoker/invoker". 4 | package invoker 5 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/environment/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/environment/environment.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package environment 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/environment@0.2.0 get-environment 12 | //go:noescape 13 | func wasmimport_GetEnvironment(result *cm.List[[2]string]) 14 | 15 | //go:wasmimport wasi:cli/environment@0.2.0 get-arguments 16 | //go:noescape 17 | func wasmimport_GetArguments(result *cm.List[string]) 18 | 19 | //go:wasmimport wasi:cli/environment@0.2.0 initial-cwd 20 | //go:noescape 21 | func wasmimport_InitialCWD(result *cm.Option[string]) 22 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/exit/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/exit/exit.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package exit 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/exit@0.2.0 exit 8 | //go:noescape 9 | func wasmimport_Exit(status0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/exit/exit.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package exit represents the imported interface "wasi:cli/exit@0.2.0". 4 | package exit 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | ) 9 | 10 | // Exit represents the imported function "exit". 11 | // 12 | // exit: func(status: result) 13 | // 14 | //go:nosplit 15 | func Exit(status cm.BoolResult) { 16 | status0 := cm.BoolToU32(status) 17 | wasmimport_Exit((uint32)(status0)) 18 | return 19 | } 20 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/stderr/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/stderr/stderr.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package stderr 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/stderr@0.2.0 get-stderr 8 | //go:noescape 9 | func wasmimport_GetStderr() (result0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/stderr/stderr.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package stderr represents the imported interface "wasi:cli/stderr@0.2.0". 4 | package stderr 5 | 6 | import ( 7 | "github.com/wasmCloud/component-sdk-go/_examples/invoke/gen/wasi/io/streams" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // OutputStream represents the imported type alias "wasi:cli/stderr@0.2.0#output-stream". 12 | // 13 | // See [streams.OutputStream] for more information. 14 | type OutputStream = streams.OutputStream 15 | 16 | // GetStderr represents the imported function "get-stderr". 17 | // 18 | // get-stderr: func() -> output-stream 19 | // 20 | //go:nosplit 21 | func GetStderr() (result OutputStream) { 22 | result0 := wasmimport_GetStderr() 23 | result = cm.Reinterpret[OutputStream]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/stdin/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/stdin/stdin.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package stdin 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/stdin@0.2.0 get-stdin 8 | //go:noescape 9 | func wasmimport_GetStdin() (result0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/stdin/stdin.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package stdin represents the imported interface "wasi:cli/stdin@0.2.0". 4 | package stdin 5 | 6 | import ( 7 | "github.com/wasmCloud/component-sdk-go/_examples/invoke/gen/wasi/io/streams" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // InputStream represents the imported type alias "wasi:cli/stdin@0.2.0#input-stream". 12 | // 13 | // See [streams.InputStream] for more information. 14 | type InputStream = streams.InputStream 15 | 16 | // GetStdin represents the imported function "get-stdin". 17 | // 18 | // get-stdin: func() -> input-stream 19 | // 20 | //go:nosplit 21 | func GetStdin() (result InputStream) { 22 | result0 := wasmimport_GetStdin() 23 | result = cm.Reinterpret[InputStream]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/stdout/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/stdout/stdout.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package stdout 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/stdout@0.2.0 get-stdout 8 | //go:noescape 9 | func wasmimport_GetStdout() (result0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/stdout/stdout.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package stdout represents the imported interface "wasi:cli/stdout@0.2.0". 4 | package stdout 5 | 6 | import ( 7 | "github.com/wasmCloud/component-sdk-go/_examples/invoke/gen/wasi/io/streams" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // OutputStream represents the imported type alias "wasi:cli/stdout@0.2.0#output-stream". 12 | // 13 | // See [streams.OutputStream] for more information. 14 | type OutputStream = streams.OutputStream 15 | 16 | // GetStdout represents the imported function "get-stdout". 17 | // 18 | // get-stdout: func() -> output-stream 19 | // 20 | //go:nosplit 21 | func GetStdout() (result OutputStream) { 22 | result0 := wasmimport_GetStdout() 23 | result = cm.Reinterpret[OutputStream]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/terminal-input/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/terminal-input/terminal-input.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package terminalinput represents the imported interface "wasi:cli/terminal-input@0.2.0". 4 | package terminalinput 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | ) 9 | 10 | // TerminalInput represents the imported resource "wasi:cli/terminal-input@0.2.0#terminal-input". 11 | // 12 | // resource terminal-input 13 | type TerminalInput cm.Resource 14 | 15 | // ResourceDrop represents the imported resource-drop for resource "terminal-input". 16 | // 17 | // Drops a resource handle. 18 | // 19 | //go:nosplit 20 | func (self TerminalInput) ResourceDrop() { 21 | self0 := cm.Reinterpret[uint32](self) 22 | wasmimport_TerminalInputResourceDrop((uint32)(self0)) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/terminal-input/terminalinput.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalinput 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/terminal-input@0.2.0 [resource-drop]terminal-input 8 | //go:noescape 9 | func wasmimport_TerminalInputResourceDrop(self0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/terminal-output/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/terminal-output/terminal-output.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package terminaloutput represents the imported interface "wasi:cli/terminal-output@0.2.0". 4 | package terminaloutput 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | ) 9 | 10 | // TerminalOutput represents the imported resource "wasi:cli/terminal-output@0.2.0#terminal-output". 11 | // 12 | // resource terminal-output 13 | type TerminalOutput cm.Resource 14 | 15 | // ResourceDrop represents the imported resource-drop for resource "terminal-output". 16 | // 17 | // Drops a resource handle. 18 | // 19 | //go:nosplit 20 | func (self TerminalOutput) ResourceDrop() { 21 | self0 := cm.Reinterpret[uint32](self) 22 | wasmimport_TerminalOutputResourceDrop((uint32)(self0)) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/terminal-output/terminaloutput.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminaloutput 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/terminal-output@0.2.0 [resource-drop]terminal-output 8 | //go:noescape 9 | func wasmimport_TerminalOutputResourceDrop(self0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/terminal-stderr/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package terminalstderr represents the imported interface "wasi:cli/terminal-stderr@0.2.0". 4 | package terminalstderr 5 | 6 | import ( 7 | terminaloutput "github.com/wasmCloud/component-sdk-go/_examples/invoke/gen/wasi/cli/terminal-output" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // TerminalOutput represents the imported type alias "wasi:cli/terminal-stderr@0.2.0#terminal-output". 12 | // 13 | // See [terminaloutput.TerminalOutput] for more information. 14 | type TerminalOutput = terminaloutput.TerminalOutput 15 | 16 | // GetTerminalStderr represents the imported function "get-terminal-stderr". 17 | // 18 | // get-terminal-stderr: func() -> option 19 | // 20 | //go:nosplit 21 | func GetTerminalStderr() (result cm.Option[TerminalOutput]) { 22 | wasmimport_GetTerminalStderr(&result) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalstderr 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/terminal-stderr@0.2.0 get-terminal-stderr 12 | //go:noescape 13 | func wasmimport_GetTerminalStderr(result *cm.Option[TerminalOutput]) 14 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/terminal-stdin/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package terminalstdin represents the imported interface "wasi:cli/terminal-stdin@0.2.0". 4 | package terminalstdin 5 | 6 | import ( 7 | terminalinput "github.com/wasmCloud/component-sdk-go/_examples/invoke/gen/wasi/cli/terminal-input" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // TerminalInput represents the imported type alias "wasi:cli/terminal-stdin@0.2.0#terminal-input". 12 | // 13 | // See [terminalinput.TerminalInput] for more information. 14 | type TerminalInput = terminalinput.TerminalInput 15 | 16 | // GetTerminalStdin represents the imported function "get-terminal-stdin". 17 | // 18 | // get-terminal-stdin: func() -> option 19 | // 20 | //go:nosplit 21 | func GetTerminalStdin() (result cm.Option[TerminalInput]) { 22 | wasmimport_GetTerminalStdin(&result) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalstdin 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/terminal-stdin@0.2.0 get-terminal-stdin 12 | //go:noescape 13 | func wasmimport_GetTerminalStdin(result *cm.Option[TerminalInput]) 14 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/terminal-stdout/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package terminalstdout represents the imported interface "wasi:cli/terminal-stdout@0.2.0". 4 | package terminalstdout 5 | 6 | import ( 7 | terminaloutput "github.com/wasmCloud/component-sdk-go/_examples/invoke/gen/wasi/cli/terminal-output" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // TerminalOutput represents the imported type alias "wasi:cli/terminal-stdout@0.2.0#terminal-output". 12 | // 13 | // See [terminaloutput.TerminalOutput] for more information. 14 | type TerminalOutput = terminaloutput.TerminalOutput 15 | 16 | // GetTerminalStdout represents the imported function "get-terminal-stdout". 17 | // 18 | // get-terminal-stdout: func() -> option 19 | // 20 | //go:nosplit 21 | func GetTerminalStdout() (result cm.Option[TerminalOutput]) { 22 | wasmimport_GetTerminalStdout(&result) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalstdout 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/terminal-stdout@0.2.0 get-terminal-stdout 12 | //go:noescape 13 | func wasmimport_GetTerminalStdout(result *cm.Option[TerminalOutput]) 14 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/clocks/monotonic-clock/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package monotonicclock 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". 6 | 7 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 now 8 | //go:noescape 9 | func wasmimport_Now() (result0 uint64) 10 | 11 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 resolution 12 | //go:noescape 13 | func wasmimport_Resolution() (result0 uint64) 14 | 15 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-instant 16 | //go:noescape 17 | func wasmimport_SubscribeInstant(when0 uint64) (result0 uint32) 18 | 19 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-duration 20 | //go:noescape 21 | func wasmimport_SubscribeDuration(when0 uint64) (result0 uint32) 22 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/clocks/wall-clock/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/clocks/wall-clock/wallclock.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package wallclock 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". 6 | 7 | //go:wasmimport wasi:clocks/wall-clock@0.2.0 now 8 | //go:noescape 9 | func wasmimport_Now(result *DateTime) 10 | 11 | //go:wasmimport wasi:clocks/wall-clock@0.2.0 resolution 12 | //go:noescape 13 | func wasmimport_Resolution(result *DateTime) 14 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/config/runtime/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package runtime 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // OptionStringShape is used for storage in variant or result types. 11 | type OptionStringShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(cm.Option[string]{})]byte 14 | } 15 | 16 | // ConfigErrorShape is used for storage in variant or result types. 17 | type ConfigErrorShape struct { 18 | _ cm.HostLayout 19 | shape [unsafe.Sizeof(ConfigError{})]byte 20 | } 21 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/config/runtime/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/config/runtime/runtime.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package runtime 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:config@0.2.0-draft". 10 | 11 | //go:wasmimport wasi:config/runtime@0.2.0-draft get 12 | //go:noescape 13 | func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[OptionStringShape, cm.Option[string], ConfigError]) 14 | 15 | //go:wasmimport wasi:config/runtime@0.2.0-draft get-all 16 | //go:noescape 17 | func wasmimport_GetAll(result *cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) 18 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/filesystem/preopens/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/filesystem/preopens/preopens.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package preopens 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". 10 | 11 | //go:wasmimport wasi:filesystem/preopens@0.2.0 get-directories 12 | //go:noescape 13 | func wasmimport_GetDirectories(result *cm.List[cm.Tuple[Descriptor, string]]) 14 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/filesystem/preopens/preopens.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package preopens represents the imported interface "wasi:filesystem/preopens@0.2.0". 4 | package preopens 5 | 6 | import ( 7 | "github.com/wasmCloud/component-sdk-go/_examples/invoke/gen/wasi/filesystem/types" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // Descriptor represents the imported type alias "wasi:filesystem/preopens@0.2.0#descriptor". 12 | // 13 | // See [types.Descriptor] for more information. 14 | type Descriptor = types.Descriptor 15 | 16 | // GetDirectories represents the imported function "get-directories". 17 | // 18 | // get-directories: func() -> list> 19 | // 20 | //go:nosplit 21 | func GetDirectories() (result cm.List[cm.Tuple[Descriptor, string]]) { 22 | wasmimport_GetDirectories(&result) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/filesystem/types/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/http/outgoing-handler/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package outgoinghandler 4 | 5 | import ( 6 | "github.com/wasmCloud/component-sdk-go/_examples/invoke/gen/wasi/http/types" 7 | "go.bytecodealliance.org/cm" 8 | "unsafe" 9 | ) 10 | 11 | // ErrorCodeShape is used for storage in variant or result types. 12 | type ErrorCodeShape struct { 13 | _ cm.HostLayout 14 | shape [unsafe.Sizeof(types.ErrorCode{})]byte 15 | } 16 | 17 | func lower_OptionRequestOptions(v cm.Option[RequestOptions]) (f0 uint32, f1 uint32) { 18 | some := v.Some() 19 | if some != nil { 20 | f0 = 1 21 | v1 := cm.Reinterpret[uint32](*some) 22 | f1 = (uint32)(v1) 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/http/outgoing-handler/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package outgoinghandler 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". 10 | 11 | //go:wasmimport wasi:http/outgoing-handler@0.2.0 handle 12 | //go:noescape 13 | func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32, result *cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) 14 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/http/types/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/io/error/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/io/error/ioerror.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package ioerror 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". 6 | 7 | //go:wasmimport wasi:io/error@0.2.0 [resource-drop]error 8 | //go:noescape 9 | func wasmimport_ErrorResourceDrop(self0 uint32) 10 | 11 | //go:wasmimport wasi:io/error@0.2.0 [method]error.to-debug-string 12 | //go:noescape 13 | func wasmimport_ErrorToDebugString(self0 uint32, result *string) 14 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/io/poll/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/io/poll/poll.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package poll 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". 10 | 11 | //go:wasmimport wasi:io/poll@0.2.0 [resource-drop]pollable 12 | //go:noescape 13 | func wasmimport_PollableResourceDrop(self0 uint32) 14 | 15 | //go:wasmimport wasi:io/poll@0.2.0 [method]pollable.block 16 | //go:noescape 17 | func wasmimport_PollableBlock(self0 uint32) 18 | 19 | //go:wasmimport wasi:io/poll@0.2.0 [method]pollable.ready 20 | //go:noescape 21 | func wasmimport_PollableReady(self0 uint32) (result0 uint32) 22 | 23 | //go:wasmimport wasi:io/poll@0.2.0 poll 24 | //go:noescape 25 | func wasmimport_Poll(in0 *Pollable, in1 uint32, result *cm.List[uint32]) 26 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/io/streams/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package streams 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | // StreamErrorShape is used for storage in variant or result types. 10 | type StreamErrorShape struct { 11 | shape [unsafe.Sizeof(StreamError{})]byte 12 | } 13 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/io/streams/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/logging/logging/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/logging/logging/logging.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package logging 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:logging@0.1.0-draft". 6 | 7 | //go:wasmimport wasi:logging/logging@0.1.0-draft log 8 | //go:noescape 9 | func wasmimport_Log(level0 uint32, context0 *uint8, context1 uint32, message0 *uint8, message1 uint32) 10 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/random/insecure-seed/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/random/insecure-seed/insecure-seed.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package insecureseed represents the imported interface "wasi:random/insecure-seed@0.2.0". 4 | package insecureseed 5 | 6 | // InsecureSeed represents the imported function "insecure-seed". 7 | // 8 | // insecure-seed: func() -> tuple 9 | // 10 | //go:nosplit 11 | func InsecureSeed() (result [2]uint64) { 12 | wasmimport_InsecureSeed(&result) 13 | return 14 | } 15 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/random/insecure-seed/insecureseed.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package insecureseed 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". 6 | 7 | //go:wasmimport wasi:random/insecure-seed@0.2.0 insecure-seed 8 | //go:noescape 9 | func wasmimport_InsecureSeed(result *[2]uint64) 10 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/random/insecure/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/random/insecure/insecure.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package insecure 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". 10 | 11 | //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-bytes 12 | //go:noescape 13 | func wasmimport_GetInsecureRandomBytes(len0 uint64, result *cm.List[uint8]) 14 | 15 | //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-u64 16 | //go:noescape 17 | func wasmimport_GetInsecureRandomU64() (result0 uint64) 18 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/random/random/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/random/random/random.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package random 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". 10 | 11 | //go:wasmimport wasi:random/random@0.2.0 get-random-bytes 12 | //go:noescape 13 | func wasmimport_GetRandomBytes(len0 uint64, result *cm.List[uint8]) 14 | 15 | //go:wasmimport wasi:random/random@0.2.0 get-random-u64 16 | //go:noescape 17 | func wasmimport_GetRandomU64() (result0 uint64) 18 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/random/random/random.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package random represents the imported interface "wasi:random/random@0.2.0". 4 | package random 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | ) 9 | 10 | // GetRandomBytes represents the imported function "get-random-bytes". 11 | // 12 | // get-random-bytes: func(len: u64) -> list 13 | // 14 | //go:nosplit 15 | func GetRandomBytes(len_ uint64) (result cm.List[uint8]) { 16 | len0 := (uint64)(len_) 17 | wasmimport_GetRandomBytes((uint64)(len0), &result) 18 | return 19 | } 20 | 21 | // GetRandomU64 represents the imported function "get-random-u64". 22 | // 23 | // get-random-u64: func() -> u64 24 | // 25 | //go:nosplit 26 | func GetRandomU64() (result uint64) { 27 | result0 := wasmimport_GetRandomU64() 28 | result = (uint64)((uint64)(result0)) 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/sockets/instance-network/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/sockets/instance-network/instance-network.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package instancenetwork represents the imported interface "wasi:sockets/instance-network@0.2.0". 4 | package instancenetwork 5 | 6 | import ( 7 | "github.com/wasmCloud/component-sdk-go/_examples/invoke/gen/wasi/sockets/network" 8 | "go.bytecodealliance.org/cm" 9 | ) 10 | 11 | // Network represents the imported type alias "wasi:sockets/instance-network@0.2.0#network". 12 | // 13 | // See [network.Network] for more information. 14 | type Network = network.Network 15 | 16 | // InstanceNetwork represents the imported function "instance-network". 17 | // 18 | // instance-network: func() -> network 19 | // 20 | //go:nosplit 21 | func InstanceNetwork() (result Network) { 22 | result0 := wasmimport_InstanceNetwork() 23 | result = cm.Reinterpret[Network]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/sockets/instance-network/instancenetwork.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package instancenetwork 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 6 | 7 | //go:wasmimport wasi:sockets/instance-network@0.2.0 instance-network 8 | //go:noescape 9 | func wasmimport_InstanceNetwork() (result0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/sockets/ip-name-lookup/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package ipnamelookup 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // OptionIPAddressShape is used for storage in variant or result types. 11 | type OptionIPAddressShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(cm.Option[IPAddress]{})]byte 14 | } 15 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/sockets/ip-name-lookup/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/sockets/network/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package network 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // IPv6SocketAddressShape is used for storage in variant or result types. 11 | type IPv6SocketAddressShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(IPv6SocketAddress{})]byte 14 | } 15 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/sockets/network/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/sockets/network/network.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package network 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 6 | 7 | //go:wasmimport wasi:sockets/network@0.2.0 [resource-drop]network 8 | //go:noescape 9 | func wasmimport_NetworkResourceDrop(self0 uint32) 10 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/sockets/tcp-create-socket/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package tcpcreatesocket 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 10 | 11 | //go:wasmimport wasi:sockets/tcp-create-socket@0.2.0 create-tcp-socket 12 | //go:noescape 13 | func wasmimport_CreateTCPSocket(addressFamily0 uint32, result *cm.Result[TCPSocket, TCPSocket, ErrorCode]) 14 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/sockets/tcp/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/sockets/udp-create-socket/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package udpcreatesocket 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 10 | 11 | //go:wasmimport wasi:sockets/udp-create-socket@0.2.0 create-udp-socket 12 | //go:noescape 13 | func wasmimport_CreateUDPSocket(addressFamily0 uint32, result *cm.Result[UDPSocket, UDPSocket, ErrorCode]) 14 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasi/sockets/udp/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasmcloud/bus/lattice/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasmcloud/bus/lattice/lattice.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package lattice 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasmcloud:bus@1.0.0". 6 | 7 | //go:wasmimport wasmcloud:bus/lattice@1.0.0 [resource-drop]call-target-interface 8 | //go:noescape 9 | func wasmimport_CallTargetInterfaceResourceDrop(self0 uint32) 10 | 11 | //go:wasmimport wasmcloud:bus/lattice@1.0.0 [constructor]call-target-interface 12 | //go:noescape 13 | func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) (result0 uint32) 14 | 15 | //go:wasmimport wasmcloud:bus/lattice@1.0.0 set-link-name 16 | //go:noescape 17 | func wasmimport_SetLinkName(name0 *uint8, name1 uint32, interfaces0 *CallTargetInterface, interfaces1 uint32) 18 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasmcloud/secrets/reveal/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasmcloud/secrets/reveal/reveal.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package reveal 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". 6 | 7 | //go:wasmimport wasmcloud:secrets/reveal@0.1.0-draft reveal 8 | //go:noescape 9 | func wasmimport_Reveal(s0 uint32, result *SecretValue) 10 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasmcloud/secrets/store/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package store 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // SecretsErrorShape is used for storage in variant or result types. 11 | type SecretsErrorShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(SecretsError{})]byte 14 | } 15 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasmcloud/secrets/store/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /_examples/invoke/gen/wasmcloud/secrets/store/store.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package store 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". 10 | 11 | //go:wasmimport wasmcloud:secrets/store@0.1.0-draft [resource-drop]secret 12 | //go:noescape 13 | func wasmimport_SecretResourceDrop(self0 uint32) 14 | 15 | //go:wasmimport wasmcloud:secrets/store@0.1.0-draft get 16 | //go:noescape 17 | func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[SecretsErrorShape, Secret, SecretsError]) 18 | -------------------------------------------------------------------------------- /_examples/invoke/main.go: -------------------------------------------------------------------------------- 1 | //go:generate go run go.bytecodealliance.org/cmd/wit-bindgen-go generate --world example --out gen ./wit 2 | 3 | package main 4 | 5 | import ( 6 | "github.com/wasmCloud/component-sdk-go/_examples/invoke/gen/example/invoker/invoker" 7 | "go.wasmcloud.dev/component/log/wasilog" 8 | ) 9 | 10 | const InvokeResponse = "Hello from the invoker!" 11 | 12 | func init() { 13 | invoker.Exports.Call = invokerCall 14 | } 15 | 16 | func invokerCall() string { 17 | logger := wasilog.ContextLogger("Call") 18 | logger.Info("Invoking function") 19 | return InvokeResponse 20 | } 21 | 22 | func main() {} 23 | -------------------------------------------------------------------------------- /_examples/invoke/main_test.go: -------------------------------------------------------------------------------- 1 | //go:generate go run go.wasmcloud.dev/wadge/cmd/wadge-bindgen-go -test 2 | 3 | package main 4 | 5 | import ( 6 | "log" 7 | "log/slog" 8 | "os" 9 | "testing" 10 | 11 | "github.com/stretchr/testify/assert" 12 | "go.wasmcloud.dev/wadge" 13 | ) 14 | 15 | func init() { 16 | log.SetFlags(0) 17 | slog.SetDefault(slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{ 18 | Level: slog.LevelDebug, ReplaceAttr: func(groups []string, a slog.Attr) slog.Attr { 19 | if a.Key == slog.TimeKey { 20 | return slog.Attr{} 21 | } 22 | return a 23 | }, 24 | }))) 25 | } 26 | 27 | func TestCall(t *testing.T) { 28 | wadge.RunTest(t, func() { 29 | buf := invokerCall() 30 | assert.Equal(t, InvokeResponse, buf) 31 | }) 32 | } 33 | -------------------------------------------------------------------------------- /_examples/invoke/tools.go: -------------------------------------------------------------------------------- 1 | //go:build tools 2 | 3 | package main 4 | 5 | import ( 6 | _ "go.bytecodealliance.org/cmd/wit-bindgen-go" 7 | _ "go.wasmcloud.dev/wadge/cmd/wadge-bindgen-go" 8 | ) 9 | -------------------------------------------------------------------------------- /_examples/invoke/wadm.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: core.oam.dev/v1beta1 2 | kind: Application 3 | metadata: 4 | name: invoke-example 5 | annotations: 6 | description: All-in-one demo 7 | wasmcloud.dev/authors: wasmCloud team 8 | wasmcloud.dev/source-url: https://github.com/wasmCloud/wasmCloud/blob/main/examples/rust/components/http-image-processor/wadm.yaml 9 | wasmcloud.dev/readme-md-url: https://github.com/wasmCloud/wasmCloud/blob/main/examples/rust/components/http-image-processor/README.md 10 | wasmcloud.dev/homepage: https://github.com/wasmCloud/wasmCloud/tree/main/examples/rust/components/http-image-processor 11 | wasmcloud.dev/categories: go,hello-world,example 12 | spec: 13 | components: 14 | - name: invoker 15 | type: component 16 | properties: 17 | image: file://./build/invoke_s.wasm 18 | traits: 19 | - type: spreadscaler 20 | properties: 21 | replicas: 1 22 | -------------------------------------------------------------------------------- /_examples/invoke/wasmcloud.toml: -------------------------------------------------------------------------------- 1 | name = "invoke" 2 | language = "tinygo" 3 | type = "component" 4 | version = "0.1.0" 5 | 6 | [component] 7 | wit_world = "example" 8 | wasm_target = "wasm32-wasi-preview2" 9 | destination = "build/invoke_s.wasm" 10 | -------------------------------------------------------------------------------- /_examples/invoke/wit/deps/wasi-clocks-0.2.0/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:clocks@0.2.0; 2 | 3 | interface monotonic-clock { 4 | use wasi:io/poll@0.2.0.{pollable}; 5 | 6 | type instant = u64; 7 | 8 | type duration = u64; 9 | 10 | now: func() -> instant; 11 | 12 | resolution: func() -> duration; 13 | 14 | subscribe-instant: func(when: instant) -> pollable; 15 | 16 | subscribe-duration: func(when: duration) -> pollable; 17 | } 18 | 19 | interface wall-clock { 20 | record datetime { 21 | seconds: u64, 22 | nanoseconds: u32, 23 | } 24 | 25 | now: func() -> datetime; 26 | 27 | resolution: func() -> datetime; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /_examples/invoke/wit/deps/wasi-config-0.2.0-draft/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:config@0.2.0-draft; 2 | 3 | interface runtime { 4 | variant config-error { 5 | upstream(string), 6 | io(string), 7 | } 8 | 9 | get: func(key: string) -> result, config-error>; 10 | 11 | get-all: func() -> result>, config-error>; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /_examples/invoke/wit/deps/wasi-logging-0.1.0-draft/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:logging@0.1.0-draft; 2 | 3 | interface logging { 4 | enum level { 5 | trace, 6 | debug, 7 | info, 8 | warn, 9 | error, 10 | critical, 11 | } 12 | 13 | log: func(level: level, context: string, message: string); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /_examples/invoke/wit/deps/wasi-random-0.2.0/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:random@0.2.0; 2 | 3 | interface random { 4 | get-random-bytes: func(len: u64) -> list; 5 | 6 | get-random-u64: func() -> u64; 7 | } 8 | 9 | interface insecure { 10 | get-insecure-random-bytes: func(len: u64) -> list; 11 | 12 | get-insecure-random-u64: func() -> u64; 13 | } 14 | 15 | interface insecure-seed { 16 | insecure-seed: func() -> tuple; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /_examples/invoke/wit/deps/wasmcloud-bus-1.0.0/package.wit: -------------------------------------------------------------------------------- 1 | package wasmcloud:bus@1.0.0; 2 | 3 | interface lattice { 4 | resource call-target-interface { 5 | constructor(namespace: string, %package: string, %interface: string); 6 | } 7 | 8 | set-link-name: func(name: string, interfaces: list); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /_examples/invoke/wit/deps/wasmcloud-secrets-0.1.0-draft/package.wit: -------------------------------------------------------------------------------- 1 | package wasmcloud:secrets@0.1.0-draft; 2 | 3 | interface store { 4 | variant secrets-error { 5 | upstream(string), 6 | io(string), 7 | not-found, 8 | } 9 | 10 | variant secret-value { 11 | %string(string), 12 | bytes(list), 13 | } 14 | 15 | resource secret; 16 | 17 | get: func(key: string) -> result; 18 | } 19 | 20 | interface reveal { 21 | use store.{secret, secret-value}; 22 | 23 | reveal: func(s: borrow) -> secret-value; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /_examples/invoke/wit/world.wit: -------------------------------------------------------------------------------- 1 | package example:invoker; 2 | 3 | interface invoker { 4 | call: func() -> string; 5 | } 6 | 7 | world example { 8 | include wasmcloud:component-go/imports@0.1.0; 9 | export invoker; 10 | } 11 | -------------------------------------------------------------------------------- /_examples/invoke/wkg.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically generated. 2 | # It is not intended for manual editing. 3 | version = 1 4 | 5 | [[packages]] 6 | name = "wasmcloud:component-go" 7 | registry = "wasmcloud.com" 8 | 9 | [[packages.versions]] 10 | requirement = "=0.1.0" 11 | version = "0.1.0" 12 | digest = "sha256:de3e9af7dedd0d9e882f68f1bee533c7af9c6a1947eb40cbf1ef6163b7d41784" 13 | -------------------------------------------------------------------------------- /gen/wasi/cli/environment/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/cli/environment/environment.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package environment 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/environment@0.2.0 get-environment 12 | //go:noescape 13 | func wasmimport_GetEnvironment(result *cm.List[[2]string]) 14 | 15 | //go:wasmimport wasi:cli/environment@0.2.0 get-arguments 16 | //go:noescape 17 | func wasmimport_GetArguments(result *cm.List[string]) 18 | 19 | //go:wasmimport wasi:cli/environment@0.2.0 initial-cwd 20 | //go:noescape 21 | func wasmimport_InitialCWD(result *cm.Option[string]) 22 | -------------------------------------------------------------------------------- /gen/wasi/cli/exit/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/cli/exit/exit.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package exit 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/exit@0.2.0 exit 8 | //go:noescape 9 | func wasmimport_Exit(status0 uint32) 10 | -------------------------------------------------------------------------------- /gen/wasi/cli/exit/exit.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package exit represents the imported interface "wasi:cli/exit@0.2.0". 4 | package exit 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | ) 9 | 10 | // Exit represents the imported function "exit". 11 | // 12 | // Exit the current instance and any linked instances. 13 | // 14 | // exit: func(status: result) 15 | // 16 | //go:nosplit 17 | func Exit(status cm.BoolResult) { 18 | status0 := cm.BoolToU32(status) 19 | wasmimport_Exit((uint32)(status0)) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /gen/wasi/cli/stderr/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/cli/stderr/stderr.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package stderr 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/stderr@0.2.0 get-stderr 8 | //go:noescape 9 | func wasmimport_GetStderr() (result0 uint32) 10 | -------------------------------------------------------------------------------- /gen/wasi/cli/stderr/stderr.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package stderr represents the imported interface "wasi:cli/stderr@0.2.0". 4 | package stderr 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | "go.wasmcloud.dev/component/gen/wasi/io/streams" 9 | ) 10 | 11 | // OutputStream represents the imported type alias "wasi:cli/stderr@0.2.0#output-stream". 12 | // 13 | // See [streams.OutputStream] for more information. 14 | type OutputStream = streams.OutputStream 15 | 16 | // GetStderr represents the imported function "get-stderr". 17 | // 18 | // get-stderr: func() -> output-stream 19 | // 20 | //go:nosplit 21 | func GetStderr() (result OutputStream) { 22 | result0 := wasmimport_GetStderr() 23 | result = cm.Reinterpret[OutputStream]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /gen/wasi/cli/stdin/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/cli/stdin/stdin.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package stdin 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/stdin@0.2.0 get-stdin 8 | //go:noescape 9 | func wasmimport_GetStdin() (result0 uint32) 10 | -------------------------------------------------------------------------------- /gen/wasi/cli/stdin/stdin.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package stdin represents the imported interface "wasi:cli/stdin@0.2.0". 4 | package stdin 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | "go.wasmcloud.dev/component/gen/wasi/io/streams" 9 | ) 10 | 11 | // InputStream represents the imported type alias "wasi:cli/stdin@0.2.0#input-stream". 12 | // 13 | // See [streams.InputStream] for more information. 14 | type InputStream = streams.InputStream 15 | 16 | // GetStdin represents the imported function "get-stdin". 17 | // 18 | // get-stdin: func() -> input-stream 19 | // 20 | //go:nosplit 21 | func GetStdin() (result InputStream) { 22 | result0 := wasmimport_GetStdin() 23 | result = cm.Reinterpret[InputStream]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /gen/wasi/cli/stdout/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/cli/stdout/stdout.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package stdout 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/stdout@0.2.0 get-stdout 8 | //go:noescape 9 | func wasmimport_GetStdout() (result0 uint32) 10 | -------------------------------------------------------------------------------- /gen/wasi/cli/stdout/stdout.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package stdout represents the imported interface "wasi:cli/stdout@0.2.0". 4 | package stdout 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | "go.wasmcloud.dev/component/gen/wasi/io/streams" 9 | ) 10 | 11 | // OutputStream represents the imported type alias "wasi:cli/stdout@0.2.0#output-stream". 12 | // 13 | // See [streams.OutputStream] for more information. 14 | type OutputStream = streams.OutputStream 15 | 16 | // GetStdout represents the imported function "get-stdout". 17 | // 18 | // get-stdout: func() -> output-stream 19 | // 20 | //go:nosplit 21 | func GetStdout() (result OutputStream) { 22 | result0 := wasmimport_GetStdout() 23 | result = cm.Reinterpret[OutputStream]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /gen/wasi/cli/terminal-input/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/cli/terminal-input/terminalinput.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalinput 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/terminal-input@0.2.0 [resource-drop]terminal-input 8 | //go:noescape 9 | func wasmimport_TerminalInputResourceDrop(self0 uint32) 10 | -------------------------------------------------------------------------------- /gen/wasi/cli/terminal-output/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/cli/terminal-output/terminaloutput.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminaloutput 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 6 | 7 | //go:wasmimport wasi:cli/terminal-output@0.2.0 [resource-drop]terminal-output 8 | //go:noescape 9 | func wasmimport_TerminalOutputResourceDrop(self0 uint32) 10 | -------------------------------------------------------------------------------- /gen/wasi/cli/terminal-stderr/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalstderr 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/terminal-stderr@0.2.0 get-terminal-stderr 12 | //go:noescape 13 | func wasmimport_GetTerminalStderr(result *cm.Option[TerminalOutput]) 14 | -------------------------------------------------------------------------------- /gen/wasi/cli/terminal-stdin/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalstdin 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/terminal-stdin@0.2.0 get-terminal-stdin 12 | //go:noescape 13 | func wasmimport_GetTerminalStdin(result *cm.Option[TerminalInput]) 14 | -------------------------------------------------------------------------------- /gen/wasi/cli/terminal-stdout/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package terminalstdout 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". 10 | 11 | //go:wasmimport wasi:cli/terminal-stdout@0.2.0 get-terminal-stdout 12 | //go:noescape 13 | func wasmimport_GetTerminalStdout(result *cm.Option[TerminalOutput]) 14 | -------------------------------------------------------------------------------- /gen/wasi/clocks/monotonic-clock/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package monotonicclock 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". 6 | 7 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 now 8 | //go:noescape 9 | func wasmimport_Now() (result0 uint64) 10 | 11 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 resolution 12 | //go:noescape 13 | func wasmimport_Resolution() (result0 uint64) 14 | 15 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-instant 16 | //go:noescape 17 | func wasmimport_SubscribeInstant(when0 uint64) (result0 uint32) 18 | 19 | //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-duration 20 | //go:noescape 21 | func wasmimport_SubscribeDuration(when0 uint64) (result0 uint32) 22 | -------------------------------------------------------------------------------- /gen/wasi/clocks/wall-clock/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/clocks/wall-clock/wallclock.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package wallclock 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". 6 | 7 | //go:wasmimport wasi:clocks/wall-clock@0.2.0 now 8 | //go:noescape 9 | func wasmimport_Now(result *DateTime) 10 | 11 | //go:wasmimport wasi:clocks/wall-clock@0.2.0 resolution 12 | //go:noescape 13 | func wasmimport_Resolution(result *DateTime) 14 | -------------------------------------------------------------------------------- /gen/wasi/config/runtime/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package runtime 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // OptionStringShape is used for storage in variant or result types. 11 | type OptionStringShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(cm.Option[string]{})]byte 14 | } 15 | 16 | // ConfigErrorShape is used for storage in variant or result types. 17 | type ConfigErrorShape struct { 18 | _ cm.HostLayout 19 | shape [unsafe.Sizeof(ConfigError{})]byte 20 | } 21 | -------------------------------------------------------------------------------- /gen/wasi/config/runtime/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/config/runtime/runtime.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package runtime 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:config@0.2.0-draft". 10 | 11 | //go:wasmimport wasi:config/runtime@0.2.0-draft get 12 | //go:noescape 13 | func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[OptionStringShape, cm.Option[string], ConfigError]) 14 | 15 | //go:wasmimport wasi:config/runtime@0.2.0-draft get-all 16 | //go:noescape 17 | func wasmimport_GetAll(result *cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) 18 | -------------------------------------------------------------------------------- /gen/wasi/filesystem/preopens/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/filesystem/preopens/preopens.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package preopens 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". 10 | 11 | //go:wasmimport wasi:filesystem/preopens@0.2.0 get-directories 12 | //go:noescape 13 | func wasmimport_GetDirectories(result *cm.List[cm.Tuple[Descriptor, string]]) 14 | -------------------------------------------------------------------------------- /gen/wasi/filesystem/preopens/preopens.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package preopens represents the imported interface "wasi:filesystem/preopens@0.2.0". 4 | package preopens 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | "go.wasmcloud.dev/component/gen/wasi/filesystem/types" 9 | ) 10 | 11 | // Descriptor represents the imported type alias "wasi:filesystem/preopens@0.2.0#descriptor". 12 | // 13 | // See [types.Descriptor] for more information. 14 | type Descriptor = types.Descriptor 15 | 16 | // GetDirectories represents the imported function "get-directories". 17 | // 18 | // get-directories: func() -> list> 19 | // 20 | //go:nosplit 21 | func GetDirectories() (result cm.List[cm.Tuple[Descriptor, string]]) { 22 | wasmimport_GetDirectories(&result) 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /gen/wasi/filesystem/types/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/http/incoming-handler/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/http/incoming-handler/incoming-handler.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package incominghandler represents the exported interface "wasi:http/incoming-handler@0.2.0". 4 | // 5 | // This interface defines a handler of incoming HTTP Requests. It should 6 | // be exported by components which can respond to HTTP Requests. 7 | package incominghandler 8 | 9 | import ( 10 | "go.wasmcloud.dev/component/gen/wasi/http/types" 11 | ) 12 | 13 | // IncomingRequest represents the exported type alias "wasi:http/incoming-handler@0.2.0#incoming-request". 14 | // 15 | // See [types.IncomingRequest] for more information. 16 | type IncomingRequest = types.IncomingRequest 17 | 18 | // ResponseOutparam represents the exported type alias "wasi:http/incoming-handler@0.2.0#response-outparam". 19 | // 20 | // See [types.ResponseOutparam] for more information. 21 | type ResponseOutparam = types.ResponseOutparam 22 | -------------------------------------------------------------------------------- /gen/wasi/http/incoming-handler/incominghandler.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package incominghandler 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". 10 | 11 | //go:wasmexport wasi:http/incoming-handler@0.2.0#handle 12 | //export wasi:http/incoming-handler@0.2.0#handle 13 | func wasmexport_Handle(request0 uint32, responseOut0 uint32) { 14 | request := cm.Reinterpret[IncomingRequest]((uint32)(request0)) 15 | responseOut := cm.Reinterpret[ResponseOutparam]((uint32)(responseOut0)) 16 | Exports.Handle(request, responseOut) 17 | return 18 | } 19 | -------------------------------------------------------------------------------- /gen/wasi/http/outgoing-handler/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package outgoinghandler 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "go.wasmcloud.dev/component/gen/wasi/http/types" 8 | "unsafe" 9 | ) 10 | 11 | // ErrorCodeShape is used for storage in variant or result types. 12 | type ErrorCodeShape struct { 13 | _ cm.HostLayout 14 | shape [unsafe.Sizeof(types.ErrorCode{})]byte 15 | } 16 | 17 | func lower_OptionRequestOptions(v cm.Option[RequestOptions]) (f0 uint32, f1 uint32) { 18 | some := v.Some() 19 | if some != nil { 20 | f0 = 1 21 | v1 := cm.Reinterpret[uint32](*some) 22 | f1 = (uint32)(v1) 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /gen/wasi/http/outgoing-handler/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package outgoinghandler 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". 10 | 11 | //go:wasmimport wasi:http/outgoing-handler@0.2.0 handle 12 | //go:noescape 13 | func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32, result *cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) 14 | -------------------------------------------------------------------------------- /gen/wasi/http/types/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/io/error/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/io/error/ioerror.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package ioerror 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". 6 | 7 | //go:wasmimport wasi:io/error@0.2.0 [resource-drop]error 8 | //go:noescape 9 | func wasmimport_ErrorResourceDrop(self0 uint32) 10 | 11 | //go:wasmimport wasi:io/error@0.2.0 [method]error.to-debug-string 12 | //go:noescape 13 | func wasmimport_ErrorToDebugString(self0 uint32, result *string) 14 | -------------------------------------------------------------------------------- /gen/wasi/io/poll/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/io/poll/poll.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package poll 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". 10 | 11 | //go:wasmimport wasi:io/poll@0.2.0 [resource-drop]pollable 12 | //go:noescape 13 | func wasmimport_PollableResourceDrop(self0 uint32) 14 | 15 | //go:wasmimport wasi:io/poll@0.2.0 [method]pollable.block 16 | //go:noescape 17 | func wasmimport_PollableBlock(self0 uint32) 18 | 19 | //go:wasmimport wasi:io/poll@0.2.0 [method]pollable.ready 20 | //go:noescape 21 | func wasmimport_PollableReady(self0 uint32) (result0 uint32) 22 | 23 | //go:wasmimport wasi:io/poll@0.2.0 poll 24 | //go:noescape 25 | func wasmimport_Poll(in0 *Pollable, in1 uint32, result *cm.List[uint32]) 26 | -------------------------------------------------------------------------------- /gen/wasi/io/streams/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/logging/logging/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/logging/logging/logging.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package logging 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:logging@0.1.0-draft". 6 | 7 | //go:wasmimport wasi:logging/logging@0.1.0-draft log 8 | //go:noescape 9 | func wasmimport_Log(level0 uint32, context0 *uint8, context1 uint32, message0 *uint8, message1 uint32) 10 | -------------------------------------------------------------------------------- /gen/wasi/random/insecure-seed/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/random/insecure-seed/insecure-seed.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package insecureseed represents the imported interface "wasi:random/insecure-seed@0.2.0". 4 | package insecureseed 5 | 6 | // InsecureSeed represents the imported function "insecure-seed". 7 | // 8 | // insecure-seed: func() -> tuple 9 | // 10 | //go:nosplit 11 | func InsecureSeed() (result [2]uint64) { 12 | wasmimport_InsecureSeed(&result) 13 | return 14 | } 15 | -------------------------------------------------------------------------------- /gen/wasi/random/insecure-seed/insecureseed.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package insecureseed 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". 6 | 7 | //go:wasmimport wasi:random/insecure-seed@0.2.0 insecure-seed 8 | //go:noescape 9 | func wasmimport_InsecureSeed(result *[2]uint64) 10 | -------------------------------------------------------------------------------- /gen/wasi/random/insecure/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/random/insecure/insecure.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package insecure 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". 10 | 11 | //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-bytes 12 | //go:noescape 13 | func wasmimport_GetInsecureRandomBytes(len0 uint64, result *cm.List[uint8]) 14 | 15 | //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-u64 16 | //go:noescape 17 | func wasmimport_GetInsecureRandomU64() (result0 uint64) 18 | -------------------------------------------------------------------------------- /gen/wasi/random/random/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/random/random/random.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package random 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". 10 | 11 | //go:wasmimport wasi:random/random@0.2.0 get-random-bytes 12 | //go:noescape 13 | func wasmimport_GetRandomBytes(len0 uint64, result *cm.List[uint8]) 14 | 15 | //go:wasmimport wasi:random/random@0.2.0 get-random-u64 16 | //go:noescape 17 | func wasmimport_GetRandomU64() (result0 uint64) 18 | -------------------------------------------------------------------------------- /gen/wasi/random/random/random.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package random represents the imported interface "wasi:random/random@0.2.0". 4 | package random 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | ) 9 | 10 | // GetRandomBytes represents the imported function "get-random-bytes". 11 | // 12 | // get-random-bytes: func(len: u64) -> list 13 | // 14 | //go:nosplit 15 | func GetRandomBytes(len_ uint64) (result cm.List[uint8]) { 16 | len0 := (uint64)(len_) 17 | wasmimport_GetRandomBytes((uint64)(len0), &result) 18 | return 19 | } 20 | 21 | // GetRandomU64 represents the imported function "get-random-u64". 22 | // 23 | // get-random-u64: func() -> u64 24 | // 25 | //go:nosplit 26 | func GetRandomU64() (result uint64) { 27 | result0 := wasmimport_GetRandomU64() 28 | result = (uint64)((uint64)(result0)) 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /gen/wasi/sockets/instance-network/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/sockets/instance-network/instance-network.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package instancenetwork represents the imported interface "wasi:sockets/instance-network@0.2.0". 4 | package instancenetwork 5 | 6 | import ( 7 | "go.bytecodealliance.org/cm" 8 | "go.wasmcloud.dev/component/gen/wasi/sockets/network" 9 | ) 10 | 11 | // Network represents the imported type alias "wasi:sockets/instance-network@0.2.0#network". 12 | // 13 | // See [network.Network] for more information. 14 | type Network = network.Network 15 | 16 | // InstanceNetwork represents the imported function "instance-network". 17 | // 18 | // instance-network: func() -> network 19 | // 20 | //go:nosplit 21 | func InstanceNetwork() (result Network) { 22 | result0 := wasmimport_InstanceNetwork() 23 | result = cm.Reinterpret[Network]((uint32)(result0)) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /gen/wasi/sockets/instance-network/instancenetwork.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package instancenetwork 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 6 | 7 | //go:wasmimport wasi:sockets/instance-network@0.2.0 instance-network 8 | //go:noescape 9 | func wasmimport_InstanceNetwork() (result0 uint32) 10 | -------------------------------------------------------------------------------- /gen/wasi/sockets/ip-name-lookup/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package ipnamelookup 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // OptionIPAddressShape is used for storage in variant or result types. 11 | type OptionIPAddressShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(cm.Option[IPAddress]{})]byte 14 | } 15 | -------------------------------------------------------------------------------- /gen/wasi/sockets/ip-name-lookup/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/sockets/network/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package network 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // IPv6SocketAddressShape is used for storage in variant or result types. 11 | type IPv6SocketAddressShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(IPv6SocketAddress{})]byte 14 | } 15 | -------------------------------------------------------------------------------- /gen/wasi/sockets/network/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/sockets/network/network.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package network 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 6 | 7 | //go:wasmimport wasi:sockets/network@0.2.0 [resource-drop]network 8 | //go:noescape 9 | func wasmimport_NetworkResourceDrop(self0 uint32) 10 | -------------------------------------------------------------------------------- /gen/wasi/sockets/tcp-create-socket/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package tcpcreatesocket 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 10 | 11 | //go:wasmimport wasi:sockets/tcp-create-socket@0.2.0 create-tcp-socket 12 | //go:noescape 13 | func wasmimport_CreateTCPSocket(addressFamily0 uint32, result *cm.Result[TCPSocket, TCPSocket, ErrorCode]) 14 | -------------------------------------------------------------------------------- /gen/wasi/sockets/tcp/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/sockets/udp-create-socket/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package udpcreatesocket 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". 10 | 11 | //go:wasmimport wasi:sockets/udp-create-socket@0.2.0 create-udp-socket 12 | //go:noescape 13 | func wasmimport_CreateUDPSocket(addressFamily0 uint32, result *cm.Result[UDPSocket, UDPSocket, ErrorCode]) 14 | -------------------------------------------------------------------------------- /gen/wasi/sockets/udp/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasmcloud/bus/lattice/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasmcloud/bus/lattice/lattice.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package lattice 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasmcloud:bus@1.0.0". 6 | 7 | //go:wasmimport wasmcloud:bus/lattice@1.0.0 [resource-drop]call-target-interface 8 | //go:noescape 9 | func wasmimport_CallTargetInterfaceResourceDrop(self0 uint32) 10 | 11 | //go:wasmimport wasmcloud:bus/lattice@1.0.0 [constructor]call-target-interface 12 | //go:noescape 13 | func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) (result0 uint32) 14 | 15 | //go:wasmimport wasmcloud:bus/lattice@1.0.0 set-link-name 16 | //go:noescape 17 | func wasmimport_SetLinkName(name0 *uint8, name1 uint32, interfaces0 *CallTargetInterface, interfaces1 uint32) 18 | -------------------------------------------------------------------------------- /gen/wasmcloud/component-go/sdk/sdk.wit.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | // Package sdk represents the world "wasmcloud:component-go/sdk@0.1.0". 4 | package sdk 5 | -------------------------------------------------------------------------------- /gen/wasmcloud/secrets/reveal/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasmcloud/secrets/reveal/reveal.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package reveal 4 | 5 | // This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". 6 | 7 | //go:wasmimport wasmcloud:secrets/reveal@0.1.0-draft reveal 8 | //go:noescape 9 | func wasmimport_Reveal(s0 uint32, result *SecretValue) 10 | -------------------------------------------------------------------------------- /gen/wasmcloud/secrets/store/abi.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package store 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | "unsafe" 8 | ) 9 | 10 | // SecretsErrorShape is used for storage in variant or result types. 11 | type SecretsErrorShape struct { 12 | _ cm.HostLayout 13 | shape [unsafe.Sizeof(SecretsError{})]byte 14 | } 15 | -------------------------------------------------------------------------------- /gen/wasmcloud/secrets/store/empty.s: -------------------------------------------------------------------------------- 1 | // This file exists for testing this package without WebAssembly, 2 | // allowing empty function bodies with a //go:wasmimport directive. 3 | // See https://pkg.go.dev/cmd/compile for more information. 4 | -------------------------------------------------------------------------------- /gen/wasmcloud/secrets/store/store.wasm.go: -------------------------------------------------------------------------------- 1 | // Code generated by wit-bindgen-go. DO NOT EDIT. 2 | 3 | package store 4 | 5 | import ( 6 | "go.bytecodealliance.org/cm" 7 | ) 8 | 9 | // This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". 10 | 11 | //go:wasmimport wasmcloud:secrets/store@0.1.0-draft [resource-drop]secret 12 | //go:noescape 13 | func wasmimport_SecretResourceDrop(self0 uint32) 14 | 15 | //go:wasmimport wasmcloud:secrets/store@0.1.0-draft get 16 | //go:noescape 17 | func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[SecretsErrorShape, Secret, SecretsError]) 18 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module go.wasmcloud.dev/component 2 | 3 | go 1.23.0 4 | 5 | require ( 6 | github.com/samber/slog-common v0.17.1 7 | go.bytecodealliance.org v0.4.1 8 | ) 9 | 10 | require ( 11 | github.com/coreos/go-semver v0.3.1 // indirect 12 | github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect 13 | github.com/klauspost/compress v1.17.11 // indirect 14 | github.com/opencontainers/go-digest v1.0.0 // indirect 15 | github.com/regclient/regclient v0.7.2 // indirect 16 | github.com/samber/lo v1.47.0 // indirect 17 | github.com/sirupsen/logrus v1.9.3 // indirect 18 | github.com/ulikunitz/xz v0.5.12 // indirect 19 | github.com/urfave/cli/v3 v3.0.0-beta1 // indirect 20 | golang.org/x/mod v0.22.0 // indirect 21 | golang.org/x/sys v0.28.0 // indirect 22 | golang.org/x/text v0.18.0 // indirect 23 | ) 24 | -------------------------------------------------------------------------------- /sdk.go: -------------------------------------------------------------------------------- 1 | package component 2 | 3 | //go:generate go run go.bytecodealliance.org/cmd/wit-bindgen-go generate --world sdk --out gen ./wit 4 | 5 | import ( 6 | "embed" 7 | ) 8 | 9 | //go:embed wit/* 10 | var Wit embed.FS 11 | -------------------------------------------------------------------------------- /tools.go: -------------------------------------------------------------------------------- 1 | //go:build tools 2 | 3 | package main 4 | 5 | import ( 6 | _ "go.bytecodealliance.org/cmd/wit-bindgen-go" 7 | ) 8 | -------------------------------------------------------------------------------- /wasmcloud/config.go: -------------------------------------------------------------------------------- 1 | package wasmcloud 2 | 3 | import "go.wasmcloud.dev/component/gen/wasi/config/runtime" 4 | 5 | // GetConfigOrDefault tries to get a configuration value by provided key using 6 | // [wasi:config/store.get] and falling back to the provided defaultValue if a 7 | // configuration value by provided key is not found. 8 | // 9 | // [wasi:config/store.get]: https://github.com/WebAssembly/wasi-runtime-config/blob/f4d699bc6dd77adad99fa1a2246d482225ec6485/wit/store.wit#L17-L24 10 | func GetConfigOrDefault(key string, defaultValue string) string { 11 | res := runtime.Get(key) 12 | if res.IsOK() { 13 | opt := *res.OK() 14 | if !opt.None() { 15 | return *opt.Some() 16 | } 17 | } 18 | 19 | return defaultValue 20 | } 21 | -------------------------------------------------------------------------------- /wasmcloud/link.go: -------------------------------------------------------------------------------- 1 | package wasmcloud 2 | 3 | import "go.wasmcloud.dev/component/gen/wasmcloud/bus/lattice" 4 | 5 | const DefaultLinkName = "default" 6 | 7 | type CallTargetInterface = lattice.CallTargetInterface 8 | 9 | var ( 10 | NewCallTargetInterface = lattice.NewCallTargetInterface 11 | SetLinkName = lattice.SetLinkName 12 | ) 13 | -------------------------------------------------------------------------------- /wasmcloud/secret.go: -------------------------------------------------------------------------------- 1 | package wasmcloud 2 | 3 | import ( 4 | "fmt" 5 | 6 | "go.wasmcloud.dev/component/gen/wasmcloud/secrets/reveal" 7 | "go.wasmcloud.dev/component/gen/wasmcloud/secrets/store" 8 | ) 9 | 10 | // SecretGetAndReveal attempts to access a secret identified by the provided key 11 | // and reveal it, returning the stored value as a slice of bytes. 12 | func SecretGetAndReveal(key string) ([]byte, error) { 13 | res := store.Get(key) 14 | if res.IsErr() { 15 | return nil, fmt.Errorf("%v", res.Err()) 16 | } 17 | 18 | opaqueSecret := *res.OK() 19 | defer opaqueSecret.ResourceDrop() 20 | 21 | revealed := reveal.Reveal(opaqueSecret) 22 | if s := revealed.String_(); s != nil { 23 | return []byte(*s), nil 24 | } 25 | 26 | return revealed.Bytes().Slice(), nil 27 | } 28 | -------------------------------------------------------------------------------- /wit/deps/wasi-clocks-0.2.0/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:clocks@0.2.0; 2 | 3 | interface monotonic-clock { 4 | use wasi:io/poll@0.2.0.{pollable}; 5 | 6 | type instant = u64; 7 | 8 | type duration = u64; 9 | 10 | now: func() -> instant; 11 | 12 | resolution: func() -> duration; 13 | 14 | subscribe-instant: func(when: instant) -> pollable; 15 | 16 | subscribe-duration: func(when: duration) -> pollable; 17 | } 18 | 19 | interface wall-clock { 20 | record datetime { 21 | seconds: u64, 22 | nanoseconds: u32, 23 | } 24 | 25 | now: func() -> datetime; 26 | 27 | resolution: func() -> datetime; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /wit/deps/wasi-random-0.2.0/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:random@0.2.0; 2 | 3 | interface random { 4 | get-random-bytes: func(len: u64) -> list; 5 | 6 | get-random-u64: func() -> u64; 7 | } 8 | 9 | interface insecure { 10 | get-insecure-random-bytes: func(len: u64) -> list; 11 | 12 | get-insecure-random-u64: func() -> u64; 13 | } 14 | 15 | interface insecure-seed { 16 | insecure-seed: func() -> tuple; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /wit/deps/wasmcloud-bus-1.0.0/package.wit: -------------------------------------------------------------------------------- 1 | package wasmcloud:bus@1.0.0; 2 | 3 | interface lattice { 4 | /// Interface target. This represents an interface, which can be selected by `set-link-name`. 5 | resource call-target-interface { 6 | constructor(namespace: string, %package: string, %interface: string); 7 | } 8 | 9 | /// Set an optional link name to use for all interfaces specified. This is advanced 10 | /// functionality only available within wasmcloud and, as such, is exposed here as part of the 11 | /// wasmcloud:bus package. This is used when you are linking multiple of the same interfaces 12 | /// (i.e. a keyvalue implementation for caching and another one for secrets) to a component 13 | set-link-name: func(name: string, interfaces: list); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /wit/world.wit: -------------------------------------------------------------------------------- 1 | package wasmcloud:component-go@0.1.0; 2 | 3 | world exports { 4 | // wasi 5 | export wasi:http/incoming-handler@0.2.0; 6 | } 7 | 8 | world imports { 9 | // tinygo 10 | include wasi:cli/imports@0.2.0; 11 | 12 | // wasi 13 | import wasi:logging/logging@0.1.0-draft; 14 | import wasi:config/runtime@0.2.0-draft; 15 | import wasi:http/outgoing-handler@0.2.0; 16 | 17 | // wasmcloud 18 | import wasmcloud:bus/lattice@1.0.0; 19 | import wasmcloud:secrets/store@0.1.0-draft; 20 | import wasmcloud:secrets/reveal@0.1.0-draft; 21 | } 22 | 23 | world sdk { 24 | include exports; 25 | include imports; 26 | } 27 | -------------------------------------------------------------------------------- /x/wasitel/README.md: -------------------------------------------------------------------------------- 1 | # OpenTelemetry Exporter for WebAssembly Components 2 | 3 | > [!IMPORTANT] 4 | > This requires TinyGo `0.35.0` (current `dev` branch) in order to compile. 5 | 6 | `wasitel` provides a `wasi:http`-based OpenTelemetry Go exporter implementation. 7 | 8 | ## Examples: 9 | 10 | To be added. 11 | 12 | ### Acknowledgements 13 | 14 | The `wasiteltrace/internal/convert` code has been adapted from [`opentelemetry-go`](https://github.com/open-telemetry/opentelemetry-go)'s internal packages, please see the code itself for the upstream soure references. 15 | 16 | The `wasiteltrace/internal/types` code has been adapted from [`opentelemetry-proto-go`](https://github.com/open-telemetry/opentelemetry-proto-go)'s generated protobufs, please see the code itself for the upstream source references. -------------------------------------------------------------------------------- /x/wasitel/go.mod: -------------------------------------------------------------------------------- 1 | module go.wasmcloud.dev/component/x/wasitel 2 | 3 | go 1.23.2 4 | 5 | require ( 6 | go.opentelemetry.io/otel v1.32.0 7 | go.opentelemetry.io/otel/log v0.8.0 8 | go.opentelemetry.io/otel/sdk v1.32.0 9 | go.opentelemetry.io/otel/sdk/log v0.8.0 10 | go.opentelemetry.io/otel/sdk/metric v1.32.0 11 | go.opentelemetry.io/otel/trace v1.32.0 12 | go.wasmcloud.dev/component v0.0.5 13 | ) 14 | 15 | require ( 16 | github.com/go-logr/logr v1.4.2 // indirect 17 | github.com/go-logr/stdr v1.2.2 // indirect 18 | github.com/google/uuid v1.6.0 // indirect 19 | go.bytecodealliance.org v0.4.0 // indirect 20 | go.opentelemetry.io/otel/metric v1.32.0 // indirect 21 | golang.org/x/sys v0.27.0 // indirect 22 | ) 23 | 24 | replace go.wasmcloud.dev/component => ../../ 25 | -------------------------------------------------------------------------------- /x/wasitel/wasitellog/internal/types/context.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "go.opentelemetry.io/otel/trace" 7 | ) 8 | 9 | type TraceID []byte 10 | 11 | func NewTraceID(tid trace.TraceID) *TraceID { 12 | id := TraceID(tid.String()) 13 | return &id 14 | } 15 | 16 | func (tid *TraceID) MarshalJSON() ([]byte, error) { 17 | return json.Marshal(string(*tid)) 18 | } 19 | 20 | func NewSpanID(sid trace.SpanID) *SpanID { 21 | id := SpanID(sid.String()) 22 | return &id 23 | } 24 | 25 | type SpanID []byte 26 | 27 | func (sid *SpanID) MarshalJSON() ([]byte, error) { 28 | return json.Marshal(string(*sid)) 29 | } 30 | -------------------------------------------------------------------------------- /x/wasitel/wasitellog/internal/types/logs_service.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | type ExportLogsServiceRequest struct { 4 | // An array of ResourceLogs. 5 | // For data coming from a single resource this array will typically contain one 6 | // element. Intermediary nodes (such as OpenTelemetry Collector) that receive 7 | // data from multiple origins typically batch the data before forwarding further and 8 | // in that case this array will contain multiple elements. 9 | ResourceLogs []*ResourceLogs `json:"resource_logs,omitempty"` 10 | } 11 | -------------------------------------------------------------------------------- /x/wasitel/wasitellog/internal/types/resource.go: -------------------------------------------------------------------------------- 1 | // Original source: https://github.com/open-telemetry/opentelemetry-proto-go/blob/v1.3.1/slim/otlp/resource/v1/resource.pb.go 2 | package types 3 | 4 | // Resource information. 5 | type Resource struct { 6 | // Set of attributes that describe the resource. 7 | // Attribute keys MUST be unique (it is not allowed to have more than one 8 | // attribute with the same key). 9 | Attributes []*KeyValue `json:"attributes,omitempty"` 10 | // dropped_attributes_count is the number of dropped attributes. If the value is 0, then 11 | // no attributes were dropped. 12 | DroppedAttributesCount uint32 `json:"dropped_attributes_count,omitempty"` 13 | } 14 | -------------------------------------------------------------------------------- /x/wasitel/wasitelmetric/internal/convert/metrics.go: -------------------------------------------------------------------------------- 1 | package convert 2 | 3 | import ( 4 | "go.opentelemetry.io/otel/sdk/metric/metricdata" 5 | "go.wasmcloud.dev/component/x/wasitel/wasitelmetric/internal/types" 6 | ) 7 | 8 | func ResourceMetrics(data *metricdata.ResourceMetrics) (*types.ResourceMetrics, error) { 9 | return nil, nil 10 | } 11 | -------------------------------------------------------------------------------- /x/wasitel/wasitelmetric/internal/types/context.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "go.opentelemetry.io/otel/trace" 7 | ) 8 | 9 | type TraceID []byte 10 | 11 | func NewTraceID(tid trace.TraceID) *TraceID { 12 | id := TraceID(tid.String()) 13 | return &id 14 | } 15 | 16 | func (tid *TraceID) MarshalJSON() ([]byte, error) { 17 | return json.Marshal(string(*tid)) 18 | } 19 | 20 | func NewSpanID(sid trace.SpanID) *SpanID { 21 | id := SpanID(sid.String()) 22 | return &id 23 | } 24 | 25 | type SpanID []byte 26 | 27 | func (sid *SpanID) MarshalJSON() ([]byte, error) { 28 | return json.Marshal(string(*sid)) 29 | } 30 | -------------------------------------------------------------------------------- /x/wasitel/wasitelmetric/internal/types/metrics_service.go: -------------------------------------------------------------------------------- 1 | // Original source: https://github.com/open-telemetry/opentelemetry-proto-go/blob/v1.3.1/slim/otlp/collector/metrics/v1/metrics_service.pb.go 2 | package types 3 | 4 | type ExportMetricsServiceRequest struct { 5 | // An array of ResourceMetrics. 6 | // For data coming from a single resource this array will typically contain one 7 | // element. Intermediary nodes (such as OpenTelemetry Collector) that receive 8 | // data from multiple origins typically batch the data before forwarding further and 9 | // in that case this array will contain multiple elements. 10 | ResourceMetrics []*ResourceMetrics `json:"resource_metrics,omitempty"` 11 | } 12 | -------------------------------------------------------------------------------- /x/wasitel/wasitelmetric/internal/types/resource.go: -------------------------------------------------------------------------------- 1 | // Original source: https://github.com/open-telemetry/opentelemetry-proto-go/blob/v1.3.1/slim/otlp/resource/v1/resource.pb.go 2 | package types 3 | 4 | // Resource information. 5 | type Resource struct { 6 | // Set of attributes that describe the resource. 7 | // Attribute keys MUST be unique (it is not allowed to have more than one 8 | // attribute with the same key). 9 | Attributes []*KeyValue `json:"attributes,omitempty"` 10 | // dropped_attributes_count is the number of dropped attributes. If the value is 0, then 11 | // no attributes were dropped. 12 | DroppedAttributesCount uint32 `json:"dropped_attributes_count,omitempty"` 13 | } 14 | -------------------------------------------------------------------------------- /x/wasitel/wasiteltrace/internal/convert/instrumentation.go: -------------------------------------------------------------------------------- 1 | // Original source: https://github.com/open-telemetry/opentelemetry-go/blob/v1.31.0/exporters/otlp/otlptrace/internal/tracetransform/instrumentation.go 2 | package convert 3 | 4 | import ( 5 | "go.opentelemetry.io/otel/sdk/instrumentation" 6 | 7 | "go.wasmcloud.dev/component/x/wasitel/wasiteltrace/internal/types" 8 | ) 9 | 10 | func convertInstrumentationScope(il instrumentation.Scope) *types.InstrumentationScope { 11 | if il == (instrumentation.Scope{}) { 12 | return nil 13 | } 14 | return &types.InstrumentationScope{ 15 | Name: il.Name, 16 | Version: il.Version, 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /x/wasitel/wasiteltrace/internal/convert/resource.go: -------------------------------------------------------------------------------- 1 | // Original source: https://github.com/open-telemetry/opentelemetry-go/blob/v1.31.0/exporters/otlp/otlptrace/internal/tracetransform/resource.go 2 | package convert 3 | 4 | import ( 5 | "go.opentelemetry.io/otel/sdk/resource" 6 | 7 | "go.wasmcloud.dev/component/x/wasitel/wasiteltrace/internal/types" 8 | ) 9 | 10 | // Resource transforms a Resource into an OTLP Resource. 11 | func Resource(r *resource.Resource) *types.Resource { 12 | if r == nil { 13 | return nil 14 | } 15 | return &types.Resource{Attributes: ResourceAttributes(r)} 16 | } 17 | -------------------------------------------------------------------------------- /x/wasitel/wasiteltrace/internal/types/context.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "go.opentelemetry.io/otel/trace" 7 | ) 8 | 9 | type TraceID []byte 10 | 11 | func NewTraceID(tid trace.TraceID) *TraceID { 12 | id := TraceID(tid.String()) 13 | return &id 14 | } 15 | 16 | func (tid *TraceID) MarshalJSON() ([]byte, error) { 17 | return json.Marshal(string(*tid)) 18 | } 19 | 20 | func NewSpanID(sid trace.SpanID) *SpanID { 21 | id := SpanID(sid.String()) 22 | return &id 23 | } 24 | 25 | type SpanID []byte 26 | 27 | func (sid *SpanID) MarshalJSON() ([]byte, error) { 28 | return json.Marshal(string(*sid)) 29 | } 30 | -------------------------------------------------------------------------------- /x/wasitel/wasiteltrace/internal/types/resource.go: -------------------------------------------------------------------------------- 1 | // Original source: https://github.com/open-telemetry/opentelemetry-proto-go/blob/v1.3.1/slim/otlp/resource/v1/resource.pb.go 2 | package types 3 | 4 | // Resource information. 5 | type Resource struct { 6 | // Set of attributes that describe the resource. 7 | // Attribute keys MUST be unique (it is not allowed to have more than one 8 | // attribute with the same key). 9 | Attributes []*KeyValue `json:"attributes,omitempty"` 10 | // dropped_attributes_count is the number of dropped attributes. If the value is 0, then 11 | // no attributes were dropped. 12 | DroppedAttributesCount uint32 `json:"dropped_attributes_count,omitempty"` 13 | } 14 | -------------------------------------------------------------------------------- /x/wasitel/wasiteltrace/internal/types/trace_service.go: -------------------------------------------------------------------------------- 1 | // Original source: https://github.com/open-telemetry/opentelemetry-proto-go/blob/v1.3.1/slim/otlp/collector/trace/v1/trace_service.pb.go 2 | package types 3 | 4 | type ExportTraceServiceRequest struct { 5 | ResourceSpans []*ResourceSpans `json:"resource_spans,omitempty"` 6 | } 7 | --------------------------------------------------------------------------------