genhandler

package
v2.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

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

func ApplyDefaultMiddlewares(apply bool) Option

ApplyDefaultMiddlewares toggles application of httpruntime/httpmw.DefaultChain to every generated handler.

func DescPath

func DescPath(path string) Option

DescPath sets path for description and swagger file

func Force

func Force(force bool) Option

Force sets force mode for generation implementation

func Impl

func Impl(impl bool) Option

Impl sets Impl flag option (if true implementation will be generated)

func ImplPath

func ImplPath(path string) Option

ImplPath sets path for implementation file

func ServiceSubDir

func ServiceSubDir(subDir bool) Option

ServiceSubDir sets impl generation into sub directory

func SwaggerDef

func SwaggerDef(swaggerDef map[string][]byte) Option

SwaggerDef sets map of swagger.json per proto file

func SwaggerPath

func SwaggerPath(swaggerPath string) Option

SwaggerPath sets path to store separate swagger files

func WithTests

func WithTests(needTests bool) Option

WithTests sets if it needs for unit tests generation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL