Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Language is go or typescript. Empty means go.
Language Language `yaml:"language"`
// Package is the Go package name of the generated file. TypeScript output
// has no package and ignores it.
Package string `yaml:"package"`
// Output is the generated file. Empty means asyncapi.gen.go, or
// asyncapi.gen.ts for TypeScript.
Output string `yaml:"output"`
// Generate picks what to generate. Omitted, everything is generated.
Generate *GenerateOptions `yaml:"generate"`
// OutputOptions tunes the generated code.
//nolint:tagliatelle // config keys are kebab-case by design
OutputOptions OutputOptions `yaml:"output-options"`
}
Config is the generator configuration file. The spec path comes from the command line, and paths are relative to the directory the generator runs in.
func LoadConfig ¶
LoadConfig reads and checks the configuration file at path.
type GenerateOptions ¶
type GenerateOptions struct {
// Models generates the schema types, codecs and validation.
Models bool `yaml:"models"`
// Client generates message decoding, the Handler interface, Dispatch and
// the Client. It needs Models.
Client bool `yaml:"client"`
}
GenerateOptions picks the parts of the generated file.
type OutputOptions ¶
type OutputOptions struct {
// MessageMatchers tells incoming messages apart when the spec gives no
// const or discriminator to do it. It maps a message key to JSON pointers
// (RFC 6901) into the payload and the value each must hold.
//nolint:tagliatelle // config keys are kebab-case by design
MessageMatchers map[string]map[string]any `yaml:"message-matchers"`
}
OutputOptions tunes the generated code.
Click to show internal directories.
Click to hide internal directories.