Code Generation Based High Speed Data Serialization Tool
npm install -g vstruct
go install github.com/lemon-mint/vstruct/cli/vstruct@latest
git clone https://github.com/lemon-mint/vstruct.git
cd vstruct
go build -o vstruct ./cli/vstruct
https://github.com/lemon-mint/vstruct/releases/latest
bool: bool # true or false
int8: int8 # signed 8-bit integer
int16: int16 # signed 16-bit integer
int32: int32 # signed 32-bit integer
int64: int64 # signed 64-bit integer
uint8: uint8 # unsigned 8-bit integer
uint16: uint16 # unsigned 16-bit integer
uint32: uint32 # unsigned 32-bit integer
uint64: uint64 # unsigned 64-bit integer
float32: float32 # 32-bit floating point (IEEE 754)
float64: float64 # 64-bit floating point (IEEE 754)
bytes: bytes # variable length bytes
string: string # variable length string
enum MyEnum {
one,
two,
three
}
struct MyStruct {
uint8 a;
uint16 b;
uint32 c;
uint64 d;
string e;
MyEnum f;
}
alias UUID = string;
vstruct [options] <lang> <package name> <input file>
-o <output> Output file name (default: <inputfile>.<.go|.py|.dart|.rs>)
-s Prints the generated code to stdout
-v Print version and exit
-h Print help and exit
-l Print license and exit
go: Go
python: Python
dart: Dart
rust: Rust (Experimental)