Skip to content

Commit

Permalink
#232 Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj committed Sep 10, 2024
1 parent f52b5bb commit bc7c055
Show file tree
Hide file tree
Showing 14 changed files with 172 additions and 196 deletions.
60 changes: 18 additions & 42 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,33 @@ The Senzing sz-sdk-go-core packages enable Go programs to call Senzing library f
Under the covers, Golang's CGO is used by the sz-sdk-go-core packages to make the calls
to the Senzing functions.
More information at https://github.com/senzing-garage/sz-sdk-go-core
More information at [sz-sdk-go-core].
# Installing Senzing library
Since the Senzing library is a pre-requisite, it must be installed first.
Since the Senzing API library is a pre-requisite, it must be installed first.
This can be done by installing the Senzing package using apt, yum,
or a technique using Docker containers.
Once complete, the Senzing library will be installed in the /opt/senzing directory.
Using apt:
wget https://senzing-production-apt.s3.amazonaws.com/senzingrepo_1.0.0-1_amd64.deb
sudo apt install ./senzingrepo_1.0.0-1_amd64.deb
sudo apt update
sudo apt install senzingapi
Using yum:
sudo yum install https://senzing-production-yum.s3.amazonaws.com/senzingrepo-1.0.0-1.x86_64.rpm
sudo yum install senzingapi
Using Docker, build an installer:
curl -X GET \
--output /tmp/senzing-versions-latest.sh \
https://raw.githubusercontent.com/senzing-garage/knowledge-base/main/lists/senzing-versions-latest.sh
source /tmp/senzing-versions-latest.sh
sudo docker build \
--build-arg SENZING_ACCEPT_EULA=I_ACCEPT_THE_SENZING_EULA \
--build-arg SENZING_APT_INSTALL_PACKAGE=senzingapi=${SENZING_VERSION_SENZINGAPI_BUILD} \
--build-arg SENZING_DATA_VERSION=${SENZING_VERSION_SENZINGDATA} \
--no-cache \
--tag senzing/installer:${SENZING_VERSION_SENZINGAPI} \
https://github.com/senzing-garage/docker-installer.git#main
Using Docker, install Senzing:
sudo rm -rf /opt/senzing
sudo mkdir -p /opt/senzing
sudo docker run \
--rm \
--user 0 \
--volume /opt/senzing:/opt/senzing \
senzing/installer:${SENZING_VERSION_SENZINGAPI}
See [How to install Senzing API].
# Examples
Examples of use can be seen in the xxxx_test.go files.
[bob]: https://www.bob.com
In addition to the examples in the documentation, the test files provide additional examples:
- [szconfig_test.go]
- [szconfigmanager_test.go]
- [szdiagnostic_test.go]
- [szengine_test.go]
- [szproduct_test.go]
[How to install Senzing API]: https://github.com/senzing-garage/knowledge-base/blob/main/HOWTO/install-senzing-api.md
[sz-sdk-go-core]: https://github.com/senzing-garage/sz-sdk-go-core
[szconfig_test.go]: https://github.com/senzing-garage/sz-sdk-go-core/blob/main/szconfig/szconfig_test.go
[szconfigmanager_test.go]: https://github.com/senzing-garage/sz-sdk-go-core/blob/main/szconfigmanager/szconfigmanager_test.go
[szdiagnostic_test.go]: https://github.com/senzing-garage/sz-sdk-go-core/blob/main/szdiagnostic/szdiagnostic_test.go
[szengine_test.go]: https://github.com/senzing-garage/sz-sdk-go-core/blob/main/szengine/szengine_test.go
[szproduct_test.go]: https://github.com/senzing-garage/sz-sdk-go-core/blob/main/szproduct/szproduct_test.go
*/
package main
2 changes: 1 addition & 1 deletion szabstractfactory/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ package szabstractfactory

