commit | 6ea97f8480951a5f3af8e00d17cdec30c11ce738 | [log] [tgz] |
---|---|---|
author | William Kurkian <wkurkian@cisco.com> | Wed Mar 13 15:51:55 2019 -0400 |
committer | William Kurkian <wkurkian@cisco.com> | Mon Mar 18 05:41:04 2019 -0400 |
tree | 9872ba6fb693fd6d95d9b7afafbe3de126043b66 | |
parent | 1b363f43e8acfebe206e1cd004f22efd834e25cd [diff] |
VOL-1460 Updates to protos to match core and updates to go stubs. Also added support to build with godeps. Change-Id: I4b312a6dcf67e3a3f93f675da38da2ed5164e077
Protobuf files used by VOLTHA.
Currently this is used to generate both go and python.
Protobuf definition files are located in protos/voltha_protos
directory. This directory heirarchy and import scheme is required to allow the python code generated by the GRPC compiler to have the correct import paths.
NOTE: The
protos/google/api
directory has files copied from the Google APIs, and is only included for initial compilation of the VOLTHA protobuf files - these API's should be installed independently via either the python googleapis-common-protos package or the golang go-genproto repo.
Get the Voltha-protos repository:
git clone https://gerrit.opencord.org/voltha-protos cd voltha-protos
After installing Go on the MAC, the GOPATH environment variable should be set to ~/go. Create a symbolic link in the $GOPATH/src tree to the voltha-go repository:
mkdir $GOPATH/src/github.com/opencord ln -s ~/repos/voltha-protos $GOPATH/src/github.com/opencord/voltha-protos
go install ./vendor/github.com/golang/protobuf/protoc-gen-go
make build
use dist/*.tar.gz for local python imports use go/ for local go imports
Installation: pip install voltha-protos
Use: from voltha_protos import voltha_pb2
go get github.com/opencord/voltha-protos
or dep ensure
if using dep
To use the libraries, import protos with the root path github.com/opencord/voltha-protos/go/
make test
will run tests for all languages.