docs: readme
This commit is contained in:
parent
6cd8ff2fe4
commit
3a78ab4710
28
README.md
Normal file
28
README.md
Normal file
@ -0,0 +1,28 @@
|
||||
## gobuf
|
||||
|
||||
一个 protobuf 文件解析工具
|
||||
|
||||
## 用法
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import "gitter.top/coco/gobuf"
|
||||
|
||||
func
|
||||
func main() {
|
||||
parser, err := NewParser("example.proto")
|
||||
if err != nil {
|
||||
// do something
|
||||
}
|
||||
// 是否存在Service User
|
||||
parser.ExistService("User")
|
||||
// 是否存在Message UserAddResp
|
||||
parser.ExistMessage("UserAddResp")
|
||||
// 是否存在RPC User.Add
|
||||
parser.ExistRPC("User", "Add")
|
||||
// 添加一个RPC Update
|
||||
parser.AddRPC("User", "Update")
|
||||
// 添加一个Service Member
|
||||
parser.AddService("Member")
|
||||
```
|
Loading…
Reference in New Issue
Block a user