go2proto

command module
v0.0.0-...-c66eaa6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2022 License: MIT Imports: 14 Imported by: 0

README

go2proto

Generate Protobuf messages from given go structs. No RPC, not gogo syntax, just pure Protobuf messages.

Syntax
-f string
    Protobuf output file path. (default ".")
-filter string
    Filter by struct names. Case insensitive.
-p value
    Fully qualified path of packages to analyse. Relative paths ("./example/in") are allowed.
Example

Your package you wish to export must be inside of your working directory. Package paths can be fully-qualified or relative.

GO111MODULE=off go get -u github.com/chenghonour/go2proto
cd ~/go/src/github.com/chenghonour/go2proto
go2proto -f ./example/out -p ./example/in

For Windows use

GO111MODULE=off go get -u github.com/chenghonour/go2proto
cd ~/go/src/github.com/chenghonour/go2proto
build main.go to go2proto.exe
copy go2proto.exe to $gopath/bin
enjoy it like..
go2proto -f ./example/out -p ./example/in
note: -p ./example/in is a Fully qualified path of go module packages, just use it in your go project path
Note

Generated code may not be perfect but since it just 180 lines of code you are free to adapt it for your needs.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
example
in

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL