mirror of
https://github.com/go-micro/go-micro.git
synced 2025-05-25 21:53:14 +02:00
There's really no point in having the `generator` be embedded in a `file` package so we remove the `file` package and make the `generator` package a first class citizen instead.
50 lines
653 B
Go
50 lines
653 B
Go
package generator
|
|
|
|
type Options struct {
|
|
Service string
|
|
Vendor string
|
|
Directory string
|
|
|
|
Client bool
|
|
Jaeger bool
|
|
Skaffold bool
|
|
}
|
|
|
|
type Option func(o *Options)
|
|
|
|
func Service(s string) Option {
|
|
return func(o *Options) {
|
|
o.Service = s
|
|
}
|
|
}
|
|
|
|
func Vendor(v string) Option {
|
|
return func(o *Options) {
|
|
o.Vendor = v
|
|
}
|
|
}
|
|
|
|
func Directory(d string) Option {
|
|
return func(o *Options) {
|
|
o.Directory = d
|
|
}
|
|
}
|
|
|
|
func Client(c bool) Option {
|
|
return func(o *Options) {
|
|
o.Client = c
|
|
}
|
|
}
|
|
|
|
func Jaeger(j bool) Option {
|
|
return func(o *Options) {
|
|
o.Jaeger = j
|
|
}
|
|
}
|
|
|
|
func Skaffold(s bool) Option {
|
|
return func(o *Options) {
|
|
o.Skaffold = s
|
|
}
|
|
}
|