Documentation ¶
Index ¶
- Constants
- func MustRegisterImplFileNameTemplate(tmpl string)
- func MustRegisterImplTypeNameTemplate(tmpl string)
- type Generator
- type Option
- func ApplyDefaultMiddlewares(apply bool) Option
- func DescPath(path string) Option
- func Force(force bool) Option
- func Impl(impl bool) Option
- func ImplPath(path string) Option
- func PathsType(pathsParamType string) Option
- func ServiceSubDir(subDir bool) Option
- func SwaggerDef(swaggerDef map[string][]byte) Option
- func SwaggerPath(swaggerPath string) Option
- func WithTests(needTests bool) Option
Constants ¶
View Source
const ( PathsParamTypeImport = "import" PathsParamTypeSourceRelative = "source_relative" )
protobuf-v2 has an option to store generated pb near protofile (google.golang.org/protobuf@v1.27.1/compiler/protogen/protogen.go:432).
Variables ¶
This section is empty.
Functions ¶
func MustRegisterImplFileNameTemplate ¶
func MustRegisterImplFileNameTemplate(tmpl string)
func MustRegisterImplTypeNameTemplate ¶
func MustRegisterImplTypeNameTemplate(tmpl string)
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func New ¶
func New(reg *descriptor.Registry, opts ...Option) *Generator
New returns a new generator which generates handler wrappers.
func (*Generator) Generate ¶
func (g *Generator) Generate(targets []*descriptor.File) ([]*plugin.CodeGeneratorResponse_File, error)
type Option ¶
type Option func(*options)
func ApplyDefaultMiddlewares ¶
ApplyDefaultMiddlewares toggles application of httpruntime/httpmw.DefaultChain to every generated handler.
func ServiceSubDir ¶
ServiceSubDir sets impl generation into sub directory
func SwaggerDef ¶
SwaggerDef sets map of swagger.json per proto file
func SwaggerPath ¶
SwaggerPath sets path to store separate swagger files
Click to show internal directories.
Click to hide internal directories.