backend

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 1 Imported by: 17

Documentation

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 langauge 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{})
	Warn      func(v ...interface{})
	MultiWarn func(warns []string)
}

LogFunc .

Jump to

Keyboard shortcuts

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