From 6c666339d6d88e5ed2dee10c2f6f2bbba7e7ed9c Mon Sep 17 00:00:00 2001 From: docktermj Date: Mon, 19 Aug 2024 10:07:28 -0400 Subject: [PATCH] #177 Migrate from g2 to er/sz --- Makefile | 4 +- README.md | 1 + docs/development.md | 4 +- makefiles/darwin.mk | 2 +- makefiles/linux.mk | 2 +- senzing/flags.go | 2 +- senzing/main.go | 10 ++-- szconfig/doc.go | 2 +- szconfig/main.go | 20 +++---- szconfigmanager/doc.go | 2 +- szconfigmanager/main.go | 16 +++--- szdiagnostic/doc.go | 2 +- szdiagnostic/main.go | 16 +++--- szengine/doc.go | 2 +- szengine/main.go | 120 ++++++++++++++++++++-------------------- szerror/szerror.go | 6 +- szerror/szerror_test.go | 12 ++-- szproduct/doc.go | 2 +- szproduct/main.go | 4 +- 19 files changed, 115 insertions(+), 114 deletions(-) diff --git a/Makefile b/Makefile index 918c118..de5f4d5 100644 --- a/Makefile +++ b/Makefile @@ -33,10 +33,10 @@ GO_ARCH = $(word 2, $(GO_OSARCH)) # Conditional assignment. ('?=') # Can be overridden with "export" -# Example: "export LD_LIBRARY_PATH=/path/to/my/senzing/g2/lib" +# Example: "export LD_LIBRARY_PATH=/path/to/my/senzing/er/lib" GOBIN ?= $(shell go env GOPATH)/bin -LD_LIBRARY_PATH ?= /opt/senzing/g2/lib +LD_LIBRARY_PATH ?= /opt/senzing/er/lib # Export environment variables. diff --git a/README.md b/README.md index c49e3db..82381c2 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ Documentation and examples for the implementations are at: [Senzing/sz-sdk-go-core]: https://github.com/senzing-garage/sz-sdk-go-core [Senzing/sz-sdk-go-grpc]: https://github.com/senzing-garage/sz-sdk-go-grpc [Senzing/sz-sdk-go-mock]: https://github.com/senzing-garage/sz-sdk-go-mock +[sz-sdk-go-core]: https://pkg.go.dev/github.com/senzing-garage/sz-sdk-go-core [sz-sdk-go-grpc]: https://pkg.go.dev/github.com/senzing-garage/sz-sdk-go-grpc [sz-sdk-go-mock]: https://pkg.go.dev/github.com/senzing-garage/sz-sdk-go-mock [Szconfig]: https://pkg.go.dev/github.com/senzing-garage/sz-sdk-go/szconfig#Szconfig diff --git a/docs/development.md b/docs/development.md index 6b6bc1c..bf88dbf 100644 --- a/docs/development.md +++ b/docs/development.md @@ -21,8 +21,8 @@ These are "one-time tasks" which may already have been completed. 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` - 1. `/opt/senzing/g2/sdk/c` + 1. `/opt/senzing/er/lib` + 1. `/opt/senzing/er/sdk/c` 1. `/etc/opt/senzing` 1. If not installed, see [How to Install Senzing for Go Development]. diff --git a/makefiles/darwin.mk b/makefiles/darwin.mk index e643f83..9f72123 100644 --- a/makefiles/darwin.mk +++ b/makefiles/darwin.mk @@ -4,7 +4,7 @@ # Variables # ----------------------------------------------------------------------------- -SENZING_DIR ?= /opt/senzing/g2 +SENZING_DIR ?= /opt/senzing/er SENZING_TOOLS_SENZING_DIRECTORY ?= $(SENZING_DIR) LD_LIBRARY_PATH ?= $(SENZING_TOOLS_SENZING_DIRECTORY)/lib:$(SENZING_TOOLS_SENZING_DIRECTORY)/lib/macos diff --git a/makefiles/linux.mk b/makefiles/linux.mk index 57d611b..4cc1a9b 100644 --- a/makefiles/linux.mk +++ b/makefiles/linux.mk @@ -4,7 +4,7 @@ # Variables # ----------------------------------------------------------------------------- -LD_LIBRARY_PATH ?= /opt/senzing/g2/lib +LD_LIBRARY_PATH ?= /opt/senzing/er/lib SENZING_TOOLS_DATABASE_URL ?= sqlite3://na:na@nowhere/tmp/sqlite/G2C.db PATH := $(MAKEFILE_DIRECTORY)/bin:/$(HOME)/go/bin:$(PATH) diff --git a/senzing/flags.go b/senzing/flags.go index 4da0fa9..cefbf7b 100644 --- a/senzing/flags.go +++ b/senzing/flags.go @@ -95,7 +95,7 @@ const ( SzWithInfo // 62 return "WithInfo" information ) -// Flags used by the Senzing G2Engine. +// Flags used by the Senzing SzEngine. // These flags combine single-bit flags. const ( /* Flags for exporting entity data. */ diff --git a/senzing/main.go b/senzing/main.go index 3e66b33..89bc441 100644 --- a/senzing/main.go +++ b/senzing/main.go @@ -27,7 +27,7 @@ type SzAbstractFactory interface { CreateSzProduct(ctx context.Context) (SzProduct, error) } -// The SzConfig interface is a Golang representation of Senzing's libg2config.h +// The SzConfig interface is a Golang representation of Senzing's libSzconfig.h type SzConfig interface { AddDataSource(ctx context.Context, configHandle uintptr, dataSourceCode string) (string, error) CloseConfig(ctx context.Context, configHandle uintptr) error @@ -39,7 +39,7 @@ type SzConfig interface { ImportConfig(ctx context.Context, configDefinition string) (uintptr, error) } -// The SzConfigManager interface is a Golang representation of Senzing's libg2configmgr.h +// The SzConfigManager interface is a Golang representation of Senzing's libSzconfigmgr.h type SzConfigManager interface { AddConfig(ctx context.Context, configDefinition string, configComments string) (int64, error) Destroy(ctx context.Context) error @@ -50,7 +50,7 @@ type SzConfigManager interface { SetDefaultConfigID(ctx context.Context, configID int64) error } -// The SzDiagnostic interface is a Golang representation of Senzing's libg2diagnostic.h +// The SzDiagnostic interface is a Golang representation of Senzing's libSzdiagnostic.h type SzDiagnostic interface { CheckDatastorePerformance(ctx context.Context, secondsToRun int) (string, error) Destroy(ctx context.Context) error @@ -60,7 +60,7 @@ type SzDiagnostic interface { Reinitialize(ctx context.Context, configID int64) error } -// The SzEngine interface is a Golang representation of Senzing's libg2.h +// The SzEngine interface is a Golang representation of Senzing's libSz.h type SzEngine interface { AddRecord(ctx context.Context, dataSourceCode string, recordID string, recordDefinition string, flags int64) (string, error) CloseExport(ctx context.Context, exportHandle uintptr) error @@ -97,7 +97,7 @@ type SzEngine interface { WhyRecords(ctx context.Context, dataSourceCode1 string, recordID1 string, dataSourceCode2 string, recordID2 string, flags int64) (string, error) } -// The SzProduct interface is a Golang representation of Senzing's libg2product.h +// The SzProduct interface is a Golang representation of Senzing's libSzproduct.h type SzProduct interface { Destroy(ctx context.Context) error GetLicense(ctx context.Context) (string, error) diff --git a/szconfig/doc.go b/szconfig/doc.go index 1d1f333..418506a 100644 --- a/szconfig/doc.go +++ b/szconfig/doc.go @@ -1,4 +1,4 @@ /* -The szconfig package is a wrapper over Senzing's G2Config C binding. +The szconfig package is a wrapper over Senzing's SzConfig C binding. */ package szconfig diff --git a/szconfig/main.go b/szconfig/main.go index 551b4bb..841bb35 100644 --- a/szconfig/main.go +++ b/szconfig/main.go @@ -43,16 +43,16 @@ var IDMessages = map[int]string{ 706: "Exit " + Prefix + "SetLogLevel(%s) returned (%v).", 707: "Enter " + Prefix + "UnregisterObserver(%s).", 708: "Exit " + Prefix + "UnregisterObserver(%s) returned (%v).", - 4001: Prefix + "G2Config_addDataSource(%v, %s) failed. Return code: %d", - 4002: Prefix + "G2Config_close(%v) failed. Return code: %d", - 4003: Prefix + "G2Config_create() failed. Return code: %d", - 4004: Prefix + "G2Config_deleteDataSource(%v, %s) failed. Return code: %d", - 4005: Prefix + "G2Config_destroy() failed. Return code: %d", - 4006: Prefix + "G2Config_getLastException() failed. Return code: %d", - 4007: Prefix + "G2Config_init(%s, %s, %d) failed. Return code: %d", - 4008: Prefix + "G2Config_listDataSources(%d) failed. Return code: %d", - 4009: Prefix + "G2Config_load(%s) failed. Return code: %d", - 4010: Prefix + "G2Config_save(%v) failed. Return code: %d", + 4001: Prefix + "SzConfig_addDataSource(%v, %s) failed. Return code: %d", + 4002: Prefix + "SzConfig_close(%v) failed. Return code: %d", + 4003: Prefix + "SzConfig_create() failed. Return code: %d", + 4004: Prefix + "SzConfig_deleteDataSource(%v, %s) failed. Return code: %d", + 4005: Prefix + "SzConfig_destroy() failed. Return code: %d", + 4006: Prefix + "SzConfig_getLastException() failed. Return code: %d", + 4007: Prefix + "SzConfig_init(%s, %s, %d) failed. Return code: %d", + 4008: Prefix + "SzConfig_listDataSources(%d) failed. Return code: %d", + 4009: Prefix + "SzConfig_load(%s) failed. Return code: %d", + 4010: Prefix + "SzConfig_save(%v) failed. Return code: %d", 8001: Prefix + "AddDataSource", 8002: Prefix + "CloseConfig", 8003: Prefix + "CreateConfig", diff --git a/szconfigmanager/doc.go b/szconfigmanager/doc.go index df8f884..27e9533 100644 --- a/szconfigmanager/doc.go +++ b/szconfigmanager/doc.go @@ -1,4 +1,4 @@ /* -The szconfigmanager package is a wrapper over Senzing's G2Configmgr C binding. +The szconfigmanager package is a wrapper over Senzing's SzConfigmgr C binding. */ package szconfigmanager diff --git a/szconfigmanager/main.go b/szconfigmanager/main.go index 2c45e6f..4d7df63 100644 --- a/szconfigmanager/main.go +++ b/szconfigmanager/main.go @@ -41,14 +41,14 @@ var IDMessages = map[int]string{ 706: "Exit " + Prefix + "SetLogLevel(%s) returned (%v).", 707: "Enter " + Prefix + "UnregisterObserver(%s).", 708: "Exit " + Prefix + "UnregisterObserver(%s) returned (%v).", - 4001: Prefix + "G2ConfigMgr_addConfig(%s, %s) failed. Return code: %d", - 4002: Prefix + "G2ConfigMgr_destroy() failed. Return code: %d", - 4003: Prefix + "G2ConfigMgr_getConfig(%d) failed. Return code: %d", - 4004: Prefix + "G2ConfigMgr_getConfigList() failed. Return code: %d", - 4005: Prefix + "G2ConfigMgr_getDefaultConfigID() failed. Return code: %d", - 4006: Prefix + "G2ConfigMgr_init(%s, %s, %d) failed. Return code: %d", - 4007: Prefix + "G2ConfigMgr_replaceDefaultConfigID(%d, %d) failed. Return code: %d", - 4008: Prefix + "G2ConfigMgr_setDefaultConfigID(%d) failed. Return code: %d", + 4001: Prefix + "SzConfigMgr_addConfig(%s, %s) failed. Return code: %d", + 4002: Prefix + "SzConfigMgr_destroy() failed. Return code: %d", + 4003: Prefix + "SzConfigMgr_getConfig(%d) failed. Return code: %d", + 4004: Prefix + "SzConfigMgr_getConfigList() failed. Return code: %d", + 4005: Prefix + "SzConfigMgr_getDefaultConfigID() failed. Return code: %d", + 4006: Prefix + "SzConfigMgr_init(%s, %s, %d) failed. Return code: %d", + 4007: Prefix + "SzConfigMgr_replaceDefaultConfigID(%d, %d) failed. Return code: %d", + 4008: Prefix + "SzConfigMgr_setDefaultConfigID(%d) failed. Return code: %d", 8001: Prefix + "AddConfig", 8002: Prefix + "Destroy", 8003: Prefix + "GetConfig", diff --git a/szdiagnostic/doc.go b/szdiagnostic/doc.go index a725988..556ee12 100644 --- a/szdiagnostic/doc.go +++ b/szdiagnostic/doc.go @@ -1,4 +1,4 @@ /* -The szdiagnostic package is a wrapper over Senzing's G2Diagnostic C binding. +The szdiagnostic package is a wrapper over Senzing's SzDiagnostic C binding. */ package szdiagnostic diff --git a/szdiagnostic/main.go b/szdiagnostic/main.go index c2e07b0..347da73 100644 --- a/szdiagnostic/main.go +++ b/szdiagnostic/main.go @@ -39,14 +39,14 @@ var IDMessages = map[int]string{ 706: "Exit " + Prefix + "SetLogLevel(%s) returned (%v).", 707: "Enter " + Prefix + "UnregisterObserver(%s).", 708: "Exit " + Prefix + "UnregisterObserver(%s) returned (%v).", - 4001: Prefix + "G2Diagnostic_checkDatastorePerformance(%d) failed. Return code: %d", - 4002: Prefix + "G2Diagnostic_destroy() failed. Return code: %d", - 4003: Prefix + "G2Diagnostic_getDatastoreInfo() failed. Return code: %d", - 4004: Prefix + "G2Diagnostic_getFeature(%d) failed. Return code: %d", - 4005: Prefix + "G2Diagnostic_init(%s, %s, %d) failed. Return code: %d", - 4006: Prefix + "G2Diagnostic_initWithConfigID(%s, %s, %d, %d) failed. Return code: %d", - 4007: Prefix + "G2Diagnostic_purgeRepository() failed. Return Code: %d", - 4008: Prefix + "G2Diagnostic_reinit(%d) failed. Return Code: %d", + 4001: Prefix + "SzDiagnostic_checkDatastorePerformance(%d) failed. Return code: %d", + 4002: Prefix + "SzDiagnostic_destroy() failed. Return code: %d", + 4003: Prefix + "SzDiagnostic_getDatastoreInfo() failed. Return code: %d", + 4004: Prefix + "SzDiagnostic_getFeature(%d) failed. Return code: %d", + 4005: Prefix + "SzDiagnostic_init(%s, %s, %d) failed. Return code: %d", + 4006: Prefix + "SzDiagnostic_initWithConfigID(%s, %s, %d, %d) failed. Return code: %d", + 4007: Prefix + "SzDiagnostic_purgeRepository() failed. Return Code: %d", + 4008: Prefix + "SzDiagnostic_reinit(%d) failed. Return Code: %d", 8001: Prefix + "CheckDatastorePerformance", 8002: Prefix + "Destroy", 8003: Prefix + "GetDatastoreInfo", diff --git a/szengine/doc.go b/szengine/doc.go index 1bcd56b..f85b4f8 100644 --- a/szengine/doc.go +++ b/szengine/doc.go @@ -1,4 +1,4 @@ /* -The szengine package is a wrapper over Senzing's G2 C binding. +The szengine package is a wrapper over Senzing's Sz C binding. */ package szengine diff --git a/szengine/main.go b/szengine/main.go index 4e30b8c..ced239f 100644 --- a/szengine/main.go +++ b/szengine/main.go @@ -93,66 +93,66 @@ var IDMessages = map[int]string{ 706: "Exit " + Prefix + "SetLogLevel(%s) returned (%v).", 707: "Enter " + Prefix + "UnregisterObserver(%s).", 708: "Exit " + Prefix + "UnregisterObserver(%s) returned (%v).", - 4001: Prefix + "G2_addRecord(%s, %s, %s) failed. Return code: %d", - 4002: Prefix + "G2_addRecordWithInfo(%s, %s, %s, %d) failed. Return code: %d", - 4003: Prefix + "G2_closeExport(%v) failed. Return code: %d", - 4004: Prefix + "G2_deleteRecord(%s, %s) failed. Return code: %d", - 4005: Prefix + "G2_deleteRecordWithInfo(%s, %s, %d) failed. Return code: %d", - 4006: Prefix + "G2_destroy() failed. Return code: %d", - 4007: Prefix + "G2_exportCSVEntityReport(%s, %d) failed. Return code: %d", - 4008: Prefix + "G2_exportJSONEntityReport(%d) failed. Return code: %d", - 4009: Prefix + "G2_fetchNext(%v) failed. Return code: %d", - 4010: Prefix + "G2_findInterestingEntitiesByEntityID(%d, %d) failed. Return code: %d", - 4011: Prefix + "G2_findInterestingEntitiesByRecordID(%s, %s, %d) failed. Return code: %d", - 4012: Prefix + "G2_findNetworkByEntityID(%s, %d, %d, %d) failed. Return code: %d", - 4013: Prefix + "G2_findNetworkByEntityID_V2(%s, %d, %d, %d, %d) failed. Return code: %d", - 4014: Prefix + "G2_findNetworkByRecordID(%s, %d, %d, %d) failed. Return code: %d", - 4015: Prefix + "G2_findNetworkByRecordID_V2(%s, %d, %d, %d, %d) failed. Return code: %d", - 4016: Prefix + "G2_findPathByEntityID(%d, %d, %d) failed. Return code: %d", - 4017: Prefix + "G2_findPathByEntityID_V2(%d, %d, %d, %d) failed. Return code: %d", - 4018: Prefix + "G2_findPathByRecordID(%s, %s, %s, %s, %d) failed. Return code: %d", - 4019: Prefix + "G2_findPathByRecordID_V2(%s, %s, %s, %s, %d, %d) failed. Return code: %d", - 4020: Prefix + "G2_findPathExcludingByEntityID(%d, %d, %d, %s) failed. Return code: %d", - 4021: Prefix + "G2_findPathExcludingByEntityID_V2(%d, %d, %d, %s, %d) failed. Return code: %d", - 4022: Prefix + "G2_findPathExcludingByRecordID(%s, %s, %s, %s %d, %s) failed. Return code: %d", - 4023: Prefix + "G2_findPathExcludingByRecordID_V2(%s, %s, %s, %s %d, %s, %d) failed. Return code: %d", - 4024: Prefix + "G2_findPathIncludingSourceByEntityID(%d, %d, %d, %s, %s) failed. Return code: %d", - 4025: Prefix + "G2_findPathIncludingSourceByEntityID_V2(%d, %d, %d, %s, %s, %d) failed. Return code: %d", - 4026: Prefix + "G2_findPathIncludingSourceByRecordID(%s, %s, %s, %s, %d, %s, %s) failed. Return code: %d", - 4027: Prefix + "G2_findPathIncludingSourceByRecordID_V2(%s, %s, %s, %s, %d, %s, %s, %d) failed. Return code: %d", - 4028: Prefix + "G2_getActiveConfigID() failed. Return code: %d", - 4029: Prefix + "G2_getEntityByEntityID(%d) failed. Return code: %d", - 4030: Prefix + "G2_getEntityByEntityID_V2(%d, %d) failed. Return code: %d", - 4031: Prefix + "G2_getEntityByRecordID(%s, %s) failed. Return code: %d", - 4032: Prefix + "G2_getEntityByRecordID_V2(%s, %s, %d) failed. Return code: %d", - 4033: Prefix + "G2_getLastException() failed. Return code: %d", - 4034: Prefix + "G2_getRecord(%s, %s) failed. Return code: %d", - 4035: Prefix + "G2_getRecord_V2(%s, %s, %d) failed. Return code: %d", - 4036: Prefix + "G2_getRedoRecord() failed. Return code: %d", - 4037: Prefix + "G2_getVirtualEntityByRecordID(%s) failed. Return code: %d", - 4038: Prefix + "G2_getVirtualEntityByRecordID_V2(%s, %d) failed. Return code: %d", - 4039: Prefix + "G2_howEntityByEntityID(%d) failed. Return code: %d", - 4040: Prefix + "G2_howEntityByEntityID_V2(%d, %d) failed. Return code: %d", - 4041: Prefix + "G2_init(%s, %s, %d) failed. Return code: %d", - 4042: Prefix + "G2_initWithConfigID(%s, %s, %d, %d) failed. Return code: %d", - 4043: Prefix + "G2_primeEngine() failed. Return code: %d", - 4044: Prefix + "G2_processRedoRecord(%s) failed. Return code: %d", - 4045: Prefix + "G2_processRedoRecordWithInfo(%s) failed. Return code: %d", - 4046: Prefix + "G2_reevaluateEntity(%d, %d) failed. Return code: %d", - 4047: Prefix + "G2_reevaluateEntityWithInfo(%d, %d) failed. Return code: %d", - 4048: Prefix + "G2_reevaluateRecord(%s, %s, %d) failed. Return code: %d", - 4049: Prefix + "G2_reevaluateRecordWithInfo(%s, %s, %d) failed. Return code: %d", - 4050: Prefix + "G2_reinit(%d) failed. Return code: %d", - 4051: Prefix + "G2_searchByAttributes(%s) failed. Return code: %d", - 4052: Prefix + "G2_searchByAttributes_V2(%s, %d) failed. Return code: %d", - 4053: Prefix + "G2_searchByAttributes_V3(%s, %s, %d) failed. Return code: %d", - 4054: Prefix + "G2_stats() failed. Return code: %d", - 4055: Prefix + "G2_whyEntities(%d, %d) failed. Return code: %d", - 4056: Prefix + "G2_whyEntities_V2(%d, %d, %d) failed. Return code: %d", - 4057: Prefix + "G2_whyRecordInEntity(%s, %s) failed. Return code: %d", - 4058: Prefix + "G2_whyRecordInEntity_V2(%s, %s, %d) failed. Return code: %d", - 4059: Prefix + "G2_whyRecords(%s, %s, %s, %s) failed. Return code: %d", - 4060: Prefix + "G2_whyRecords_V2(%s, %s, %s, %s, %d) failed. Return code: %d", + 4001: Prefix + "Sz_addRecord(%s, %s, %s) failed. Return code: %d", + 4002: Prefix + "Sz_addRecordWithInfo(%s, %s, %s, %d) failed. Return code: %d", + 4003: Prefix + "Sz_closeExport(%v) failed. Return code: %d", + 4004: Prefix + "Sz_deleteRecord(%s, %s) failed. Return code: %d", + 4005: Prefix + "Sz_deleteRecordWithInfo(%s, %s, %d) failed. Return code: %d", + 4006: Prefix + "Sz_destroy() failed. Return code: %d", + 4007: Prefix + "Sz_exportCSVEntityReport(%s, %d) failed. Return code: %d", + 4008: Prefix + "Sz_exportJSONEntityReport(%d) failed. Return code: %d", + 4009: Prefix + "Sz_fetchNext(%v) failed. Return code: %d", + 4010: Prefix + "Sz_findInterestingEntitiesByEntityID(%d, %d) failed. Return code: %d", + 4011: Prefix + "Sz_findInterestingEntitiesByRecordID(%s, %s, %d) failed. Return code: %d", + 4012: Prefix + "Sz_findNetworkByEntityID(%s, %d, %d, %d) failed. Return code: %d", + 4013: Prefix + "Sz_findNetworkByEntityID_V2(%s, %d, %d, %d, %d) failed. Return code: %d", + 4014: Prefix + "Sz_findNetworkByRecordID(%s, %d, %d, %d) failed. Return code: %d", + 4015: Prefix + "Sz_findNetworkByRecordID_V2(%s, %d, %d, %d, %d) failed. Return code: %d", + 4016: Prefix + "Sz_findPathByEntityID(%d, %d, %d) failed. Return code: %d", + 4017: Prefix + "Sz_findPathByEntityID_V2(%d, %d, %d, %d) failed. Return code: %d", + 4018: Prefix + "Sz_findPathByRecordID(%s, %s, %s, %s, %d) failed. Return code: %d", + 4019: Prefix + "Sz_findPathByRecordID_V2(%s, %s, %s, %s, %d, %d) failed. Return code: %d", + 4020: Prefix + "Sz_findPathExcludingByEntityID(%d, %d, %d, %s) failed. Return code: %d", + 4021: Prefix + "Sz_findPathExcludingByEntityID_V2(%d, %d, %d, %s, %d) failed. Return code: %d", + 4022: Prefix + "Sz_findPathExcludingByRecordID(%s, %s, %s, %s %d, %s) failed. Return code: %d", + 4023: Prefix + "Sz_findPathExcludingByRecordID_V2(%s, %s, %s, %s %d, %s, %d) failed. Return code: %d", + 4024: Prefix + "Sz_findPathIncludingSourceByEntityID(%d, %d, %d, %s, %s) failed. Return code: %d", + 4025: Prefix + "Sz_findPathIncludingSourceByEntityID_V2(%d, %d, %d, %s, %s, %d) failed. Return code: %d", + 4026: Prefix + "Sz_findPathIncludingSourceByRecordID(%s, %s, %s, %s, %d, %s, %s) failed. Return code: %d", + 4027: Prefix + "Sz_findPathIncludingSourceByRecordID_V2(%s, %s, %s, %s, %d, %s, %s, %d) failed. Return code: %d", + 4028: Prefix + "Sz_getActiveConfigID() failed. Return code: %d", + 4029: Prefix + "Sz_getEntityByEntityID(%d) failed. Return code: %d", + 4030: Prefix + "Sz_getEntityByEntityID_V2(%d, %d) failed. Return code: %d", + 4031: Prefix + "Sz_getEntityByRecordID(%s, %s) failed. Return code: %d", + 4032: Prefix + "Sz_getEntityByRecordID_V2(%s, %s, %d) failed. Return code: %d", + 4033: Prefix + "Sz_getLastException() failed. Return code: %d", + 4034: Prefix + "Sz_getRecord(%s, %s) failed. Return code: %d", + 4035: Prefix + "Sz_getRecord_V2(%s, %s, %d) failed. Return code: %d", + 4036: Prefix + "Sz_getRedoRecord() failed. Return code: %d", + 4037: Prefix + "Sz_getVirtualEntityByRecordID(%s) failed. Return code: %d", + 4038: Prefix + "Sz_getVirtualEntityByRecordID_V2(%s, %d) failed. Return code: %d", + 4039: Prefix + "Sz_howEntityByEntityID(%d) failed. Return code: %d", + 4040: Prefix + "Sz_howEntityByEntityID_V2(%d, %d) failed. Return code: %d", + 4041: Prefix + "Sz_init(%s, %s, %d) failed. Return code: %d", + 4042: Prefix + "Sz_initWithConfigID(%s, %s, %d, %d) failed. Return code: %d", + 4043: Prefix + "Sz_primeEngine() failed. Return code: %d", + 4044: Prefix + "Sz_processRedoRecord(%s) failed. Return code: %d", + 4045: Prefix + "Sz_processRedoRecordWithInfo(%s) failed. Return code: %d", + 4046: Prefix + "Sz_reevaluateEntity(%d, %d) failed. Return code: %d", + 4047: Prefix + "Sz_reevaluateEntityWithInfo(%d, %d) failed. Return code: %d", + 4048: Prefix + "Sz_reevaluateRecord(%s, %s, %d) failed. Return code: %d", + 4049: Prefix + "Sz_reevaluateRecordWithInfo(%s, %s, %d) failed. Return code: %d", + 4050: Prefix + "Sz_reinit(%d) failed. Return code: %d", + 4051: Prefix + "Sz_searchByAttributes(%s) failed. Return code: %d", + 4052: Prefix + "Sz_searchByAttributes_V2(%s, %d) failed. Return code: %d", + 4053: Prefix + "Sz_searchByAttributes_V3(%s, %s, %d) failed. Return code: %d", + 4054: Prefix + "Sz_stats() failed. Return code: %d", + 4055: Prefix + "Sz_whyEntities(%d, %d) failed. Return code: %d", + 4056: Prefix + "Sz_whyEntities_V2(%d, %d, %d) failed. Return code: %d", + 4057: Prefix + "Sz_whyRecordInEntity(%s, %s) failed. Return code: %d", + 4058: Prefix + "Sz_whyRecordInEntity_V2(%s, %s, %d) failed. Return code: %d", + 4059: Prefix + "Sz_whyRecords(%s, %s, %s, %s) failed. Return code: %d", + 4060: Prefix + "Sz_whyRecords_V2(%s, %s, %s, %s, %d) failed. Return code: %d", 8001: Prefix + "AddRecord", 8002: Prefix + "CloseExport", 8003: Prefix + "CountRedoRecords", diff --git a/szerror/szerror.go b/szerror/szerror.go index 0a02da2..117b060 100644 --- a/szerror/szerror.go +++ b/szerror/szerror.go @@ -33,7 +33,7 @@ func mapErrorIDtoError(errorTypeID TypeIDs) error { The Message function returns the string value from the Senzing error message. Input - - senzingErrorMessage: The message returned from Senzing's G2xxx_getLastException message. + - senzingErrorMessage: The message returned from Senzing's Szxxx_getLastException message. */ func Message(senzingErrorMessage string) string { result := "" @@ -49,7 +49,7 @@ The Code function returns the integer error code value from the Senzing error me Example Senzing error message: "0037E|Unknown resolved entity value '-4'" Input - - senzingErrorMessage: The message returned from Senzing's G2xxx_getLastException message. + - senzingErrorMessage: The message returned from Senzing's Szxxx_getLastException message. */ func Code(senzingErrorMessage string) int { result := 0 @@ -72,7 +72,7 @@ func Code(senzingErrorMessage string) int { The New function returns the integer error code value from the Senzing error message. Input - - senzingErrorCode: The error integer extracted from Senzing's G2xxx_getLastException message. + - senzingErrorCode: The error integer extracted from Senzing's Szxxx_getLastException message. - message: The message to be returned by err.Error(). */ func New(senzingErrorCode int, message string) error { diff --git a/szerror/szerror_test.go b/szerror/szerror_test.go index f49b159..1896787 100644 --- a/szerror/szerror_test.go +++ b/szerror/szerror_test.go @@ -187,24 +187,24 @@ var testCases = []struct { "level": "FATAL", "id": "senzing-60025920", "text": "During setup, call to setupSenzingConfig() failed.", - "location": "In setup() at g2configmgr_test.go:244", + "location": "In setup() at szconfigmgr_test.go:244", "errors": [{ "text": { "date": "2023-03-23", "time": "22:24:53.180615238", "level": "FATAL", "id": "senzing-60025912", - "text": "During setup, call to g2configmgr.Init() failed.", - "location": "In setupSenzingConfig() at g2configmgr_test.go:185", + "text": "During setup, call to asconfigmgr.Init() failed.", + "location": "In setupSenzingConfig() at szconfigmgr_test.go:185", "errors": [{ "text": { "date": "2023-03-23", "time": "22:24:53.180436236", "level": "ERROR", "id": "senzing-60024007", - "text": "Call to G2ConfigMgr_init(Test module name, {\"PIPELINE\":{\"CONFIGPATH\":\"/etc/opt/senzing\",\"RESOURCEPATH\":\"/opt/senzing/g2/resources\",\"SUPPORTPATH\":\"/opt/senzing/data\"},\"SQL\":{\"CONNECTION\":\"postgresql://postgres:postgres@192.168.1.12:5432:G2/?sslmode=disable\"}}, 0) failed. Return code: -2", + "text": "Call to SzConfigMgr_init(Test module name, {\"PIPELINE\":{\"CONFIGPATH\":\"/etc/opt/senzing\",\"RESOURCEPATH\":\"/opt/senzing/er/resources\",\"SUPPORTPATH\":\"/opt/senzing/data\"},\"SQL\":{\"CONNECTION\":\"postgresql://postgres:postgres@192.168.1.12:5432:G2/?sslmode=disable\"}}, 0) failed. Return code: -2", "duration": 490035005, - "location": "In setupSenzingConfig() at g2configmgr_test.go:183", + "location": "In setupSenzingConfig() at szconfigmgr_test.go:183", "errors": [{ "text": "1019E|Datastore schema tables not found. [Datastore schema tables not found. [(7:42P01ERROR: relation \"sys_vars\" does not exist LINE 1: SELECT VAR_VALUE,SYS_LSTUPD_DT FROM SYS_VARS WHERE VAR_GROUP... ^ )]]" }], @@ -213,7 +213,7 @@ var testCases = []struct { "2": { "PIPELINE": { "CONFIGPATH": "/etc/opt/senzing", - "RESOURCEPATH": "/opt/senzing/g2/resources", + "RESOURCEPATH": "/opt/senzing/er/resources", "SUPPORTPATH": "/opt/senzing/data" }, "SQL": { diff --git a/szproduct/doc.go b/szproduct/doc.go index 2705c5f..d090b93 100644 --- a/szproduct/doc.go +++ b/szproduct/doc.go @@ -1,4 +1,4 @@ /* -The szproduct package is a wrapper over Senzing's G2Product C binding. +The szproduct package is a wrapper over Senzing's SzProduct C binding. */ package szproduct diff --git a/szproduct/main.go b/szproduct/main.go index f5034d4..d275548 100644 --- a/szproduct/main.go +++ b/szproduct/main.go @@ -33,8 +33,8 @@ var IDMessages = map[int]string{ 706: "Exit " + Prefix + "SetLogLevel(%s) returned (%v).", 707: "Enter " + Prefix + "UnregisterObserver(%s).", 708: "Exit " + Prefix + "UnregisterObserver(%s) returned (%v).", - 4001: Prefix + "G2Product_destroy() failed. Return code: %d", - 4002: Prefix + "G2Product_init(%s, %s, %d) failed. Return code: %d", + 4001: Prefix + "SzProduct_destroy() failed. Return code: %d", + 4002: Prefix + "SzProduct_init(%s, %s, %d) failed. Return code: %d", 8001: Prefix + "Destroy", 8002: Prefix + "Initialize", 8003: Prefix + "GetLicense",