generator

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommonEntity

func CommonEntity(obj interface{}, templ string, resultPath string) (err error)

CommonEntity generates an entity that is common to all languages.

func Do

func Do(g Abstract, spec *model.Spec, outdir string) (err error)

Do generates code and infrastructure declaration for the given Spec and dumps it in the specified output directory.

func Init

func Init()

Init initializes the generator.

func Service

func Service(g Abstract, svc model.Service, outdir string) (err error)

Service generates all files for a service entity.

Types

type Abstract

type Abstract interface {
	FileExtension() string
	CommandPath() string
	InternalPath() string
	PackagePath() string
	GetTemplate(name string) string
	CodeFormatter(path string) (st SymbolTable, err error)
	GenerateProject(name, path string) (err error)
}

Abstract is the interface for saas-y code & infrastructure generators.

type SymbolTable

type SymbolTable map[string]string

SymbolTable is a map translating original symbol names to symbol names conforming to the naming style of the generated language.

Directories

Path Synopsis
common
go

Jump to

Keyboard shortcuts

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