proto

package
v0.0.0-...-ee07ed5 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lcfirst

func Lcfirst(str string) string

Lcfirst 首字母小写

func Struct2Proto

func Struct2Proto(filePath string)

Struct2Proto go run . -f .\proto\src.go

Types

type Message

type Message struct {
	Name          string
	MessageFields []MessageField
}

Message 接口定义的结构体

type MessageField

type MessageField struct {
	Index     int
	FieldName string
	FieldType string
	Comment   template.HTML
	Doc       string
}

MessageField 结构体字段属性

type MicroService

type MicroService struct {
	PackageName string
	Imports     []string
	ImportTime  bool
	Service     Service
	Messages    []Message
}

MicroService 用于存储解析后的文件原信息

type Service

type Service struct {
	Name             string            // 服务名称
	PackageName      string            // 包名
	ServiceFunctions []ServiceFunction // 方法列表
}

Service 服务信息

type ServiceFunction

type ServiceFunction struct {
	Name       string
	ParamType  string
	ResultType string
	Comment    string
	Stream     bool
	PingPong   bool
}

ServiceFunction 接口定义的方法

Jump to

Keyboard shortcuts

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