genmain

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package genmain provides a generator for a skeleton goa application. This generator generates the code for a basic "main" package and is mainly intended as a way to bootstrap new applications. The generator creates a main.go file and one file per resource listed in the API metadata. If a file already exists it skips its creation unless the flag --force is provided on the command line in which case it overrides the content of existing files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate() (files []string, err error)

Generate is the generator entry point called by the meta generator.

Types

type Generator

type Generator struct {
	API       *design.APIDefinition // The API definition
	OutDir    string                // Path to output directory
	DesignPkg string                // Path to design package, only used to mark generated files.
	Target    string                // Name of generated "app" package
	Force     bool                  // Whether to override existing files
	// contains filtered or unexported fields
}

Generator is the application code generator.

func (*Generator) Cleanup

func (g *Generator) Cleanup()

Cleanup removes all the files generated by this generator during the last invokation of Generate.

func (*Generator) Generate

func (g *Generator) Generate() (_ []string, err error)

Generate produces the skeleton main.

Jump to

Keyboard shortcuts

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