kratos: Index | Files

package naming

import ""


Package Files

go_naming.go naming.go

func GenFileName Uses

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

GenFileName returns the output name for the generated Go file.

func GetGoImportPathForPb Uses

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 Uses

func GetVersionPrefix(pkg string) string

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

func GoFileName Uses

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

GoFileName returns the output name for the generated Go file.

func GoPackageName Uses

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 Uses

func MethodName(method *descriptor.MethodDescriptorProto) string

MethodName ...

func ServiceName Uses

func ServiceName(service *descriptor.ServiceDescriptorProto) string

Package naming imports 8 packages (graph) and is imported by 3 packages. Updated 2020-04-22. Refresh now. Tools for package owners.