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 all 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 .github/workflows/go-proxy-pull.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- name: pull new module version
uses: andrewslotin/[email protected]
with:
import_path: github.com/senzing-garage/go-common
import_path: github.com/senzing-garage/go-helpers
10 changes: 5 additions & 5 deletions .github/workflows/go-test-darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ on: [push]
env:
DYLD_LIBRARY_PATH: /opt/senzing/g2/lib:/opt/senzing/g2/lib/macos
LD_LIBRARY_PATH: /opt/senzing/g2/lib:/opt/senzing/g2/lib/macos
SENZING_TOOLS_DATABASE_URL: 'sqlite3://na:na@/tmp/sqlite/G2C.db'
SENZING_TOOLS_DATABASE_URL: "sqlite3://na:na@/tmp/sqlite/G2C.db"

permissions:
contents: read

jobs:
go-test-darwin:
name: 'go test with Senzing: ${{ matrix.senzingapi-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }}'
name: "go test with Senzing: ${{ matrix.senzingapi-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ['1.21']
go: ["1.21"]
os: [macos-latest]
senzingapi-version: [production-v3]
senzingapi-version: [staging-v4]

steps:
- name: checkout repository
Expand All @@ -43,4 +43,4 @@ jobs:
run: mkdir /tmp/sqlite && cp testdata/sqlite/G2C.db /tmp/sqlite/G2C.db

- name: run go test
run: go test -exec /Users/runner/work/go-common/go-common/bin/macos_exec_dyld.sh -v -p 1 ./...
run: go test -exec /Users/runner/work/go-helpers/go-helpers/bin/macos_exec_dyld.sh -v -p 1 ./...
8 changes: 4 additions & 4 deletions .github/workflows/go-test-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ on: [push]

env:
LD_LIBRARY_PATH: /opt/senzing/g2/lib
SENZING_TOOLS_DATABASE_URL: 'sqlite3://na:na@/tmp/sqlite/G2C.db'
SENZING_TOOLS_DATABASE_URL: "sqlite3://na:na@/tmp/sqlite/G2C.db"

permissions:
contents: read

jobs:
go-test-linux:
name: 'go test with Senzing: ${{ matrix.senzingapi-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }}'
name: "go test with Senzing: ${{ matrix.senzingapi-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ['1.21']
go: ["1.21"]
os: [ubuntu-latest]
senzingapi-version: [production-v3]
senzingapi-version: [staging-v4]

steps:
- name: checkout repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go-test-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ permissions:

jobs:
go-test-windows:
name: 'go test with Senzing: ${{ matrix.senzingapi-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }}'
name: "go test with Senzing: ${{ matrix.senzingapi-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ['1.21']
go: ["1.21"]
os: [windows-latest]
senzingapi-version: [production-v3]

Expand Down
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>
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ 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
- Renamed module to `github.com/senzing-garage/go-helpers`

## [0.4.0] - 2024-01-02

### Changed in 0.4.0
Expand All @@ -29,11 +36,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 +127,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 CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ The variables are used throughout the installation procedure.

```console
export GIT_ACCOUNT=senzing-garage
export GIT_REPOSITORY=go-common
export GIT_REPOSITORY=go-helpers
```

Synthesize environment variables.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Makefile for go-common.
# Makefile for go-helpers.

# Detect the operating system and architecture.

Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# go-common
# go-helpers

