Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

116.dockter.1 #117

Merged
merged 6 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>go-common</name>
<name>go-helpers</name>
</projectDescription>
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.5.0] - 2024-04-05

### Changed in 0.5.0

- Move from "G2" to "Sz" prefix

## [0.4.0] - 2024-01-02

### Changed in 0.4.0
Expand All @@ -29,11 +35,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed in 0.3.0

- In `g2engineconfigurationjson`, Windows paths
- In `engineconfigurationjson`, Windows paths

### Removed in 0.3.0

- `g2engineconfigurationjson.BuildSimpleSystemConfigurationJson()`
- `engineconfigurationjson.BuildSimpleSystemConfigurationJson()`

## [0.2.14] - 2023-08-24

Expand Down Expand Up @@ -120,7 +126,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added in 0.2.2

- `g2engineconfigurationjson.VerifySenzingEngineConfigurationJson()`
- `engineconfigurationjson.VerifySenzingEngineConfigurationJson()`

## [0.2.1] - 2023-07-13

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The following helpers have been created:

### Helper functions

- `g2engineconfigurationjson`: A package for creating the `SENZING_ENGINE_CONFIGURATION_JSON` Document.
- `engineconfigurationjson`: A package for creating the `SENZING_ENGINE_CONFIGURATION_JSON` Document.

### Test data

Expand Down
4 changes: 4 additions & 0 deletions engineconfigurationjson/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*
The engineconfigurationjson package is used to create the JSON needed for initializing the Senzing runtime objects.
*/
package engineconfigurationjson
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Package g2engineconfigurationjson is used to generate the JSON document used to configure a Senzing client.
Package engineconfigurationjson is used to generate the JSON document used to configure a Senzing client.
*/
package g2engineconfigurationjson
package engineconfigurationjson

import (
"context"
Expand All @@ -10,7 +10,7 @@ import (
"net/url"
"os"

"github.com/senzing-garage/go-common/engineconfigurationjsonparser"
"github.com/senzing-garage/go-helpers/engineconfigurationjsonparser"
)

// ----------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build darwin

package g2engineconfigurationjson
package engineconfigurationjson

import (
"context"
Expand All @@ -19,8 +19,8 @@ func mapWithDefault(aMap map[string]string, key string, defaultValue string) str
return defaultValue
}

func buildStruct(attributeMap map[string]string) G2Configuration {
var result G2Configuration
func buildStruct(attributeMap map[string]string) SzConfiguration {
var result SzConfiguration

databaseUrl, ok := attributeMap["databaseUrl"]
if !ok {
Expand All @@ -41,13 +41,13 @@ func buildStruct(attributeMap map[string]string) G2Configuration {

// Apply attributeMap.

result = G2Configuration{
Pipeline: G2ConfigurationPipeline{
result = SzConfiguration{
Pipeline: SzConfigurationPipeline{
ConfigPath: mapWithDefault(attributeMap, "configPath", configPath),
ResourcePath: mapWithDefault(attributeMap, "resourcePath", resourcePath),
SupportPath: mapWithDefault(attributeMap, "supportPath", supportPath),
},
Sql: G2ConfigurationSql{
Sql: SzConfigurationSql{
Connection: databaseUrl,
},
}
Expand All @@ -60,7 +60,9 @@ func buildStruct(attributeMap map[string]string) G2Configuration {
return result
}

func verifySenzingEngineConfigurationJson(ctx context.Context, senzingEngineConfigurationJson string) error {
func verifySenzingEngineConfigurationJson(ctx context.Context, engineConfigurationJson string) error {
_ = ctx
_ = engineConfigurationJson
var err error = nil
return err
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build darwin

package g2engineconfigurationjson
package engineconfigurationjson

var testCasesForOsArch = []testCaseMetadata{
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build linux

package g2engineconfigurationjson
package engineconfigurationjson

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
//go:build linux

package g2engineconfigurationjson
package engineconfigurationjson

import "context"

// ----------------------------------------------------------------------------
// Internal methods
// ----------------------------------------------------------------------------

func buildStruct(attributeMap map[string]string) G2Configuration {
var result G2Configuration
func buildStruct(attributeMap map[string]string) SzConfiguration {
var result SzConfiguration

databaseUrl, ok := attributeMap["databaseUrl"]
if !ok {
return result
}

result = G2Configuration{
Pipeline: G2ConfigurationPipeline{
result = SzConfiguration{
Pipeline: SzConfigurationPipeline{
ConfigPath: "/etc/opt/senzing",
ResourcePath: "/opt/senzing/g2/resources",
SupportPath: "/opt/senzing/data",
},
Sql: G2ConfigurationSql{
Sql: SzConfigurationSql{
Connection: databaseUrl,
},
}
Expand All @@ -35,7 +35,9 @@ func buildStruct(attributeMap map[string]string) G2Configuration {
return result
}

func verifySenzingEngineConfigurationJson(ctx context.Context, senzingEngineConfigurationJson string) error {
func verifySenzingEngineConfigurationJson(ctx context.Context, engineConfigurationJson string) error {
_ = engineConfigurationJson
_ = ctx
var err error = nil
return err
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build linux

package g2engineconfigurationjson
package engineconfigurationjson

var testCasesForOsArch = []testCaseMetadata{
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package g2engineconfigurationjson
package engineconfigurationjson

import (
"context"
"net/url"
"testing"

"github.com/senzing-garage/go-common/engineconfigurationjsonparser"
"github.com/senzing-garage/go-helpers/engineconfigurationjsonparser"
"github.com/stretchr/testify/assert"
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build windows

package g2engineconfigurationjson
package engineconfigurationjson

import (
"context"
Expand All @@ -20,8 +20,8 @@ func mapWithDefault(aMap map[string]string, key string, defaultValue string) str
return defaultValue
}

func buildStruct(attributeMap map[string]string) G2Configuration {
var result G2Configuration
func buildStruct(attributeMap map[string]string) SzConfiguration {
var result SzConfiguration

databaseUrl, ok := attributeMap["databaseUrl"]
if !ok {
Expand All @@ -40,13 +40,13 @@ func buildStruct(attributeMap map[string]string) G2Configuration {

// Apply attributeMap.

result = G2Configuration{
Pipeline: G2ConfigurationPipeline{
result = SzConfiguration{
Pipeline: SzConfigurationPipeline{
ConfigPath: mapWithDefault(attributeMap, "configPath", configPath),
ResourcePath: mapWithDefault(attributeMap, "resourcePath", resourcePath),
SupportPath: mapWithDefault(attributeMap, "supportPath", supportPath),
},
Sql: G2ConfigurationSql{
Sql: SzConfigurationSql{
Connection: databaseUrl,
},
}
Expand All @@ -59,7 +59,9 @@ func buildStruct(attributeMap map[string]string) G2Configuration {
return result
}

func verifySenzingEngineConfigurationJson(ctx context.Context, senzingEngineConfigurationJson string) error {
func verifySenzingEngineConfigurationJson(ctx context.Context, engineConfigurationJson string) error {
_ = ctx
_ = engineConfigurationJson
var err error = nil
return err
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build windows

package g2engineconfigurationjson
package engineconfigurationjson

var testCasesForOsArch = []testCaseMetadata{
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// The g2engineconfigurationjson package helps configure SENZING_ENGINE_CONFIGURATION_JSON.
package g2engineconfigurationjson
// The engineconfigurationjson package helps configure SENZING_ENGINE_CONFIGURATION_JSON.
package engineconfigurationjson

// ----------------------------------------------------------------------------
// Types
// ----------------------------------------------------------------------------

type G2ConfigurationPipeline struct {
type SzConfigurationPipeline struct {
ConfigPath string `json:"CONFIGPATH"`
LicenseStringBase64 string `json:"LICENSESTRINGBASE64,omitempty"`
ResourcePath string `json:"RESOURCEPATH"`
SupportPath string `json:"SUPPORTPATH"`
}

type G2ConfigurationSql struct {
type SzConfigurationSql struct {
Connection string `json:"CONNECTION"`
}

type G2Configuration struct {
Pipeline G2ConfigurationPipeline `json:"PIPELINE"`
Sql G2ConfigurationSql `json:"SQL"`
type SzConfiguration struct {
Pipeline SzConfigurationPipeline `json:"PIPELINE"`
Sql SzConfigurationSql `json:"SQL"`
}

// ----------------------------------------------------------------------------
Expand Down
Loading
Loading