json2struct

Crates.iojson2struct
lib.rsjson2struct
version0.1.6
sourcesrc
created_at2020-08-16 03:38:43.12296
updated_at2020-09-12 15:37:33.001658
descriptionJson 2 struct for golang
homepagehttps://github.com/ptechen
repositoryhttps://github.com/ptechen/json2struct.git
max_upload_size
id277119
size36,211
Petechen (ptechen)

documentation

https://github.com/ptechen/json2struct/blob/master/README.md

README

Json 2 Struct for golang and rust.

Version info

Install:

cargo install json2struct

USAGE:

json2struct <SUBCOMMAND>

FLAGS:

-h, --help       Prints help information
-V, --version    Prints version information

SUBCOMMANDS:

go      Json 2 Struct for golang
help    Prints this message or the help of the given subcommand(s)
rust    Json 2 Struct for rust

Json 2 Struct for golang

USAGE:

json2struct go [OPTIONS] <json>

FLAGS:

-h, --help       Prints help information
-V, --version    Prints version information

OPTIONS:

-o <omitempty>          是否添加 omitempty, example: json2struct go '{"test":"test"}' -o false [default: true]
-s <struct-name>        指定结构体名字, example: json2struct go '{"test":"test"}' -s TTTT [default: XXX]

ARGS:

<json>    Input a json string, example: json2struct go '{"test":"test"}'

Json 2 Struct for rust

USAGE:

json2struct rust [OPTIONS] <json>

FLAGS:

-h, --help       Prints help information
-V, --version    Prints version information

OPTIONS:

-c <camel>              是否允许字段为驼峰 camel, example: json2struct rust '{"test":"test"}' -c true [default:
                        false]
-d <derive>             添加 derive, example: json2struct rust '{"test":"test"}' -d '#[derive(Debug)]' [default:
                        #[derive(Debug)]]
-p <public>             是否添加 pub, example: json2struct rust '{"test":"test"}' -p false [default: true]
-s <struct-name>        指定结构体名字, example: json2struct rust '{"test":"test"}' -s TTTT [default: XXX]

ARGS:

<json>    Input a json string, example: json2struct rust '{"test":"test"}'
Commit count: 23

cargo fmt