generator

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

README

Remoto generators

Remoto uses Plush templates to generate code.

Built in functions

As well as the Plush built-in helpers, Remoto also provides:

  • unique_structures(definition) - Get a list of all structures in the entire definition

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTemplateHelpers

func AddTemplateHelpers(s Setter)

AddTemplateHelpers adds all the built-in template helpers.

func Default

func Default() types.Importer

Default returns an importer that will try to import code from gopath before using go/importer.Default and skipping test files

func DefaultWithTestFiles

func DefaultWithTestFiles() types.Importer

DefaultWithTestFiles same as Default but it parses test files too

func Parse

func Parse(r io.Reader) (definition.Definition, error)

Parse parses a Remoto definition file from the io.Reader.

func ParseDir

func ParseDir(dir string) (definition.Definition, error)

ParseDir parses a package of .remoto.go files.

func Render

func Render(w io.Writer, templateName, tpl string, def definition.Definition) error

Render renders the tpl template with the Definition into w.

Types

type Setter

type Setter interface {
	Set(name string, value interface{})
}

Setter may have data set on it, usually a plush context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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