golang/protobuf
GitHub: golang/protobuf
Google Protocol Buffers 的 Go 语言官方支持库,提供消息序列化、JSON 转换、well-known 类型支持及代码生成插件。
Stars: 10083 | Forks: 1571
## 包索引
本模块提供的包摘要:
* [`proto`](https://pkg.go.dev/github.com/golang/protobuf/proto):包
`proto` 提供了对 protobuf 消息进行操作的功能,例如克隆、
合并和检查相等性,以及二进制序列化和文本
序列化。
* [`jsonpb`](https://pkg.go.dev/github.com/golang/protobuf/jsonpb):包
`jsonpb` 将 protobuf 消息序列化为 JSON。
* [`ptypes`](https://pkg.go.dev/github.com/golang/protobuf/ptypes):包
`ptypes` 为 protobuf well-known 类型提供辅助功能。
* [`ptypes/any`](https://pkg.go.dev/github.com/golang/protobuf/ptypes/any):
`any` 包是为 `google/protobuf/any.proto` 生成的包。
* [`ptypes/empty`](https://pkg.go.dev/github.com/golang/protobuf/ptypes/empty):
`empty` 包是为 `google/protobuf/empty.proto` 生成的包。
* [`ptypes/timestamp`](https://pkg.go.dev/github.com/golang/protobuf/ptypes/timestamp):
`timestamp` 包是为
`google/protobuf/timestamp.proto` 生成的包。
* [`ptypes/duration`](https://pkg.go.dev/github.com/golang/protobuf/ptypes/duration):
`duration` 包是为
`google/protobuf/duration.proto` 生成的包。
* [`ptypes/wrappers`](https://pkg.go.dev/github.com/golang/protobuf/ptypes/wrappers):
`wrappers` 包是为
`google/protobuf/wrappers.proto` 生成的包。
* [`ptypes/struct`](https://pkg.go.dev/github.com/golang/protobuf/ptypes/struct):
`structpb` 包是为
`google/protobuf/struct.proto` 生成的包。
* [`protoc-gen-go/descriptor`](https://pkg.go.dev/github.com/golang/protobuf/protoc-gen-go/descriptor):
`descriptor` 包是为
`google/protobuf/descriptor.proto` 生成的包。
* [`protoc-gen-go/plugin`](https://pkg.go.dev/github.com/golang/protobuf/protoc-gen-go/plugin):
`plugin` 包是为
`google/protobuf/compiler/plugin.proto` 生成的包。
* [`protoc-gen-go`](https://pkg.go.dev/github.com/golang/protobuf/protoc-gen-go):
`protoc-gen-go` 二进制文件是一个 protoc 插件,用于生成 Go protocol
buffer 包。
## 报告问题
本项目的 issue 跟踪器
[位于此处](https://github.com/golang/protobuf/issues)。
请报告任何问题,并提供对 bug 或功能请求的充分描述。Bug 报告最好附带该问题的最小重现。
难以重现的 bug 很难诊断和修复(并且可能会在一段时间后被关闭)。Bug 报告必须指定
[Go protocol buffer 模块](https://github.com/protocolbuffers/protobuf-go/releases)
的版本,以及所使用的
[protocol buffer 工具链](https://github.com/protocolbuffers/protobuf/releases)
的版本。
## 兼容性
本模块和生成的代码预计会保持长期稳定。但是,
我们保留因以下原因在不另行通知的情况下进行破坏性更改的权利:
* **安全性:**规范或实现中可能会出现安全问题,解决这些问题需要破坏兼容性。我们保留解决此类问题的权利。
* **未指定的行为:**protocol buffer 规范中有一些方面是未定义的。依赖于未指定行为的程序可能会在未来版本中失效。
* **规范更改:**有时可能需要解决 protocol buffer 规范中的不一致、不完整或变更,这可能会影响现有程序的行为。我们保留处理此类更改的权利。
* **Bug:**如果某个包存在违反正确性的 bug,则在修复该 bug 时,依赖于该错误行为的程序可能会失效。我们保留修复此类 bug 的权利。
* **生成内容的增加**:我们保留在 `.proto` 文件生成的 Go 包中添加新声明的权利。这包括已声明的常量、
变量、函数、类型、结构体中的字段以及类型上的方法。这可能会破坏在 `protoc-gen-go` 生成代码的基础上尝试注入额外代码的行为。本项目不支持这种做法。
* **内部更改**:我们保留添加、修改和删除
内部代码的权利,这包括所有未导出的声明、
[`generator`](https://pkg.go.dev/github.com/golang/protobuf/protoc-gen-go/generator)
包,以及
[`internal`](https://pkg.go.dev/github.com/golang/protobuf/internal)
下的所有包。
除上述情况之外的任何破坏性更改都将提前 6 个月在
[protobuf@googlegroups.com](https://groups.google.com/forum/#!forum/protobuf) 上公布。
标签:EVTX分析, 日志审计