genmain

package
v0.0.0-...-28775f4 Latest Latest
Warning

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

Go to latest
Published: May 2, 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

View Source
var (
	// AppName is the name of the generated application.
	AppName string

	// TargetPackage is the name of the generated Go package.
	TargetPackage string

	// Force is true if pre-existing files should be overwritten during generation.
	Force bool
)

Functions

func Generate

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

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

Types

type Command

type Command struct {
	*codegen.BaseCommand
}

Command is the goa application code generator command line data structure. It implements meta.Command.

func NewCommand

func NewCommand() *Command

NewCommand instantiates a new command.

func (*Command) RegisterFlags

func (c *Command) RegisterFlags(r codegen.FlagRegistry)

RegisterFlags registers the command line flags with the given registry.

func (*Command) Run

func (c *Command) Run() ([]string, error)

Run simply calls the meta generator.

type Generator

type Generator struct {
	// 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(api *design.APIDefinition) (_ []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