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 Side, spec asyncapi.Specification) ActionOperations
NewActionOperations will create a struct with operations based on their action.
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 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 Side ¶
type Side string
Side represents the side of the code generation based on asyncapi documentation, i.e in front (user) or behind (application) asyncapi specification.
const ( // SideIsApplication is the application side based on asyncapi documentation, // i.e. the side that stand behind of the asyncapi specification. SideIsApplication Side = "app" // SideIsUser is the user side based on asyncapi documentation, // i.e. the side that use the asyncapi specification. SideIsUser Side = "user" )
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 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.