Documentation ¶
Overview ¶
Package bindgen generates Go source code from a fully-resolved WIT package. It generates one or more Go packages, with functions, types, constants, and variables, along with the associated code to lift and lower Go types into Canonical ABI representation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ExportedSegments = map[string]string{
"datetime": "DateTime",
"filesize": "FileSize",
"ipv4": "IPv4",
"ipv6": "IPv6",
"readlink": "ReadLink",
}
ExportedSegments maps common WASI identifier segments to opinionated exported Go equivalents.
var Segments = map[string]string{
"datetime": "dateTime",
"filesize": "fileSize",
"readlink": "readLink",
}
Segments maps common WASI identifier segments to opinionated non-exported Go equivalents.
Functions ¶
func FlatName ¶
FlatName returns a flat equivalent of a WIT name, where the segments are joined together with no delimiter. It may conflict with a Go keyword or predeclared identifier.
func Go ¶
Go generates one or more Go packages from wit.Resolve res. It returns any error that occurs during code generation.
func GoPackageName ¶
GoPackageName generates a Go local package name (e.g. "json").
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option represents a single configuration option for this package.
func CMPackage ¶
CMPackage returns an Option that specifies the package path to the Component Model utility package (default: github.com/bytecodealliance/wasm-tools-go/cm).
func GeneratedBy ¶
GeneratedBy returns an Option that specifies the name of the program or package that will appear in the "Code generated by ..." header on generated files.
func Logger ¶ added in v0.3.1
Logger returns an Option that specifies a logging.Logger for logging.
func PackageRoot ¶
PackageRoot returns an Option that specifies the root Go package path for generated Go packages.