goa: github.com/goadesign/goa/goagen/gen_controller Index | Files

package gencontroller

import "github.com/goadesign/goa/goagen/gen_controller"

Package gencontroller generates the controller code for a given design resource. This generator is intended for use when resources are added to the design after the initial bootstrapping.

Index

Package Files

doc.go generator.go options.go

func Generate Uses

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

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

type Generator Uses

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.
    AppPkg    string                // Name of generated "app" package
    Force     bool                  // Whether to override existing files
    Regen     bool                  // Whether to regenerate scaffolding in place, retaining controller impls
    Pkg       string                // Name of the generated package
    Resource  string                // Name of the generated file
    // contains filtered or unexported fields
}

Generator is the application code generator.

func NewGenerator Uses

func NewGenerator(options ...Option) *Generator

NewGenerator returns an initialized instance of a JavaScript Client Generator

func (*Generator) Cleanup Uses

func (g *Generator) Cleanup()

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

func (*Generator) Generate Uses

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

Generate produces the skeleton controller service factory.

type Option Uses

type Option func(*Generator)

Option a generator option definition

func API Uses

func API(API *design.APIDefinition) Option

API The API definition

func AppPkg Uses

func AppPkg(pkg string) Option

AppPkg Name of generated "app" package

func DesignPkg Uses

func DesignPkg(designPkg string) Option

DesignPkg Path to design package, only used to mark generated files.

func Force Uses

func Force(force bool) Option

Force Whether to override existing files

func OutDir Uses

func OutDir(outDir string) Option

OutDir Path to output directory

func Pkg Uses

func Pkg(name string) Option

Pkg sets the name of generated package

func Regen Uses

func Regen(regen bool) Option

Regen Whether to regenerate scaffolding while maintaining controller impls

func Resource Uses

func Resource(res string) Option

Resource Name of generated the generated file

Package gencontroller imports 10 packages (graph). Updated 2017-07-01. Refresh now. Tools for package owners.