github.com/brycereitano/goa@v0.0.0-20170315073847-8ffa6c85e265/goagen/gen_swagger/options.go (about)

     1  package genswagger
     2  
     3  import "github.com/goadesign/goa/design"
     4  
     5  //Option a generator option definition
     6  type Option func(*Generator)
     7  
     8  //API The API definition
     9  func API(API *design.APIDefinition) Option {
    10  	return func(g *Generator) {
    11  		g.API = API
    12  	}
    13  }
    14  
    15  //OutDir Path to output directory
    16  func OutDir(outDir string) Option {
    17  	return func(g *Generator) {
    18  		g.OutDir = outDir
    19  	}
    20  }