Documentation
¶
Index ¶
- func FindApiFiles(dir string) ([]string, error)
- func FindExcludeThirdPartyProtoFiles(protoDirPath string) ([]string, error)
- func FindNoRpcServiceExcludeThirdPartyProtoFiles(protoDirPath string) ([]string, error)
- func FindRouteApiFiles(dir string) ([]string, error)
- func FindRpcServiceProtoFiles(protoDirPath string) ([]string, error)
- func GetApiFrameEtcFilename(wd, file, style string) string
- func GetApiFrameMainGoFilename(wd, file, style string) string
- func GetApiServiceName(apiDirName string, files ...string) string
- func GetFrameType() (string, error)
- func GetProtoDescriptorPath(protoPath string) string
- func GetProtoFrameEtcFilename(source, style string) string
- func GetProtoFrameMainGoFilename(source, style string) string
- func GetRpcMethodUrl(method *descriptorpb.MethodDescriptorProto) string
- func IsNeedGenProtoDescriptor(proto *rpcparser.Proto) bool
- func ParseCurrentApiRoutes(filename string) ([]spec.Route, error)
- func ResolveImportPath(currentFile, importPath, apiDir string) string
- func Save(metadata *Metadata) error
- type APIMetadata
- type APIRoute
- type Metadata
- type ProtoMetadata
- type ProtoRPC
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindApiFiles ¶
func FindRouteApiFiles ¶
func GetApiFrameEtcFilename ¶
GetApiFrameEtcFilename goctl/api/gogen/genetc.go
func GetApiFrameMainGoFilename ¶
GetApiFrameMainGoFilename goctl/api/gogen/genmain.go
func GetApiServiceName ¶
func GetFrameType ¶
func GetProtoDescriptorPath ¶
func GetProtoFrameEtcFilename ¶
GetProtoFrameEtcFilename goctl/rpc/generator/genetc.go
func GetProtoFrameMainGoFilename ¶
GetProtoFrameMainGoFilename goctl/rpc/generator/genmain.go
func GetRpcMethodUrl ¶
func GetRpcMethodUrl(method *descriptorpb.MethodDescriptorProto) string
func ParseCurrentApiRoutes ¶
ParseCurrentApiRoutes 只解析当前 api 文件的路由,不处理 import
func ResolveImportPath ¶
ResolveImportPath 解析 import 路径为绝对路径
Types ¶
type APIMetadata ¶
type APIMetadata struct {
Routes []APIRoute `json:"routes"`
}
func CollectFromAPI ¶
func CollectFromAPI(apiSpecMap map[string]*spec.ApiSpec) (*APIMetadata, error)
CollectFromAPI 从 API 文件收集元数据 apiSpecMap: 已解析的 API 文件映射,key 为文件路径
type Metadata ¶
type Metadata struct {
API *APIMetadata `json:"api,omitempty"`
Proto *ProtoMetadata `json:"proto,omitempty"`
}
type ProtoMetadata ¶
type ProtoMetadata struct {
RPCs []ProtoRPC `json:"rpcs"`
}
func CollectFromProto ¶
func CollectFromProto(protoSpecMap map[string]*rpcparser.Proto) (*ProtoMetadata, error)
CollectFromProto 从 Proto 文件收集元数据 protoSpecMap: 已解析的 Proto 文件映射,key 为文件路径
Click to show internal directories.
Click to hide internal directories.