generatorv3

package
v0.40.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

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.

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.

func (Generator) Generate

func (g Generator) Generate() (string, error)

Generate generates the source 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL