genbm

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGoPackageName

func GetGoPackageName(file *descriptor.FileDescriptorProto) string

GetGoPackageName last element from proto package name or go_package option

func HasHTTPRuleOptions

func HasHTTPRuleOptions(method *descriptor.MethodDescriptorProto) bool

HasHTTPRuleOptions check method has httprule extension

func New

func New(jsonpb bool) generator.Generator

New blademaster server code generator

func TargetFilePath

func TargetFilePath(file *descriptor.FileDescriptorProto) string

TargetFilePath find target file path

Types

type BMGenerate

type BMGenerate struct {
	// contains filtered or unexported fields
}

BMGenerate generate bm server code

func NewBMGenerate

func NewBMGenerate(packageName string, descs []*BMServerDescriptor, jsonpb bool) *BMGenerate

NewBMGenerate BMGenerate

func (*BMGenerate) Generate

func (b *BMGenerate) Generate(target io.Writer) error

Generate code

func (*BMGenerate) P

func (b *BMGenerate) P(args ...interface{})

P print code

type BMMethodDescriptor

type BMMethodDescriptor struct {
	Name        string
	Method      string
	PathPattern string
	RequestType string
	ReplyType   string
	ProtoMethod *descriptor.MethodDescriptorProto
	HTTPRule    *annotations.HttpRule
}

BMMethodDescriptor descriptor for BM http method

func ParseBMMethod

func ParseBMMethod(method *descriptor.MethodDescriptorProto) (*BMMethodDescriptor, error)

ParseBMMethod parse BMMethodDescriptor form method descriptor proto

type BMServerDescriptor

type BMServerDescriptor struct {
	Name         string
	ProtoService *descriptor.ServiceDescriptorProto
	Methods      []*BMMethodDescriptor
}

BMServerDescriptor descriptor for BM server

func ParseBMServer

func ParseBMServer(service *descriptor.ServiceDescriptorProto) (*BMServerDescriptor, error)

ParseBMServer parse BMServerDescriptor form service descriptor proto

Jump to

Keyboard shortcuts

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