golang

package
v3.9.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGenerator

func NewGenerator(options map[string]string) generator.LanguageGenerator

NewGenerator creates a new Go LanguageGenerator.

Types

type Generator

type Generator struct {
	*generator.BaseGenerator
	// contains filtered or unexported fields
}

Generator implements the LanguageGenerator interface for Go.

func (*Generator) DefaultOutputDir

func (g *Generator) DefaultOutputDir() string

DefaultOutputDir returns the default output directory for generated files.

func (*Generator) GenerateConstants

func (g *Generator) GenerateConstants(file *os.File, name string) error

GenerateConstants generates any static constants.

func (*Generator) GenerateConstantsContents

func (g *Generator) GenerateConstantsContents(constants []*parser.Constant) error

GenerateConstantsContents generates constants.

func (*Generator) GenerateDependencies

func (g *Generator) GenerateDependencies(dir string) error

GenerateDependencies is a no-op.

func (*Generator) GenerateDocStringComment

func (g *Generator) GenerateDocStringComment(file *os.File) error

GenerateDocStringComment generates the autogenerated notice.

func (*Generator) GenerateEnum

func (g *Generator) GenerateEnum(enum *parser.Enum) error

GenerateEnum generates the given enum.

func (*Generator) GenerateException

func (g *Generator) GenerateException(exception *parser.Struct) error

GenerateException generates the given exception.

func (*Generator) GenerateFile

func (g *Generator) GenerateFile(name, outputDir string, fileType generator.FileType) (*os.File, error)

GenerateFile generates the given FileType.

func (*Generator) GeneratePublisher

func (g *Generator) GeneratePublisher(file *os.File, scope *parser.Scope) error

GeneratePublisher generates the publisher for the given scope.

func (*Generator) GenerateScopeImports

func (g *Generator) GenerateScopeImports(file *os.File, s *parser.Scope) error

GenerateScopeImports generates necessary imports for the given scope.

func (*Generator) GenerateScopePackage

func (g *Generator) GenerateScopePackage(file *os.File, s *parser.Scope) error

GenerateScopePackage generates the package for the given scope.

func (*Generator) GenerateService

func (g *Generator) GenerateService(file *os.File, s *parser.Service) error

GenerateService generates the given service.

func (*Generator) GenerateServiceImports

func (g *Generator) GenerateServiceImports(file *os.File, s *parser.Service) error

GenerateServiceImports generates necessary imports for the given service.

func (*Generator) GenerateServicePackage

func (g *Generator) GenerateServicePackage(file *os.File, s *parser.Service) error

GenerateServicePackage generates the package for the given service.

func (*Generator) GenerateServiceResultArgsImports

func (g *Generator) GenerateServiceResultArgsImports(file *os.File) error

GenerateServiceResultArgsImports generates the necessary imports for service args and result types.

func (*Generator) GenerateStruct

func (g *Generator) GenerateStruct(s *parser.Struct) error

GenerateStruct generates the given struct.

func (*Generator) GenerateSubscriber

func (g *Generator) GenerateSubscriber(file *os.File, scope *parser.Scope) error

GenerateSubscriber generates the subscriber for the given scope.

func (*Generator) GenerateTypeDef

func (g *Generator) GenerateTypeDef(typedef *parser.TypeDef) error

GenerateTypeDef generates the given typedef.

func (*Generator) GenerateTypesImports

func (g *Generator) GenerateTypesImports(file *os.File) error

GenerateTypesImports generates the necessary Go types imports.

func (*Generator) GenerateUnion

func (g *Generator) GenerateUnion(union *parser.Struct) error

GenerateUnion generates the given union.

func (*Generator) GetOutputDir

func (g *Generator) GetOutputDir(dir string) string

GetOutputDir returns the output directory for generated files.

func (*Generator) PostProcess

func (g *Generator) PostProcess(f *os.File) error

PostProcess file runs gofmt and goimports on the given file.

func (*Generator) SetupGenerator

func (g *Generator) SetupGenerator(outputDir string) error

SetupGenerator initializes globals the generator needs, like the types file.

func (*Generator) TeardownGenerator

func (g *Generator) TeardownGenerator() error

TeardownGenerator cleanups globals the generator needs, like the types file.

func (*Generator) UseVendor

func (g *Generator) UseVendor() bool

Jump to

Keyboard shortcuts

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