go

module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2025 License: MIT

README

wavs-go

WAVS go-lang bindings for components.

Install Wit Bindgen for Go

go install go.bytecodealliance.org/cmd/wit-bindgen-go@ecfa620df5beee882fb7be0740959e5dfce9ae26

wit-bindgen-go --version

System Setup

# https://component-model.bytecodealliance.org/language-support/go.html

# https://tinygo.org/getting-started/install/

# macOS
brew tap tinygo-org/tools
brew install tinygo

# Arch (btw)
sudo pacman -Sy tinygo

# Ubuntu / WSL:
# TODO: .

Generate Bindings

# verify installs
tinygo version
wkg --version

# build the wavs package if you have not already
wkg wit build

# move into the golang directory
cd go/

# generate the Go/ bindings
# if `error: error executing wasm-tools: module closed with exit_code(1)`, set WAVS_PACKAGE
wit-bindgen-go generate -o . ../wavs:worker@0.4.0-beta.4.wasm

go mod tidy

Directories

Path Synopsis
wasi
cli/environment
Package environment represents the imported interface "wasi:cli/environment@0.2.0".
Package environment represents the imported interface "wasi:cli/environment@0.2.0".
cli/exit
Package exit represents the imported interface "wasi:cli/exit@0.2.0".
Package exit represents the imported interface "wasi:cli/exit@0.2.0".
cli/stderr
Package stderr represents the imported interface "wasi:cli/stderr@0.2.0".
Package stderr represents the imported interface "wasi:cli/stderr@0.2.0".
cli/stdin
Package stdin represents the imported interface "wasi:cli/stdin@0.2.0".
Package stdin represents the imported interface "wasi:cli/stdin@0.2.0".
cli/stdout
Package stdout represents the imported interface "wasi:cli/stdout@0.2.0".
Package stdout represents the imported interface "wasi:cli/stdout@0.2.0".
cli/terminal-input
Package terminalinput represents the imported interface "wasi:cli/terminal-input@0.2.0".
Package terminalinput represents the imported interface "wasi:cli/terminal-input@0.2.0".
cli/terminal-output
Package terminaloutput represents the imported interface "wasi:cli/terminal-output@0.2.0".
Package terminaloutput represents the imported interface "wasi:cli/terminal-output@0.2.0".
cli/terminal-stderr
Package terminalstderr represents the imported interface "wasi:cli/terminal-stderr@0.2.0".
Package terminalstderr represents the imported interface "wasi:cli/terminal-stderr@0.2.0".
cli/terminal-stdin
Package terminalstdin represents the imported interface "wasi:cli/terminal-stdin@0.2.0".
Package terminalstdin represents the imported interface "wasi:cli/terminal-stdin@0.2.0".
cli/terminal-stdout
Package terminalstdout represents the imported interface "wasi:cli/terminal-stdout@0.2.0".
Package terminalstdout represents the imported interface "wasi:cli/terminal-stdout@0.2.0".
clocks/monotonic-clock
Package monotonicclock represents the imported interface "wasi:clocks/monotonic-clock@0.2.0".
Package monotonicclock represents the imported interface "wasi:clocks/monotonic-clock@0.2.0".
clocks/wall-clock
Package wallclock represents the imported interface "wasi:clocks/wall-clock@0.2.0".
Package wallclock represents the imported interface "wasi:clocks/wall-clock@0.2.0".
filesystem/preopens
Package preopens represents the imported interface "wasi:filesystem/preopens@0.2.0".
Package preopens represents the imported interface "wasi:filesystem/preopens@0.2.0".
filesystem/types
Package types represents the imported interface "wasi:filesystem/types@0.2.0".
Package types represents the imported interface "wasi:filesystem/types@0.2.0".
http/outgoing-handler
Package outgoinghandler represents the imported interface "wasi:http/outgoing-handler@0.2.0".
Package outgoinghandler represents the imported interface "wasi:http/outgoing-handler@0.2.0".
http/types
Package types represents the imported interface "wasi:http/types@0.2.0".
Package types represents the imported interface "wasi:http/types@0.2.0".
io/error
Package ioerror represents the imported interface "wasi:io/error@0.2.0".
Package ioerror represents the imported interface "wasi:io/error@0.2.0".
io/poll
Package poll represents the imported interface "wasi:io/poll@0.2.0".
Package poll represents the imported interface "wasi:io/poll@0.2.0".
io/streams
Package streams represents the imported interface "wasi:io/streams@0.2.0".
Package streams represents the imported interface "wasi:io/streams@0.2.0".
random/insecure
Package insecure represents the imported interface "wasi:random/insecure@0.2.0".
Package insecure represents the imported interface "wasi:random/insecure@0.2.0".
random/insecure-seed
Package insecureseed represents the imported interface "wasi:random/insecure-seed@0.2.0".
Package insecureseed represents the imported interface "wasi:random/insecure-seed@0.2.0".
random/random
Package random represents the imported interface "wasi:random/random@0.2.0".
Package random represents the imported interface "wasi:random/random@0.2.0".
sockets/instance-network
Package instancenetwork represents the imported interface "wasi:sockets/instance-network@0.2.0".
Package instancenetwork represents the imported interface "wasi:sockets/instance-network@0.2.0".
sockets/ip-name-lookup
Package ipnamelookup represents the imported interface "wasi:sockets/ip-name-lookup@0.2.0".
Package ipnamelookup represents the imported interface "wasi:sockets/ip-name-lookup@0.2.0".
sockets/network
Package network represents the imported interface "wasi:sockets/network@0.2.0".
Package network represents the imported interface "wasi:sockets/network@0.2.0".
sockets/tcp
Package tcp represents the imported interface "wasi:sockets/tcp@0.2.0".
Package tcp represents the imported interface "wasi:sockets/tcp@0.2.0".
sockets/tcp-create-socket
Package tcpcreatesocket represents the imported interface "wasi:sockets/tcp-create-socket@0.2.0".
Package tcpcreatesocket represents the imported interface "wasi:sockets/tcp-create-socket@0.2.0".
sockets/udp
Package udp represents the imported interface "wasi:sockets/udp@0.2.0".
Package udp represents the imported interface "wasi:sockets/udp@0.2.0".
sockets/udp-create-socket
Package udpcreatesocket represents the imported interface "wasi:sockets/udp-create-socket@0.2.0".
Package udpcreatesocket represents the imported interface "wasi:sockets/udp-create-socket@0.2.0".
wavs
worker/layer-trigger-world
Package layertriggerworld represents the world "wavs:worker/layer-trigger-world@0.4.0-beta.4".
Package layertriggerworld represents the world "wavs:worker/layer-trigger-world@0.4.0-beta.4".
worker/layer-trigger-world/host
Package host represents the imported interface "host".
Package host represents the imported interface "host".
worker/layer-types
Package layertypes represents the imported interface "wavs:worker/layer-types@0.4.0-beta.4".
Package layertypes represents the imported interface "wavs:worker/layer-types@0.4.0-beta.4".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL