forked from akkagao/go2proto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proto.go
51 lines (46 loc) · 851 Bytes
/
proto.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package main
/*
MicroService 用于存储解析后的文件原信息
*/
type MicroService struct {
PackageName string
Imports []string
ImportTime bool
Service Service
Messages []Message
}
/*
Service 服务信息
*/
type Service struct {
Name string // 服务名称
PackageName string // 包名
ServiceFunctions []ServiceFunction // 方法列表
}
/*
ServiceFunction 接口定义的方法
*/
type ServiceFunction struct {
Name string
ParamType string
ResultType string
Comment string
Stream bool
PingPong bool
}
/*
Message 接口定义的结构体
*/
type Message struct {
Name string
MessageFields []MessageField
}
/*
MessageField 结构体字段属性
*/
type MessageField struct {
Index int
FieldName string
FieldType string
Comment string
}