Skip to content

Latest commit

 

History

History

go

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

sz-sdk-proto/go

⚠️ WARNING: sz-sdk-proto/go is still in development ⚠️ _

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.

Synopsis

The Senzing sz-sdk-proto/go packages provide code generated by protoc for use in creating Senzing gRPC clients and servers.

Go Reference Go Report Card

Overview

  1. 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"
    )
  2. Examples of use:

    1. Used in server
    2. Used in client

Development

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.

  1. 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}"
    
  2. Enumerate the Senzing components. Example:

    export SENZING_COMPONENTS=( \
      "szconfig" \
      "szconfigmgr" \
      "szdiagnostic" \
      "szengine" \
      "szproduct" \
    )
    
  3. 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