Back to godoc.org

Package naming

v0.3.3
Latest Go to latest

The latest major version is .

Published: Jan 20, 2020 | License: MIT | Module: github.com/bilibili/kratos

Index

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
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier