Skip to content

jcbhmr/go-wasi-io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

wasi:io bindings for Go

πŸ“‚ Centralized bindings to wasi:io interfaces

.
└── internal/
    β”œβ”€β”€ octocat/
    β”‚   └── my-app/
    β”‚       └── my-interface/
    β”‚           └── ...
    └── wasi/
        β”œβ”€β”€ io/ πŸ‘ˆ Replaces this folder
        β”‚   β”œβ”€β”€ error/
        β”‚   β”‚   β”œβ”€β”€ empty.s
        β”‚   β”‚   β”œβ”€β”€ error.wasm.go
        β”‚   β”‚   └── error.wit.go
        β”‚   β”œβ”€β”€ poll/
        β”‚   β”‚   β”œβ”€β”€ empty.s
        β”‚   β”‚   β”œβ”€β”€ poll.wasm.go
        β”‚   β”‚   └── poll.wit.go
        β”‚   └── streams/
        β”‚       β”œβ”€β”€ empty.s
        β”‚       β”œβ”€β”€ streams.wasm.go
        β”‚       └── streams.wit.go
        └── ...

βœ‚οΈ Eliminate duplicate code; use a centralized pregenerated bindings package

Installation

Go

go get github.com/jcbhmr/go-wasi-io

⚠️ The latest version is v0.2.7. You probably want v0.2.0. Use @v0.2.0 to select it.

go get github.com/jcbhmr/go-wasi-io@v0.2.0

Usage

Go WebAssembly

//go:generate go tool wit-bindgen-go generate --out ./internal/ ./wit/
//go:generate rm -rf ./internal/wasi/io/
//go:generate go tool jet -g "*.go" "<your-package-root>/internal/wasi/io/" "github.com/jcbhmr/go-wasi-io/" ./internal/
{
    "go.buildTags": "wasip2"
}

Development

Go WebAssembly

About

πŸ“‚ Centralized bindings to wasi:io interfaces

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages