-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1805 from CosmWasm/go-codegen
Code Generator for Go Types
- Loading branch information
Showing
25 changed files
with
1,485 additions
and
20 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "go-gen" | ||
authors = ["Christoph Otter <[email protected]>"] | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
schemars = "0.8.3" | ||
cosmwasm-std = { path = "../std", version = "1.3.1", features = ["cosmwasm_1_3", "staking", "stargate", "ibc3"] } | ||
cosmwasm-schema = { path = "../schema", version = "1.3.1" } | ||
anyhow = "1" | ||
Inflector = "0.11.4" | ||
indenter = "0.3.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# JsonSchema Go Type Generator | ||
|
||
This is an internal utility to generate Go types from `cosmwasm-std`'s query | ||
response types. These types can then be used in | ||
[wasmvm](https://github.com/CosmWasm/wasmvm). | ||
|
||
## Usage | ||
|
||
Adjust the query / response type you want to generate in `src/main.rs` and run: | ||
`cargo run -p go-gen` | ||
|
||
## Limitations | ||
|
||
Only basic structs and enums are supported. Tuples and enum variants with 0 or | ||
more than 1 parameters don't work, for example. | ||
|
||
## License | ||
|
||
This package is part of the cosmwasm repository, licensed under the Apache | ||
License 2.0 (see [NOTICE](https://github.com/CosmWasm/cosmwasm/blob/main/NOTICE) | ||
and [LICENSE](https://github.com/CosmWasm/cosmwasm/blob/main/LICENSE)). |
Oops, something went wrong.