Documentation
¶
Overview ¶
Package generator turns WIT contracts into Go bindings.
Index ¶
- Constants
- func Generate(config Config) error
- func Render(file *ir.File, packageName string) ([]byte, error)
- func RenderWithOptions(file *ir.File, packageName string, options RenderOptions) ([]byte, error)
- type Config
- type Generator
- type GoErrorMapping
- type GoOverlay
- type GoTypeMapping
- type InputMode
- type RenderOptions
Constants ¶
View Source
const DefaultFilename = "bindings.gen.go"
Variables ¶
This section is empty.
Functions ¶
func RenderWithOptions ¶
Types ¶
type GoErrorMapping ¶
type GoErrorMapping struct {
ResultError bool `yaml:"result_error"`
}
GoErrorMapping maps a WIT result return to idiomatic Go error returns.
type GoOverlay ¶
type GoOverlay struct {
Version int `yaml:"version"`
Types map[string]GoTypeMapping `yaml:"types"`
Errors map[string]GoErrorMapping `yaml:"errors"`
// contains filtered or unexported fields
}
GoOverlay describes optional public Go representations over canonical WIT wire types. It is resolved and validated before rendering.
type GoTypeMapping ¶
type GoTypeMapping struct {
GoType string `yaml:"go_type"`
Import string `yaml:"import"`
Codec string `yaml:"codec"`
}
GoTypeMapping maps one canonical WIT alias to a public Go type.
type RenderOptions ¶
Click to show internal directories.
Click to hide internal directories.