Skip to content

Latest commit

 

History

History
175 lines (113 loc) · 3.26 KB

development.md

File metadata and controls

175 lines (113 loc) · 3.26 KB

go-grpcing development

Install Go

  1. See Go's Download and install

Install Senzing C library

Since the Senzing library is a prerequisite, it must be installed first.

  1. Verify Senzing C shared objects, configuration, and SDK header files are installed.

    1. /opt/senzing/g2/lib
    2. /opt/senzing/g2/sdk/c
    3. /etc/opt/senzing
  2. If not installed, see How to Install Senzing for Go Development.

Install Git repository

  1. Identify git repository.

    export GIT_ACCOUNT=senzing
    export GIT_REPOSITORY=go-grpcing
    export GIT_ACCOUNT_DIR=~/${GIT_ACCOUNT}.git
    export GIT_REPOSITORY_DIR="${GIT_ACCOUNT_DIR}/${GIT_REPOSITORY}"
    
  2. Using the environment variables values just set, follow steps in clone-repository to install the Git repository.

Build

  1. Build the binaries. Example:

    cd ${GIT_REPOSITORY_DIR}
    make build
    
  2. The binaries will be found in ${GIT_REPOSITORY_DIR}/target. Example:

    tree ${GIT_REPOSITORY_DIR}/target
    
  3. Run the binary. Example:

    ${GIT_REPOSITORY_DIR}/target/linux/go-grpcing
    
  4. Clean up. Example:

    cd ${GIT_REPOSITORY_DIR}
    make clean
    

Test

  1. Run Go tests. Example:

    cd ${GIT_REPOSITORY_DIR}
    make test
    

Documentation

  1. Start godoc documentation server. Example:

     cd ${GIT_REPOSITORY_DIR}
     godoc
    
  2. Visit localhost:6060

  3. Senzing documentation will be in the "Third party" section. github.com > senzing > go-grpcing

  4. When a versioned release is published with a v0.0.0 format tag, the reference can be found by clicking on the following badge at the top of the README.md page: Go Reference

Docker

  1. Use make target to run a docker images that builds RPM and DEB files. Example:

    cd ${GIT_REPOSITORY_DIR}
    make docker-build
    
  2. Run docker container. Example:

    docker run \
      --rm \
      senzing/go-grpcing
    

Package

Package RPM and DEB files

  1. Use make target to run a docker images that builds RPM and DEB files. Example:

    cd ${GIT_REPOSITORY_DIR}
    make package
    
  2. The results will be in the ${GIT_REPOSITORY_DIR}/target directory. Example:

    tree ${GIT_REPOSITORY_DIR}/target
    

Test DEB package on Ubuntu

  1. Determine if go-grpcing is installed. Example:

    apt list --installed | grep go-grpcing
    
  2. ✏️ Install go-grpcing. Example:

    cd ${GIT_REPOSITORY_DIR}/target
    sudo apt install ./go-grpcing-0.0.0.deb
    
  3. Run command. Example:

    go-grpcing
    
  4. Remove go-grpcing from system. Example:

    sudo apt-get remove go-grpcing