Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionOperations ¶
type ActionOperations struct {
SendCount uint
ReceiveCount uint
Receive map[string]*asyncapi.Operation
Send map[string]*asyncapi.Operation
}
ActionOperations contains operations based on their action.
func NewActionOperations ¶
func NewActionOperations(side generators.Side, spec asyncapi.Specification) ActionOperations
NewActionOperations will create a struct with operations based on their action.
func (ActionOperations) HasMultiMessageReceive ¶ added in v0.63.0
func (ao ActionOperations) HasMultiMessageReceive() bool
HasMultiMessageReceive reports whether at least one receive operation carries more than one message, and therefore needs the multiplexed dispatcher machinery (issue #333).
type ControllerBaseGenerator ¶ added in v0.50.0
type ControllerBaseGenerator struct {
// MultiMessageReceive is true when at least one generated controller side has
// a receive operation carrying several messages, which requires the
// multiplexed dispatcher machinery (issue #333).
MultiMessageReceive bool
}
ControllerBaseGenerator generates the shared controller boilerplate (the internal controller struct and its options) used by both the application and user controllers. It is generated once, only when a controller side is generated, so that the `types` output stays free of controller boilerplate.
func (ControllerBaseGenerator) Generate ¶ added in v0.50.0
func (g ControllerBaseGenerator) Generate() (string, error)
Generate will generate the shared controller base code.
type ControllerGenerator ¶
type ControllerGenerator struct {
Operations ActionOperations
Prefix string
Version string
}
ControllerGenerator is a code generator for controllers that will turn an asyncapi specification into controller golang code.
func NewControllerGenerator ¶
func NewControllerGenerator(side generators.Side, spec asyncapi.Specification) ControllerGenerator
NewControllerGenerator will create a new controller code generator.
func (ControllerGenerator) Generate ¶
func (asg ControllerGenerator) Generate() (string, error)
Generate will generate the controller code.
type Generator ¶
type Generator struct {
Options options.Options
Specification asyncapi.Specification
ModulePath string
ModuleVersion string
}
Generator is the structure that contains information to generate the code from the specification.
type ImportsGenerator ¶
type ImportsGenerator struct {
PackageName string
ModuleVersion string
ModuleName string
CustomImports []string
}
ImportsGenerator is a code generator for imports that will add needed imports to the code, being asyncapi-codegen packages, standard library packages or custom packages.
func (ImportsGenerator) Generate ¶
func (ig ImportsGenerator) Generate() (string, error)
Generate will generate the imports code.
type SubscriberGenerator ¶
type SubscriberGenerator struct {
Operations ActionOperations
Prefix string
}
SubscriberGenerator is a code generator for subscribers that will turn an asyncapi specification into a subscriber golang code.
func NewSubscriberGenerator ¶
func NewSubscriberGenerator(side generators.Side, spec asyncapi.Specification) SubscriberGenerator
NewSubscriberGenerator will create a new subscriber code generator.
func (SubscriberGenerator) Generate ¶
func (asg SubscriberGenerator) Generate() (string, error)
Generate will generate the subscriber code.
type TypesGenerator ¶
type TypesGenerator struct {
asyncapi.Specification
}
TypesGenerator is a code generator for types that will generate all schemas contained in an asyncapi specification to golang structures code.
func (TypesGenerator) Generate ¶
func (tg TypesGenerator) Generate() (string, error)
Generate will create a new types code generator.