gen

package
v0.5.2-0...-176e034 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: MIT Imports: 1 Imported by: 0

README

gen - webrpc code-generation for multiple language targets

gen uses a basic templating language, along with the webrpc schema AST (abtract-syntax-tree) to generate source code of the Web service's type system, client library and server handlers.

Supported targets

Adding a new target

Adding a new target is easy, just add a folder under gen/ and copy one of the existing targets and start adapting it for your language. Run make build to re-generate all templates and execute the code-generator via the go:generate in the target package you make.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Generators = map[string]Generator{}

Functions

func Register

func Register(target string, generator Generator)

Types

type Generator

type Generator interface {
	Gen(proto *schema.WebRPCSchema, opts TargetOptions) (string, error)
}

func GetGenerator

func GetGenerator(target string) Generator

type TargetOptions

type TargetOptions struct {
	PkgName   string
	Client    bool
	Server    bool
	Extra     string
	Websocket bool
}

Directories

Path Synopsis
embed
Package contains static assets.
Package contains static assets.
embed
Package contains static assets.
Package contains static assets.
embed
Package contains static assets.
Package contains static assets.

Jump to

Keyboard shortcuts

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