Documentation ¶
Index ¶
- func GenFileName(f *descriptor.FileDescriptorProto, suffix string) string
- func GetGoImportPathForPb(protoFilename string, moduleImportPath string, moduleDirName string) (importPath string, err error)
- func GetVersionPrefix(pkg string) string
- func GoFileName(f *descriptor.FileDescriptorProto, suffix string) string
- func GoPackageName(f *descriptor.FileDescriptorProto) (name string, explicit bool)
- func MethodName(method *descriptor.MethodDescriptorProto) string
- func ServiceName(service *descriptor.ServiceDescriptorProto) string
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 ¶
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 ServiceName ¶
func ServiceName(service *descriptor.ServiceDescriptorProto) string
Types ¶
This section is empty.