If you are beginning your journey with
[Senzing](https://senzing.com/),
Expand All @@ -14,18 +14,18 @@ Heck, it may not even be appropriate for your application of Senzing!

## Synopsis

The Senzing go-common repository has packages containing
The Senzing go-helpers repository has packages containing
common interface definitions, data structures, helper functions, and test data
used by other Senzing Go language packages.

[![Go Reference](https://pkg.go.dev/badge/github.com/senzing-garage/go-common.svg)](https://pkg.go.dev/github.com/senzing-garage/go-common)
[![Go Report Card](https://goreportcard.com/badge/github.com/senzing-garage/go-common)](https://goreportcard.com/report/github.com/senzing-garage/go-common)
[![License](https://img.shields.io/badge/License-Apache2-brightgreen.svg)](https://github.com/senzing-garage/go-common/blob/main/LICENSE)
[![Go Reference](https://pkg.go.dev/badge/github.com/senzing-garage/go-helpers.svg)](https://pkg.go.dev/github.com/senzing-garage/go-helpers)
[![Go Report Card](https://goreportcard.com/badge/github.com/senzing-garage/go-helpers)](https://goreportcard.com/report/github.com/senzing-garage/go-helpers)
[![License](https://img.shields.io/badge/License-Apache2-brightgreen.svg)](https://github.com/senzing-garage/go-helpers/blob/main/LICENSE)

[![gosec.yaml](https://github.com/senzing-garage/go-common/actions/workflows/gosec.yaml/badge.svg)](https://github.com/senzing-garage/go-common/actions/workflows/gosec.yaml)
[![go-test-linux.yaml](https://github.com/senzing-garage/go-common/actions/workflows/go-test-linux.yaml/badge.svg)](https://github.com/senzing-garage/go-common/actions/workflows/go-test-linux.yaml)
[![go-test-darwin.yaml](https://github.com/senzing-garage/go-common/actions/workflows/go-test-darwin.yaml/badge.svg)](https://github.com/senzing-garage/go-common/actions/workflows/go-test-darwin.yaml)
[![go-test-windows.yaml](https://github.com/senzing-garage/go-common/actions/workflows/go-test-windows.yaml/badge.svg)](https://github.com/senzing-garage/go-common/actions/workflows/go-test-windows.yaml)
[![gosec.yaml](https://github.com/senzing-garage/go-helpers/actions/workflows/gosec.yaml/badge.svg)](https://github.com/senzing-garage/go-helpers/actions/workflows/gosec.yaml)
[![go-test-linux.yaml](https://github.com/senzing-garage/go-helpers/actions/workflows/go-test-linux.yaml/badge.svg)](https://github.com/senzing-garage/go-helpers/actions/workflows/go-test-linux.yaml)
[![go-test-darwin.yaml](https://github.com/senzing-garage/go-helpers/actions/workflows/go-test-darwin.yaml/badge.svg)](https://github.com/senzing-garage/go-helpers/actions/workflows/go-test-darwin.yaml)
[![go-test-windows.yaml](https://github.com/senzing-garage/go-helpers/actions/workflows/go-test-windows.yaml/badge.svg)](https://github.com/senzing-garage/go-helpers/actions/workflows/go-test-windows.yaml)

## Overview

Expand All @@ -37,15 +37,15 @@ 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

- `truthset` - A Go representation of [truth-sets](https://github.com/senzing-garage/truth-sets)

## References

1. [API documentation](https://pkg.go.dev/github.com/senzing-garage/go-common)
1. [API documentation](https://pkg.go.dev/github.com/senzing-garage/go-helpers)
1. [Development](docs/development.md)
1. [Errors](docs/errors.md)
1. [Examples](docs/examples.md)
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# go-common development
# go-helpers development
2 changes: 1 addition & 1 deletion docs/errors.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# go-common errors
# go-helpers errors

## Error strings

Expand Down
2 changes: 1 addition & 1 deletion docs/examples.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# go-common examples
# go-helpers examples
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 Expand Up @@ -216,7 +216,7 @@ func BuildSimpleSystemConfigurationJsonUsingMap(attributeMap map[string]string)
/*
The VerifySenzingEngineConfigurationJson method inspects the Senzing engine configuration JSON to see if it is misconfigured.

Errors are documented at https://hub.senzing.com/go-common/errors.
Errors are documented at https://hub.senzing.com/go-helpers/errors.

Input
- ctx: A context to control lifecycle.
Expand All @@ -236,7 +236,7 @@ func VerifySenzingEngineConfigurationJson(ctx context.Context, senzingEngineConf
}
for _, value := range databaseUrls {
if len(value) == 0 {
return fmt.Errorf("SQL.CONNECTION empty in Senzing engine configuration JSON.\nFor more information, visit https://hub.senzing.com/go-common/errors")
return fmt.Errorf("SQL.CONNECTION empty in Senzing engine configuration JSON.\nFor more information, visit https://hub.senzing.com/go-helpers/errors")
}
}

Expand All @@ -253,7 +253,7 @@ func VerifySenzingEngineConfigurationJson(ctx context.Context, senzingEngineConf
for _, configFile := range configFiles {
targetFile := fmt.Sprintf("%s/%s", configPath, configFile)
if _, err := os.Stat(targetFile); err != nil {
return fmt.Errorf("CONFIGPATH: Could not find %s\nFor more information, visit https://hub.senzing.com/go-common/errors", targetFile)
return fmt.Errorf("CONFIGPATH: Could not find %s\nFor more information, visit https://hub.senzing.com/go-helpers/errors", targetFile)
}
}

Expand All @@ -269,7 +269,7 @@ func VerifySenzingEngineConfigurationJson(ctx context.Context, senzingEngineConf
for _, resourceFile := range resourceFiles {
targetFile := fmt.Sprintf("%s/%s", resourcePath, resourceFile)
if _, err := os.Stat(targetFile); err != nil {
return fmt.Errorf("RESOURCEPATH: Could not find %s\nFor more information, visit https://hub.senzing.com/go-common/errors", targetFile)
return fmt.Errorf("RESOURCEPATH: Could not find %s\nFor more information, visit https://hub.senzing.com/go-helpers/errors", targetFile)
}
}

Expand All @@ -286,7 +286,7 @@ func VerifySenzingEngineConfigurationJson(ctx context.Context, senzingEngineConf
for _, resourceFile := range supportFiles {
targetFile := fmt.Sprintf("%s/%s", supportPath, resourceFile)
if _, err := os.Stat(targetFile); err != nil {
return fmt.Errorf("SUPPORTPATH: Could not find %s\nFor more information, visit https://hub.senzing.com/go-common/errors", targetFile)
return fmt.Errorf("SUPPORTPATH: Could not find %s\nFor more information, visit https://hub.senzing.com/go-helpers/errors", targetFile)
}
}

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
Loading