At the moment, this is "work-in-progress" with Semantic Versions of 0.n.x
.
Although it can be reviewed and commented on,
the recommendation is not to use it yet.
The Senzing sz-sdk-proto/go packages provide code generated by protoc for use in creating Senzing gRPC clients and servers.
-
Import the Senzing
sz-sdk-proto/go
packages. Example:import ( "github.com/senzing-garage/sz-sdk-proto/go/szconfig" "github.com/senzing-garage/sz-sdk-proto/go/szconfigmanager" "github.com/senzing-garage/sz-sdk-proto/go/szdiagnostic" "github.com/senzing-garage/sz-sdk-proto/go/szengine" "github.com/senzing-garage/sz-sdk-proto/go/szproduct" )
-
Examples of use:
This section describes how the packages are generated. For package use, see above.
The Senzing sz-sdk-proto/go packages are generated by the protoc command.
-
Set these environment variable values identifying the Git repository:
export GIT_ACCOUNT=senzing export GIT_REPOSITORY=sz-sdk-proto export GIT_ACCOUNT_DIR=~/${GIT_ACCOUNT}.git export GIT_REPOSITORY_DIR="${GIT_ACCOUNT_DIR}/${GIT_REPOSITORY}"
-
Enumerate the Senzing components. Example:
export SENZING_COMPONENTS=( \ "szconfig" \ "szconfigmgr" \ "szdiagnostic" \ "szengine" \ "szproduct" \ )
-
Generating client and server code. Example:
for SENZING_COMPONENT in ${SENZING_COMPONENTS[@]}; \ do \ export SENZING_OUTPUT_DIR=${GIT_REPOSITORY_DIR}/go/${SENZING_COMPONENT} mkdir -p ${SENZING_OUTPUT_DIR} protoc \ --proto_path=${GIT_REPOSITORY_DIR}/ \ --go_out=${SENZING_OUTPUT_DIR} \ --go_opt=paths=source_relative \ --go-grpc_out=${SENZING_OUTPUT_DIR} \ --go-grpc_opt=paths=source_relative \ ${GIT_REPOSITORY_DIR}/${SENZING_COMPONENT}.proto done