PROTOC_ZIP=protoc-3.3.0-osx-x86_64.zip
curl -OL https://github.com/google/protobuf/releases/download/v3.3.0/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
rm -f $PROTOC_ZIP
protoc -I=$SRC_DIR --java_out=$DST_DIR $SRC_DIR/addressbook.proto
e.g.
protoc -I=. --java_out=test test/test.proto`
-
cannot build ts
- go build -> [folder].exe -> rename to protoc-gen-[anything].exe
- protoc --[anything]_out=lang=ts:$DST_DIR $SRC_DIR/protofile
-
The Go code generator does not produce output for services by default:
-
git add remote url:
- create bitbucket repo from side menu
git init
git remote add origin https://[email protected]/yoozoosg/protoapi.git
-
soft link:
ln [-Ffhinsv] source_file [target_file]
ln [-Ffhinsv] source_file ... target_dir
link source_file target_file
link generated protoapi with protoc-gen-ts in $GOBIN
ln -s /Users/zhuqinglei/go/src/protoapi/protoapi protoc-gen-ts
then rebuild go build
-
see hidden file in mac:
shift + command + .
-
how to use vi:
i
: insertesc
: quit insertion:w
: write/save:q
: quit editor:wq
: write and quit:q!
: force quit
- when run
webpack
, you may encounter the issue that even though webpack and webpack-cli are downloaded, the npm could not allocate them and continue to prompt you to download webpack-cli. - to solve this, we need to go to
C:\Users\<User>\AppData\Roaming\npm
, see if webpack.exe is there, then we install webpack-cli from there
-
complex data type support
- support object data type: it is to be declared in the message.proto. Example:
syntax = "proto3"; message HelloRequest { Greeting greeting = 1; } message HelloResponse { string reply = 1; } message Greeting { string greetingMsg = 1; }
-
java package name
- user can declare java package name as options in the service.proto file. and the java classes will be generated in the specific packages. If no java_package_options is declared, files will be generate to the package in proto file.
option java_package = "com.yoozoo.spring";
-
service name options