I find the package, create .proto files from Go: proteus source code
(https://github.com/src-d/proteus)
Proteus/proΚtiΙs/- , .proto , Go.
, Go , , Go .proto, .
protobuf
type User struct {
Model
Username string
}
type Model struct {
ID int
CreatedAt time.Time
}
protobuf.
message User {
int32 id = 1;
google.protobuf.Timestamp created_at = 2;
string username = 3;
}
go get -v gopkg.in/src-d/proteus.v1/...
.
protoc binary installed on your path
go get -u github.com/gogo/protobuf/...
, / protobuf Go, RPC- RPC . .
proteus -f /path/to/protos/folder \
-p my/go/package \
-p my/other/go/package
, .
proteus proto -f /path/to/output/folder \
-p my/go/package \
-p my/other/go/package
--verbose
gRPC .
proteus rpc -p my/go/package \
-p my/other/go/package
. , , , Proteus , . Godoc .