forked from goadesign/goa
/
options.go
52 lines (43 loc) · 954 Bytes
/
options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package genjs
import (
"time"
"github.com/goadesign/goa/design"
)
//Option a generator option definition
type Option func(*Generator)
//API The API definition
func API(API *design.APIDefinition) Option {
return func(g *Generator) {
g.API = API
}
}
//OutDir Path to output directory
func OutDir(outDir string) Option {
return func(g *Generator) {
g.OutDir = outDir
}
}
//Timeout Timeout used by JavaScript client when making requests
func Timeout(timeout time.Duration) Option {
return func(g *Generator) {
g.Timeout = timeout
}
}
//Scheme Scheme used by JavaScript client
func Scheme(scheme string) Option {
return func(g *Generator) {
g.Scheme = scheme
}
}
//Host addressed by JavaScript client
func Host(host string) Option {
return func(g *Generator) {
g.Host = host
}
}
//NoExample Do not generate an HTML example file
func NoExample(noExample bool) Option {
return func(g *Generator) {
g.NoExample = noExample
}
}