googleapis/go-type-adapters

GitHub: googleapis/go-type-adapters

提供 Google protobuf google.type 消息与 Go 原生类型之间的类型转换辅助函数库。

Stars: 18 | Forks: 6

# Go google.type 适配器 ![ci](https://static.pigsec.cn/wp-content/uploads/repos/cas/74/747dc9e29a6c5f7338e8143dd27903fc1845f1a2619a6eb1688d08448714eef2.svg) ![最新发布](https://img.shields.io/github/v/release/googleapis/go-type-adapters) ![go 版本](https://img.shields.io/github/go-mod/go-version/googleapis/go-type-adapters) 本库提供了辅助函数,用于在 `google.type` 中的 Go proto 消息(如 [genproto][] 中所示)与 Go 原生 类型之间进行转换。 完整文档位于 https://pkg.go.dev/github.com/googleapis/go-type-adapters。 ### 示例 作为一个简单的示例,本库可以在 `google.type.Decimal` ([proto 定义][]、[Go 文档][])和 Go 的 [big.Float][] 之间进行转换: ``` import ( "github.com/googleapis/go-type-adapters/adapters" dpb "google.golang.org/genproto/type/decimal" ) func main() { decimal := &dpb.Decimal{Value: "12345.678"} flt, err := adapters.DecimalToFloat(decimal) if err != nil { panic(err) } // flt is a Go *big.Float and can be used as such... } ``` ## 许可证 本软件基于 [Apache 2.0][] 许可证提供。
标签:EVTX分析, Go, Google APIs, Protobuf, Ruby工具, 开发库, 数据类型转换, 日志审计