Skip to content
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 CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Changelog

[FireFly Common Releases](https://github.com/hyperledger/firefly-common/releases)
[FireFly Common Releases](https://github.com/hyperledger-firefly/common/releases)
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[![codecov](https://codecov.io/gh/hyperledger/firefly-common/branch/main/graph/badge.svg?token=LUX2I5EU0T)](https://codecov.io/gh/hyperledger/firefly-common)
[![Go Reference](https://pkg.go.dev/badge/github.com/hyperledger/firefly-common.svg)](https://pkg.go.dev/github.com/hyperledger/firefly-common)
[![codecov](https://codecov.io/gh/hyperledger-firefly/common/branch/main/graph/badge.svg?token=LUX2I5EU0T)](https://codecov.io/gh/hyperledger-firefly/common)
[![Go Reference](https://pkg.go.dev/badge/github.com/hyperledger-firefly/common.svg)](https://pkg.go.dev/github.com/hyperledger-firefly/common)

# Hyperledger FireFly Common

Common utility modules and interface definitions, used across Hyperledger FireFly microservice runtimes (the Go ones anyway):

- Logging - [pkg/log](https://pkg.go.dev/github.com/hyperledger/firefly-common/pkg/log)
- Translation (i18n) - [pkg/i18n](https://pkg.go.dev/github.com/hyperledger/firefly-common/pkg/i18n)
- Configuration - [pkg/config](https://pkg.go.dev/github.com/hyperledger/firefly-common/pkg/config)
- Common types - [pkg/fftypes](https://pkg.go.dev/github.com/hyperledger/firefly-common/pkg/fftypes)
- REST Client - [pkg/ffresty](https://pkg.go.dev/github.com/hyperledger/firefly-common/pkg/ffresty)
- WebSocket Client - [pkg/wsclient](https://pkg.go.dev/github.com/hyperledger/firefly-common/pkg/wsclient)
- HTTP Server - [pkg/httpserver](https://pkg.go.dev/github.com/hyperledger/firefly-common/pkg/httpserver)
- Logging - [pkg/log](https://pkg.go.dev/github.com/hyperledger-firefly/common/pkg/log)
- Translation (i18n) - [pkg/i18n](https://pkg.go.dev/github.com/hyperledger-firefly/common/pkg/i18n)
- Configuration - [pkg/config](https://pkg.go.dev/github.com/hyperledger-firefly/common/pkg/config)
- Common types - [pkg/fftypes](https://pkg.go.dev/github.com/hyperledger-firefly/common/pkg/fftypes)
- REST Client - [pkg/ffresty](https://pkg.go.dev/github.com/hyperledger-firefly/common/pkg/ffresty)
- WebSocket Client - [pkg/wsclient](https://pkg.go.dev/github.com/hyperledger-firefly/common/pkg/wsclient)
- HTTP Server - [pkg/httpserver](https://pkg.go.dev/github.com/hyperledger-firefly/common/pkg/httpserver)
12 changes: 6 additions & 6 deletions examples/ffpubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ import (
"strconv"
"sync"

"github.com/hyperledger/firefly-common/pkg/config"
"github.com/hyperledger/firefly-common/pkg/dbsql"
"github.com/hyperledger/firefly-common/pkg/eventstreams"
"github.com/hyperledger/firefly-common/pkg/fftypes"
"github.com/hyperledger/firefly-common/pkg/log"
"github.com/hyperledger/firefly-common/pkg/wsserver"
"github.com/hyperledger-firefly/common/pkg/config"
"github.com/hyperledger-firefly/common/pkg/dbsql"
"github.com/hyperledger-firefly/common/pkg/eventstreams"
"github.com/hyperledger-firefly/common/pkg/fftypes"
"github.com/hyperledger-firefly/common/pkg/log"
"github.com/hyperledger-firefly/common/pkg/wsserver"
)

// Run from root of project with:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/hyperledger/firefly-common
module github.com/hyperledger-firefly/common

go 1.23.0

Expand Down
4 changes: 2 additions & 2 deletions mocks/authmocks/plugin.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions mocks/crudmocks/crud.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/wsservermocks/protocol.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/wsservermocks/web_socket_server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/auth/authfactory/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ package authfactory
import (
"context"

"github.com/hyperledger/firefly-common/pkg/auth"
"github.com/hyperledger/firefly-common/pkg/auth/basic"
"github.com/hyperledger/firefly-common/pkg/config"
"github.com/hyperledger/firefly-common/pkg/i18n"
"github.com/hyperledger-firefly/common/pkg/auth"
"github.com/hyperledger-firefly/common/pkg/auth/basic"
"github.com/hyperledger-firefly/common/pkg/config"
"github.com/hyperledger-firefly/common/pkg/i18n"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions pkg/auth/basic/basic_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"os"
"strings"

"github.com/hyperledger/firefly-common/pkg/config"
"github.com/hyperledger/firefly-common/pkg/fftypes"
"github.com/hyperledger/firefly-common/pkg/i18n"
"github.com/hyperledger/firefly-common/pkg/log"
"github.com/hyperledger-firefly/common/pkg/config"
"github.com/hyperledger-firefly/common/pkg/fftypes"
"github.com/hyperledger-firefly/common/pkg/i18n"
"github.com/hyperledger-firefly/common/pkg/log"
"golang.org/x/crypto/bcrypt"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/auth/basic/basic_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"net/url"
"testing"

"github.com/hyperledger/firefly-common/pkg/config"
"github.com/hyperledger/firefly-common/pkg/fftypes"
"github.com/hyperledger-firefly/common/pkg/config"
"github.com/hyperledger-firefly/common/pkg/fftypes"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/basic/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package basic

import (
"github.com/hyperledger/firefly-common/pkg/config"
"github.com/hyperledger-firefly/common/pkg/config"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"encoding/json"
"net/http"

"github.com/hyperledger/firefly-common/pkg/fftypes"
"github.com/hyperledger-firefly/common/pkg/fftypes"
)

type Handler struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/auth/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"net/http"
"testing"

"github.com/hyperledger/firefly-common/pkg/auth/basic"
"github.com/hyperledger/firefly-common/pkg/config"
"github.com/hyperledger-firefly/common/pkg/auth/basic"
"github.com/hyperledger-firefly/common/pkg/config"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/auth/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package auth
import (
"context"

"github.com/hyperledger/firefly-common/pkg/config"
"github.com/hyperledger/firefly-common/pkg/fftypes"
"github.com/hyperledger-firefly/common/pkg/config"
"github.com/hyperledger-firefly/common/pkg/fftypes"
)

type Plugin interface {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const (
//
// The default behavior is that items are returned until they have been purged from the cache by an
// synchronous reaper
// NOTE: see issue https://github.com/hyperledger/firefly-common/issues/85 on operation of the async reaper.
// NOTE: see issue https://github.com/hyperledger-firefly/common/issues/85 on operation of the async reaper.
StrictExpiry BehaviorOption = iota

// TTLFromInitialAdd sets the behavior so that the time-to-live for a cache entry is set when
Expand Down
8 changes: 4 additions & 4 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import (
"sync"
"time"

"github.com/hyperledger/firefly-common/pkg/fftypes"
"github.com/hyperledger/firefly-common/pkg/fswatcher"
"github.com/hyperledger/firefly-common/pkg/i18n"
"github.com/hyperledger/firefly-common/pkg/log"
"github.com/hyperledger-firefly/common/pkg/fftypes"
"github.com/hyperledger-firefly/common/pkg/fswatcher"
"github.com/hyperledger-firefly/common/pkg/i18n"
"github.com/hyperledger-firefly/common/pkg/log"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"

Expand Down
4 changes: 2 additions & 2 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (

"github.com/stretchr/testify/require"

"github.com/hyperledger/firefly-common/pkg/fftypes"
"github.com/hyperledger/firefly-common/pkg/i18n"
"github.com/hyperledger-firefly/common/pkg/fftypes"
"github.com/hyperledger-firefly/common/pkg/i18n"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbsql/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package dbsql
import (
"fmt"

"github.com/hyperledger/firefly-common/pkg/config"
"github.com/hyperledger-firefly/common/pkg/config"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions pkg/dbsql/crud.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
"strings"

sq "github.com/Masterminds/squirrel"
"github.com/hyperledger/firefly-common/pkg/ffapi"
"github.com/hyperledger/firefly-common/pkg/fftypes"
"github.com/hyperledger/firefly-common/pkg/i18n"
"github.com/hyperledger/firefly-common/pkg/log"
"github.com/hyperledger-firefly/common/pkg/ffapi"
"github.com/hyperledger-firefly/common/pkg/fftypes"
"github.com/hyperledger-firefly/common/pkg/i18n"
"github.com/hyperledger-firefly/common/pkg/log"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions pkg/dbsql/crud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (
"github.com/DATA-DOG/go-sqlmock"
"github.com/Masterminds/squirrel"
sq "github.com/Masterminds/squirrel"
"github.com/hyperledger/firefly-common/pkg/config"
"github.com/hyperledger/firefly-common/pkg/ffapi"
"github.com/hyperledger/firefly-common/pkg/fftypes"
"github.com/hyperledger/firefly-common/pkg/log"
"github.com/hyperledger-firefly/common/pkg/config"
"github.com/hyperledger-firefly/common/pkg/ffapi"
"github.com/hyperledger-firefly/common/pkg/fftypes"
"github.com/hyperledger-firefly/common/pkg/log"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
10 changes: 5 additions & 5 deletions pkg/dbsql/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (

sq "github.com/Masterminds/squirrel"
"github.com/golang-migrate/migrate/v4"
"github.com/hyperledger/firefly-common/pkg/config"
"github.com/hyperledger/firefly-common/pkg/ffapi"
"github.com/hyperledger/firefly-common/pkg/fftypes"
"github.com/hyperledger/firefly-common/pkg/i18n"
"github.com/hyperledger/firefly-common/pkg/log"
"github.com/hyperledger-firefly/common/pkg/config"
"github.com/hyperledger-firefly/common/pkg/ffapi"
"github.com/hyperledger-firefly/common/pkg/fftypes"
"github.com/hyperledger-firefly/common/pkg/i18n"
"github.com/hyperledger-firefly/common/pkg/log"

"github.com/golang-migrate/migrate/v4/database"
// Import migrate file source
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbsql/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/DATA-DOG/go-sqlmock"
sq "github.com/Masterminds/squirrel"
"github.com/hyperledger/firefly-common/pkg/ffapi"
"github.com/hyperledger-firefly/common/pkg/ffapi"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
Expand Down
4 changes: 2 additions & 2 deletions pkg/dbsql/filter_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"strings"

sq "github.com/Masterminds/squirrel"
"github.com/hyperledger/firefly-common/pkg/ffapi"
"github.com/hyperledger/firefly-common/pkg/i18n"
"github.com/hyperledger-firefly/common/pkg/ffapi"
"github.com/hyperledger-firefly/common/pkg/i18n"
)

const escapeChar = "["
Expand Down
4 changes: 2 additions & 2 deletions pkg/dbsql/filter_sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"testing"

"github.com/Masterminds/squirrel"
"github.com/hyperledger/firefly-common/pkg/ffapi"
"github.com/hyperledger/firefly-common/pkg/fftypes"
"github.com/hyperledger-firefly/common/pkg/ffapi"
"github.com/hyperledger-firefly/common/pkg/fftypes"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/dbsql/mock_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"github.com/DATA-DOG/go-sqlmock"
sq "github.com/Masterminds/squirrel"
migratedb "github.com/golang-migrate/migrate/v4/database"
"github.com/hyperledger/firefly-common/mocks/dbmigratemocks"
"github.com/hyperledger/firefly-common/pkg/config"
"github.com/hyperledger-firefly/common/mocks/dbmigratemocks"
"github.com/hyperledger-firefly/common/pkg/config"
)

// MockProvider uses the datadog mocking framework
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbsql/postgres_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strings"

sq "github.com/Masterminds/squirrel"
"github.com/hyperledger/firefly-common/pkg/i18n"
"github.com/hyperledger-firefly/common/pkg/i18n"
)

// BuildPostgreSQLOptimizedUpsert is a PostgreSQL helper to avoid implementing this lots of times in child packages
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbsql/postgres_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"database/sql/driver"
"testing"

"github.com/hyperledger/firefly-common/pkg/fftypes"
"github.com/hyperledger-firefly/common/pkg/fftypes"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/dbsql/provider_sqlitego.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
sq "github.com/Masterminds/squirrel"
migratedb "github.com/golang-migrate/migrate/v4/database"
"github.com/golang-migrate/migrate/v4/database/sqlite3"
"github.com/hyperledger/firefly-common/pkg/config"
"github.com/hyperledger-firefly/common/pkg/config"

// Import SQLite driver
_ "github.com/mattn/go-sqlite3"
Expand Down
8 changes: 4 additions & 4 deletions pkg/eventstreams/activestream.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"sync"
"time"

"github.com/hyperledger/firefly-common/pkg/dbsql"
"github.com/hyperledger/firefly-common/pkg/fftypes"
"github.com/hyperledger/firefly-common/pkg/i18n"
"github.com/hyperledger/firefly-common/pkg/log"
"github.com/hyperledger-firefly/common/pkg/dbsql"
"github.com/hyperledger-firefly/common/pkg/fftypes"
"github.com/hyperledger-firefly/common/pkg/i18n"
"github.com/hyperledger-firefly/common/pkg/log"
)

type eventStreamBatch[DataType any] struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/eventstreams/activestream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"testing"
"time"

"github.com/hyperledger/firefly-common/pkg/fftypes"
"github.com/hyperledger-firefly/common/pkg/fftypes"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
Expand Down
10 changes: 5 additions & 5 deletions pkg/eventstreams/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import (
"context"
"crypto/tls"

"github.com/hyperledger/firefly-common/pkg/config"
"github.com/hyperledger/firefly-common/pkg/ffresty"
"github.com/hyperledger/firefly-common/pkg/fftls"
"github.com/hyperledger/firefly-common/pkg/fftypes"
"github.com/hyperledger/firefly-common/pkg/retry"
"github.com/hyperledger-firefly/common/pkg/config"
"github.com/hyperledger-firefly/common/pkg/ffresty"
"github.com/hyperledger-firefly/common/pkg/fftls"
"github.com/hyperledger-firefly/common/pkg/fftypes"
"github.com/hyperledger-firefly/common/pkg/retry"
)

// DispatcherFactory is the interface to plug in a custom dispatcher, for example to provide
Expand Down
4 changes: 2 additions & 2 deletions pkg/eventstreams/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"context"
"testing"

"github.com/hyperledger/firefly-common/pkg/config"
"github.com/hyperledger/firefly-common/pkg/fftls"
"github.com/hyperledger-firefly/common/pkg/config"
"github.com/hyperledger-firefly/common/pkg/fftls"
"github.com/stretchr/testify/assert"
)

Expand Down
Loading
Loading