Documentation ¶
Overview ¶
Package backend defines the Backend interface for generators.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { // The name of this backend. Name() string // Lang returns the target language that this backend supports. Lang() string // Generate generates codes. Generate(req *plugin.Request, log LogFunc) (res *plugin.Response) // Options returns the available options with their descriptions. Options() []plugin.Option // BuiltinPlugins returns a list of built-in plugins of the backend. BuiltinPlugins() []*plugin.Desc // GetPlugin returns a plugin that match the description or nil. GetPlugin(desc *plugin.Desc) plugin.Plugin }
Backend handles the code generation for a language.
type LogFunc ¶
type LogFunc struct { Info func(v ...interface{}) Infof func(fmt string, v ...interface{}) Warn func(v ...interface{}) Warnf func(fmt string, v ...interface{}) MultiWarn func(warns []string) }
LogFunc defines a set of log functions.
func DummyLogFunc ¶ added in v0.1.2
func DummyLogFunc() LogFunc
DummyLogFunc returns a set of log functions that does nothing.
Click to show internal directories.
Click to hide internal directories.