9个不稳定版本 (4个破坏性更新)

0.5.2 2022年1月20日
0.5.1 2021年12月17日
0.4.0 2021年10月27日
0.3.0 2021年9月20日
0.1.0-alpha2019年9月27日

#1807 in 开发工具

29 每月下载量

MIT 许可证

59KB
1.5K SLoC

XDR Codegen

CircleCI

Xdr-codegen 是一个二进制程序,用于将 XDR 语言规范 转换为各种语言的源代码。其目的是为了方便不同语言编写的二进制文件之间 XDR 对象的通信。换句话说,我们接受 .x 文件并将它们转换为适当的 js、go 或 rust 源代码(XDR 的 protoc)。

警告:这个项目是为了帮助我们在短时间内完成开发而创建的。在 xdr-codegen 完全兼容 XDR 语言规范 之前,还有更多工作要做。

用法

我们目前支持三种语言的代码生成:javascript、rust 和 go。生成的代码有以下依赖

# Javascript generation
cargo run test.x --language js # | eslint --stdin
# Rust generation
cargo run test.x --language rust # | rustfmt
# Go generation
cargo run test.x --language go # | gofmt
# Commonjs generation
cargo run test.x --language commonjs # | eslint --stdin

许可证

MIT

依赖项

~7MB
~135K SLoC