analyze protobuf
Go to file
2023-06-22 01:15:55 +08:00
.gitignore feat: api 2023-03-21 01:08:22 +08:00
example.pb.go feat: support tag 2023-03-22 23:47:36 +08:00
example.proto feat: support tag 2023-03-22 23:47:36 +08:00
go.mod feat: support tag 2023-03-22 23:47:36 +08:00
gobuf_test.go fix: add service and add rpc api 2023-03-21 01:29:21 +08:00
gobuf.go feat: support tag 2023-03-22 23:47:36 +08:00
inject_tag_test.go feat: support tag 2023-03-22 23:47:36 +08:00
inject_tag.go fix 2023-03-23 00:23:17 +08:00
README.md docs: readme 2023-06-22 01:15:55 +08:00
utils.go feat: api 2023-03-21 01:08:22 +08:00

gobuf

一个 protobuf 文件解析工具

用法

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")