st2
provide a package to parse json/protobuf/thrift/go/csv code and generage go/protobuf/thrift code.
st2
provide a terminal command line tool st2
, which can be used to generate go/protobuf/thrift code from json/protobuf/thrift/go/csv code.
You can download the release of st2
from the GitHub releases.
Or you can build it from source code.
go install github.com/tenfyzhong/st2/cmd/st2@latest
NAME:
st2 - convert between json, protobuf, thrift, go struct
USAGE:
st2 [global options] [arguments...]
VERSION:
developing
AUTHOR:
tenfyzhong <[email protected]>
GLOBAL OPTIONS:
common
--root name, -r name The root struct name (default: Root)
input
--input file, -i file Input file, if not set, it will read from stdio
--rc Read input from clipboard (default: false)
--src type, -s type The source data type, it will use the suffix of the input file if not set, available value: `[json,proto,thrift,go,csv]`
output
--dst type, -d type The destination data type, it will use the suffix of the output file if not set, available value: `[go,proto,thrift]`
--output file, -o file Output file, if not set, it will write to stdout
--wc Write output to clipboard (default: false)
COPYRIGHT:
Copyright (c) 2022 tenfy