naming

package
v0.6.25 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenFileName

func GenFileName(f *descriptor.FileDescriptorProto, suffix string) string

GenFileName returns the output name for the generated Go file.

func GetGoImportPathForPb

func GetGoImportPathForPb(protoFilename string, moduleImportPath string, moduleDirName string) (importPath string, err error)

GetGoImportPathForPb 得到 proto 文件对应的 go import路径 protoFilename is the proto file name 可能根本无法得到proto文件的具体路径, 只能假设 proto 的filename 是相对当前目录的 假设 protoAbsolutePath = wd/protoFilename

func GetVersionPrefix

func GetVersionPrefix(pkg string) string

GetVersionPrefix 根据go包名获取api版本前缀 @param pkg 从proto获取到的对应的go报名 @return 如果是v*开始的 返回v* 否则返回空

func GoFileName

func GoFileName(f *descriptor.FileDescriptorProto, suffix string) string

GoFileName returns the output name for the generated Go file.

func GoPackageName

func GoPackageName(f *descriptor.FileDescriptorProto) (name string, explicit bool)

GoPackageNameForProtoFile returns the Go package name to use in the generated Go file. The result explicitly reports whether the name came from an option go_package statement. If explicit is false, the name was derived from the protocol buffer's package statement or the input file name.

func MethodName

func MethodName(method *descriptor.MethodDescriptorProto) string

MethodName ...

func ServiceName

func ServiceName(service *descriptor.ServiceDescriptorProto) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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