senzing-tools

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

README

senzing-tools

⚠ WARNING: senzing-tools 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

senzing-tools is a suite of tools to help use the Senzing API.

Go Reference Go Report Card go-test.yaml License

Overview

Senzing's senzing-tools has the following tools/commands:

  1. init-database - Used to create a Senzing schema and configuration in PostgreSQL, MySQL, MsSQL and SQLite databases.
  2. observer - Aggregates Observer messages
  3. serve-grpc - A gRPC server of the Senzing API
  4. serve-http - An HTTP server for Senzing Tools
Install
  1. Visit Releases page.

  2. For the desired versioned release, in the "Assets" section, download the appropriate installation package.

    1. Use .deb file for Debian, Ubuntu and others
    2. Use .rpm file for Red Hat, CentOS, openSuse and others.
  3. ✏ Example installation for .deb file:

    sudo apt install ./senzing-tools-0.0.0.deb
    
  4. ✏ Example installation for .rpm file:

    sudo yum install ./senzing-tools-0.0.0.rpm
    

Use

  1. Important: Prior to using the senzing-tools command, the LD_LIBRARY_PATH environment variable must be set to the location of the Senzing binaries. Example:

    export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
    
Using command line options

Simple examples.

  1. ✏ A senzing-tools init-database example:

    export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
    senzing-tools init-database \
        --database-url postgresql://username:password@postgres.example.com:5432/G2
    

Each command has it's own list of supported command line options. Documentation for the command line options:

  1. Online documentation, see hub.senzing.com/senzing-tools

  2. Runtime documentation, run:

    export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
    senzing-tools [command] --help
    
  3. Detailed documentation, visit:

    1. init-database
    2. serve-grpc
Using environment variables

Environment variables may be used instead of command-line options. Each command has it's own list of supported environment variables. So see a specific list, visit the appropriate command.

  1. Commands:
    1. init-database
    2. serve-grpc
Using Docker

The senzing-tools can be run from the senzing/senzing-tools Docker container. Each command has it's own list of supported environment variables and command line options. So see a specific list, visit the appropriate command.

  1. Commands:
    1. init-database
    2. serve-grpc

This usage shows how to initialze a database with a Docker container.

  1. ✏ A senzing/senzing-tools init-databaseexample:

    docker run \
        --env SENZING_TOOLS_DATABASE_URL=postgresql://username:password@postgres.example.com:5432/G2 \
        senzing/senzing-tools init-database
    
  2. Alternative: Using SENZING_TOOLS_ENGINE_CONFIGURATION_JSON environment variable.

    1. ✏ Set SENZING_TOOLS_ENGINE_CONFIGURATION_JSON. Example:

      export SENZING_TOOLS_ENGINE_CONFIGURATION_JSON='{
          "PIPELINE": {
              "CONFIGPATH": "/etc/opt/senzing",
              "RESOURCEPATH": "/opt/senzing/g2/resources",
              "SUPPORTPATH": "/opt/senzing/data"
          },
          "SQL": {
              "CONNECTION": "postgresql://username:password@postgres.example.com:5432:G2"
          }
      }'
      
    2. Run senzing/senzing-tools. Note: SENZING_TOOLS_ENGINE_CONFIGURATION_JSON superceeds use of SENZING_TOOLS_DATABASE_URL. Example:

      docker run \
          --env SENZING_TOOLS_ENGINE_CONFIGURATION_JSON \
          senzing/senzing-tools init-database
      
Parameters

See individual commands for parameters:

  1. init-database
  2. serve-grpc

References

Documentation

Overview

One or two sentence synopsys of the module. The Senzing XXXX module is...

Overview

One or two paragraph overview of this module...

(This page describes the nature of the entire Go module or the top-level command, not an individual package.)

More information at https://github.com/senzing/template-go

Example Package

The example package gives an example layout for a package. This includes how documentation, tests, and examples should be done. This paragraph (or two) should provide a brief overview while linking the reader to the documentation included in the package itself.

More information can be found in the pkg/github.com/senzing/template-go/examplepackage documentation.

Another Header: Package or other module features...

More details about the module... Lorem ipsum dolor sit amet, consectetur adipiscing elit...

Examples

The examples given here should show a holistic view of the module, if appropriate.

Examples of use can be seen in the main_test.go files.

package main
import (
	fmt

	"github.com/senzing/template-go/examplepackage"
	"github.com/senzing/template-go/anotherpackage"
)

func main() {
	ctx := context.TODO()
	testObject := &ExamplePackageImpl{
		Something: "I'm here",
	}
	err := testObject.SaySomething(ctx)
	if err != nil {
		fmt.Println("whoops")
	}
	anotherpackage.DoSomething(ctx)...
}

Directories

Path Synopsis
The cmd package is used for Cobra integration.
The cmd package is used for Cobra integration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL