desc

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindApiFiles

func FindApiFiles(dir string) ([]string, error)

func FindExcludeThirdPartyProtoFiles

func FindExcludeThirdPartyProtoFiles(protoDirPath string) ([]string, error)

func FindNoRpcServiceExcludeThirdPartyProtoFiles

func FindNoRpcServiceExcludeThirdPartyProtoFiles(protoDirPath string) ([]string, error)

func FindRouteApiFiles

func FindRouteApiFiles(dir string) ([]string, error)

func FindRpcServiceProtoFiles

func FindRpcServiceProtoFiles(protoDirPath string) ([]string, error)

func GetApiFrameEtcFilename

func GetApiFrameEtcFilename(wd, file, style string) string

GetApiFrameEtcFilename goctl/api/gogen/genetc.go

func GetApiFrameMainGoFilename

func GetApiFrameMainGoFilename(wd, file, style string) string

GetApiFrameMainGoFilename goctl/api/gogen/genmain.go

func GetApiServiceName

func GetApiServiceName(apiDirName string, files ...string) string

func GetFrameType

func GetFrameType() (string, error)

func GetProtoDescriptorPath

func GetProtoDescriptorPath(protoPath string) string

func GetProtoFrameEtcFilename

func GetProtoFrameEtcFilename(source, style string) string

GetProtoFrameEtcFilename goctl/rpc/generator/genetc.go

func GetProtoFrameMainGoFilename

func GetProtoFrameMainGoFilename(source, style string) string

GetProtoFrameMainGoFilename goctl/rpc/generator/genmain.go

func GetRpcMethodUrl

func GetRpcMethodUrl(method *descriptorpb.MethodDescriptorProto) string

func IsNeedGenProtoDescriptor

func IsNeedGenProtoDescriptor(proto *rpcparser.Proto) bool

func ParseCurrentApiRoutes

func ParseCurrentApiRoutes(filename string) ([]spec.Route, error)

ParseCurrentApiRoutes 只解析当前 api 文件的路由,不处理 import

func ResolveImportPath

func ResolveImportPath(currentFile, importPath, apiDir string) string

ResolveImportPath 解析 import 路径为绝对路径

func Save

func Save(metadata *Metadata) error

Save 保存元数据到文件

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 APIRoute

type APIRoute struct {
	Handler  string `json:"handler"`
	Group    string `json:"group"`
	Path     string `json:"path"`
	Logic    string `json:"logic"`
	Desc     string `json:"desc"`
	DescLine int    `json:"desc-line"`
}

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 为文件路径

type ProtoRPC

type ProtoRPC struct {
	RPC      string `json:"rpc"`
	Service  string `json:"service"`
	Path     string `json:"path"`
	Logic    string `json:"logic"`
	Desc     string `json:"desc"`
	DescLine int    `json:"desc-line"`
}

Jump to

Keyboard shortcuts

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