/*
ComponentID is the identifier of the szabstractfactory package.
abstractfactory package messages will have the format "SZSDK6000eeee" where "eeee" is the error identifier.
Package abstractfactory messages will have the format "SZSDK6000eeee" where "eeee" is the error identifier.
*/
const ComponentID = 6000
10 changes: 5 additions & 5 deletions szabstractfactory/szabstractfactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Szabstractfactory struct {
// ----------------------------------------------------------------------------

/*
The CreateSzConfig method returns an SzConfig object
Method CreateSzConfig returns an SzConfig object
implemented to use the Senzing native C binary, libSz.so.
Input
Expand All @@ -44,7 +44,7 @@ func (factory *Szabstractfactory) CreateSzConfig(ctx context.Context) (senzing.S
}

/*
The CreateSzConfigManager method returns an SzConfigManager object
Method CreateSzConfigManager returns an SzConfigManager object
implemented to use the Senzing native C binary, libSz.so.
Input
Expand All @@ -60,7 +60,7 @@ func (factory *Szabstractfactory) CreateSzConfigManager(ctx context.Context) (se
}

/*
The CreateSzDiagnostic method returns an SzDiagnostic object
Method CreateSzDiagnostic returns an SzDiagnostic object
implemented to use the Senzing native C binary, libSz.so.
Input
Expand All @@ -76,7 +76,7 @@ func (factory *Szabstractfactory) CreateSzDiagnostic(ctx context.Context) (senzi
}

/*
The CreateSzEngine method returns an SzEngine object
Method CreateSzEngine returns an SzEngine object
implemented to use the Senzing native C binary, libSz.so.
Input
Expand All @@ -92,7 +92,7 @@ func (factory *Szabstractfactory) CreateSzEngine(ctx context.Context) (senzing.S
}

/*
The CreateSzProduct method returns an SzProduct object
Method CreateSzProduct returns an SzProduct object
implemented to use the Senzing native C binary, libSz.so.
Input
Expand Down
10 changes: 5 additions & 5 deletions szabstractfactory/szabstractfactory_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// Interface methods - Examples for godoc documentation
// ----------------------------------------------------------------------------

func ExampleSzAbstractFactory_CreateSzConfig() {
func ExampleSzabstractfactory_CreateSzConfig() {
// For more information, visit https://github.com/senzing-garage/sz-sdk-go-core/blob/main/szabstractfactory/szabstractfactory_examples_test.go
ctx := context.TODO()
szAbstractFactory := getSzAbstractFactoryExample(ctx)
Expand All @@ -25,7 +25,7 @@ func ExampleSzAbstractFactory_CreateSzConfig() {
// Output:
}

func ExampleSzAbstractFactory_CreateSzConfigManager() {
func ExampleSzabstractfactory_CreateSzConfigManager() {
// For more information, visit https://github.com/senzing-garage/sz-sdk-go-core/blob/main/szabstractfactory/szabstractfactory_examples_test.go
ctx := context.TODO()
szAbstractFactory := getSzAbstractFactoryExample(ctx)
Expand All @@ -37,7 +37,7 @@ func ExampleSzAbstractFactory_CreateSzConfigManager() {
// Output:
}

func ExampleSzAbstractFactory_CreateSzDiagnostic() {
func ExampleSzabstractfactory_CreateSzDiagnostic() {
// For more information, visit https://github.com/senzing-garage/sz-sdk-go-core/blob/main/szabstractfactory/szabstractfactory_examples_test.go
ctx := context.TODO()
szAbstractFactory := getSzAbstractFactoryExample(ctx)
Expand All @@ -49,7 +49,7 @@ func ExampleSzAbstractFactory_CreateSzDiagnostic() {
// Output:
}

func ExampleSzAbstractFactory_CreateSzEngine() {
func ExampleSzabstractfactory_CreateSzEngine() {
// For more information, visit https://github.com/senzing-garage/sz-sdk-go-core/blob/main/szabstractfactory/szabstractfactory_examples_test.go
ctx := context.TODO()
szAbstractFactory := getSzAbstractFactoryExample(ctx)
Expand All @@ -61,7 +61,7 @@ func ExampleSzAbstractFactory_CreateSzEngine() {
// Output:
}

func ExampleSzAbstractFactory_CreateSzProduct() {
func ExampleSzabstractfactory_CreateSzProduct() {
// For more information, visit https://github.com/senzing-garage/sz-sdk-go-core/blob/main/szabstractfactory/szabstractfactory_examples_test.go
ctx := context.TODO()
szAbstractFactory := getSzAbstractFactoryExample(ctx)
Expand Down
2 changes: 1 addition & 1 deletion szconfig/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package szconfig

/*
ComponentID is the identifier of the szconfig package.
szconfig package messages will have the format "SZSDK6001eeee" where "eeee" is the error identifier.
Package szconfig messages will have the format "SZSDK6001eeee" where "eeee" is the error identifier.
ExceptionCodeTemplate is a template for the error code returned by the Senzing C binary.
*/
Expand Down
42 changes: 21 additions & 21 deletions szconfig/szconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ import (
)

/*
The Szconfig implementation of the [senzing.SzConfig] interface
communicates with the Senzing C binaries.
Type Szconfig struct implements the [senzing.SzConfig] interface
for communicating with the Senzing C binaries.
*/
type Szconfig struct {
isTrace bool
Expand All @@ -60,7 +60,7 @@ const (
// ----------------------------------------------------------------------------

/*
The AddDataSource method adds a new data source to an existing in-memory configuration.
Method AddDataSource adds a new data source to an existing in-memory configuration.
Input
- ctx: A context to control lifecycle.
Expand Down Expand Up @@ -95,7 +95,7 @@ func (client *Szconfig) AddDataSource(ctx context.Context, configHandle uintptr,
}

/*
The CloseConfig method terminates an in-memory configuration and cleans up system resources.
Method CloseConfig terminates an in-memory configuration and cleans up system resources.
After calling CloseConfig, the configuration handle can no longer be used and is invalid.
Input
Expand All @@ -121,8 +121,8 @@ func (client *Szconfig) CloseConfig(ctx context.Context, configHandle uintptr) e
}

/*
The CreateConfig method creates an in-memory configuration using the default template.
The default template is the Senzing configuration JSON document file, `g2config.json`, located in the PIPELINE.RESOURCEPATH path.
Method CreateConfig creates an in-memory configuration using the default template.
The default template is the Senzing configuration JSON document file, g2config.json, located in the PIPELINE.RESOURCEPATH path.
The returned configHandle is used by the [Szconfig.AddDataSource], [Szconfig.DeleteDataSource],
[Szconfig.ExportConfig], and [Szconfig.GetDataSources] methods.
The configHandle is terminated by the [Szconfig.CloseConfig] method.
Expand Down Expand Up @@ -152,7 +152,7 @@ func (client *Szconfig) CreateConfig(ctx context.Context) (uintptr, error) {
}

/*
The DeleteDataSource method removes a data source from an in-memory configuration.
Method DeleteDataSource removes a data source from an in-memory configuration.
Input
- ctx: A context to control lifecycle.
Expand Down Expand Up @@ -180,7 +180,7 @@ func (client *Szconfig) DeleteDataSource(ctx context.Context, configHandle uintp
}

/*
The Destroy method will destroy and perform cleanup for the Senzing Szconfig object.
Method Destroy will destroy and perform cleanup for the Senzing Szconfig object.
It should be called after all other calls are complete.
Input
Expand All @@ -204,7 +204,7 @@ func (client *Szconfig) Destroy(ctx context.Context) error {
}

/*
The ExportConfig method creates a Senzing configuration JSON document representation of an in-memory configuration.
Method ExportConfig creates a Senzing configuration JSON document representation of an in-memory configuration.
Input
- ctx: A context to control lifecycle.
Expand Down Expand Up @@ -233,7 +233,7 @@ func (client *Szconfig) ExportConfig(ctx context.Context, configHandle uintptr)
}

/*
The GetDataSources method returns a JSON document containing data sources defined in an in-memory configuration.
Method GetDataSources returns a JSON document containing data sources defined in an in-memory configuration.
Input
- ctx: A context to control lifecycle.
Expand Down Expand Up @@ -262,7 +262,7 @@ func (client *Szconfig) GetDataSources(ctx context.Context, configHandle uintptr
}

/*
The ImportConfig method creates a new in-memory configuration from a JSON document.
Method ImportConfig creates a new in-memory configuration from a JSON document.
The returned configHandle is used by the [Szconfig.AddDataSource], [Szconfig.DeleteDataSource],
[Szconfig.ExportConfig], and [Szconfig.GetDataSources] methods.
The configHandle is terminated by the [Szconfig.CloseConfig] method.
Expand Down Expand Up @@ -297,7 +297,7 @@ func (client *Szconfig) ImportConfig(ctx context.Context, configDefinition strin
// ----------------------------------------------------------------------------

/*
The GetObserverOrigin method returns the "origin" value of past Observer messages.
Method GetObserverOrigin returns the "origin" value of past Observer messages.
Input
- ctx: A context to control lifecycle.
Expand All @@ -311,7 +311,7 @@ func (client *Szconfig) GetObserverOrigin(ctx context.Context) string {
}

/*
The Initialize method initializes the Senzing Szconfig object.
Method Initialize initializes the Senzing Szconfig object.
It must be called prior to any other calls.
Input
Expand Down Expand Up @@ -342,7 +342,7 @@ func (client *Szconfig) Initialize(ctx context.Context, instanceName string, set
}

/*
The RegisterObserver method adds the observer to the list of observers notified.
Method RegisterObserver adds the observer to the list of observers notified.
Input
- ctx: A context to control lifecycle.
Expand Down Expand Up @@ -371,7 +371,7 @@ func (client *Szconfig) RegisterObserver(ctx context.Context, observer observer.
}

/*
The SetLogLevel method sets the level of logging.
Method SetLogLevel sets the level of logging.
Input
- ctx: A context to control lifecycle.
Expand Down Expand Up @@ -401,7 +401,7 @@ func (client *Szconfig) SetLogLevel(ctx context.Context, logLevelName string) er
}

/*
The SetObserverOrigin method sets the "origin" value in future Observer messages.
Method SetObserverOrigin sets the "origin" value in future Observer messages.
Input
- ctx: A context to control lifecycle.
Expand All @@ -413,7 +413,7 @@ func (client *Szconfig) SetObserverOrigin(ctx context.Context, origin string) {
}

/*
The UnregisterObserver method removes the observer to the list of observers notified.
Method UnregisterObserver removes the observer to the list of observers notified.
Input
- ctx: A context to control lifecycle.
Expand Down Expand Up @@ -630,7 +630,7 @@ func (client *Szconfig) newError(ctx context.Context, errorNumber int, details .
}

/*
The panicOnError method calls panic() when an error is not nil.
Method panicOnError calls panic() when an error is not nil.
Input:
- err: nil or an actual error
Expand All @@ -644,7 +644,7 @@ func (client *Szconfig) panicOnError(err error) {
// --- Sz exception handling --------------------------------------------------

/*
The clearLastException method erases the last exception message held by the Senzing Szconfig object.
Method clearLastException erases the last exception message held by the Senzing Szconfig object.
Input
- ctx: A context to control lifecycle.
Expand All @@ -663,7 +663,7 @@ func (client *Szconfig) clearLastException(ctx context.Context) error {
}

/*
The getLastException method retrieves the last exception thrown in Senzing's Szconfig.
Method getLastException retrieves the last exception thrown in Senzing's Szconfig.
Input
- ctx: A context to control lifecycle.
Expand All @@ -688,7 +688,7 @@ func (client *Szconfig) getLastException(ctx context.Context) (string, error) {
}

/*
The getLastExceptionCode method retrieves the code of the last exception thrown in Senzing's Szconfig.
Method getLastExceptionCode retrieves the code of the last exception thrown in Senzing's Szconfig.
Input:
- ctx: A context to control lifecycle.
Expand Down
2 changes: 1 addition & 1 deletion szconfigmanager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package szconfigmanager

/*
ComponentID is the identifier of the szconfigmanager package.
szconfigmanager package messages will have the format "SZSDK6002eeee" where "eeee" is the error identifier.
Package szconfigmanager messages will have the format "SZSDK6002eeee" where "eeee" is the error identifier.
ExceptionCodeTemplate is a template for the error code returned by the Senzing C binary.
*/
Expand Down
Loading

0 comments on commit bc7c055

Please sign in to comment.