diff --git a/.make/go.mk b/.make/go.mk index ec7aa523..9f43f210 100644 --- a/.make/go.mk +++ b/.make/go.mk @@ -135,8 +135,12 @@ uninstall: ## Uninstall the application (and remove files) .PHONY: update update: ## Update all project dependencies - @echo "updating dependencies..." + @echo "updating dependencies in root..." @go get -u ./... && go mod tidy + @echo "updating dependencies in engine..." + @(cd engine && go get -u ./... && go mod tidy) + @echo "updating dependencies in models..." + @(cd models && go get -u ./... && go mod tidy) .PHONY: update-linter update-linter: ## Update the golangci-lint package (macOS only) diff --git a/README.md b/README.md index 6bbc6d50..05825fe9 100644 --- a/README.md +++ b/README.md @@ -345,7 +345,6 @@ Ports which are used: - 5432 - PostgreSQL DB - 6379 - Redis - 8080 - Block Headers Service -- 27017 - MongoDB - 80 - in case of exposing on the paymail domain and its subdomains - 443 - in case of exposing on the paymail domain and its subdomains
diff --git a/config.example.yaml b/config.example.yaml index e6f19b6b..cf84a3bc 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -28,20 +28,10 @@ db: datastore: # enable datastore debug mode debug: false - # datastore engine - sqlite/postgresql/mysql/mongodb (experimental) + # datastore engine - sqlite/postgresql engine: sqlite # prefix for all tables table_prefix: xapi - mongodb: - database_name: xapi - debug: false - max_connection_idle_time: 0s - max_connection_time: 0s - max_idle_connections: 0 - max_open_connections: 0 - table_prefix: "" - transactions: false - uri: mongodb://localhost:27017/xapi sql: debug: false driver: postgresql diff --git a/config/config.go b/config/config.go index 83d7b009..923fb587 100644 --- a/config/config.go +++ b/config/config.go @@ -123,9 +123,7 @@ type RedisConfig struct { type DbConfig struct { // Datastore general config. Datastore *DatastoreConfig `json:"datastore" mapstructure:"datastore"` - // Mongo is a config for MongoDb. Works only if datastore engine is set to mongodb. - Mongo *datastore.MongoDBConfig `json:"mongodb" mapstructure:"mongodb"` - // SQL is a config for PostgreSQL or MySQL. Works only if datastore engine is set to postgresql or mysql. + // SQL is a config for PostgreSQL. Works only if datastore engine is set to postgresql. SQL *datastore.SQLConfig `json:"sql" mapstructure:"sql"` // SQLite is a config for SQLite. Works only if datastore engine is set to sqlite. SQLite *datastore.SQLiteConfig `json:"sqlite" mapstructure:"sqlite"` @@ -135,7 +133,7 @@ type DbConfig struct { type DatastoreConfig struct { // TablePrefix is the prefix for all table names in the database. TablePrefix string `json:"table_prefix" mapstructure:"table_prefix"` - // Engine is the database to be used, mysql, sqlite, postgresql. + // Engine is the database to be used, sqlite, postgresql. Engine datastore.Engine `json:"engine" mapstructure:"engine"` // Debug is a flag that decides whether additional output (such as sql statements) should be produced from datastore. Debug bool `json:"debug" mapstructure:"debug"` diff --git a/config/config_test.go b/config/config_test.go index b6f34bb9..b3efbda9 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -143,60 +143,4 @@ func TestAppConfig_Validate(t *testing.T) { err := app.Validate() assert.Error(t, err) }) - - t.Run("datastore - invalid sql config", func(t *testing.T) { - app, _ := baseTestConfig(t) - app.Db.Datastore.Engine = datastore.MySQL - app.Db.SQL = nil - err := app.Validate() - assert.Error(t, err) - }) - - t.Run("datastore - invalid sql user", func(t *testing.T) { - app, _ := baseTestConfig(t) - app.Db.Datastore.Engine = datastore.MySQL - app.Db.SQL.User = "" - err := app.Validate() - assert.Error(t, err) - }) - - t.Run("datastore - invalid sql name", func(t *testing.T) { - app, _ := baseTestConfig(t) - app.Db.Datastore.Engine = datastore.MySQL - app.Db.SQL.Name = "" - err := app.Validate() - assert.Error(t, err) - }) - - t.Run("datastore - invalid sql host", func(t *testing.T) { - app, _ := baseTestConfig(t) - app.Db.Datastore.Engine = datastore.MySQL - app.Db.SQL.Host = "" - err := app.Validate() - assert.Error(t, err) - }) - - t.Run("datastore - invalid mongo config", func(t *testing.T) { - app, _ := baseTestConfig(t) - app.Db.Datastore.Engine = datastore.MongoDB - app.Db.Mongo = nil - err := app.Validate() - assert.Error(t, err) - }) - - t.Run("datastore - invalid mongo uri", func(t *testing.T) { - app, _ := baseTestConfig(t) - app.Db.Datastore.Engine = datastore.MongoDB - app.Db.Mongo.URI = "" - err := app.Validate() - assert.Error(t, err) - }) - - t.Run("datastore - invalid mongo database name", func(t *testing.T) { - app, _ := baseTestConfig(t) - app.Db.Datastore.Engine = datastore.MongoDB - app.Db.Mongo.DatabaseName = "" - err := app.Validate() - assert.Error(t, err) - }) } diff --git a/config/defaults.go b/config/defaults.go index b1f25de6..f000acc8 100644 --- a/config/defaults.go +++ b/config/defaults.go @@ -75,25 +75,18 @@ func getDbDefaults() *DbConfig { Engine: "sqlite", TablePrefix: "xapi", }, - Mongo: &datastore.MongoDBConfig{ - DatabaseName: "xapi", - ExistingConnection: nil, - Transactions: false, - URI: "mongodb://localhost:27017/xapi", - }, SQL: &datastore.SQLConfig{ - Driver: "postgresql", - ExistingConnection: nil, - Host: "localhost", - Name: "xapi", - Password: "", - Port: "5432", - Replica: false, - SkipInitializeWithVersion: true, - TimeZone: "UTC", - TxTimeout: 10 * time.Second, - User: "postgres", - SslMode: "disable", + Driver: "postgresql", + ExistingConnection: nil, + Host: "localhost", + Name: "xapi", + Password: "", + Port: "5432", + Replica: false, + TimeZone: "UTC", + TxTimeout: 10 * time.Second, + User: "postgres", + SslMode: "disable", }, SQLite: &datastore.SQLiteConfig{ DatabasePath: "./spv-wallet.db", diff --git a/config/services.go b/config/services.go index 9bc5b4de..5457776b 100644 --- a/config/services.go +++ b/config/services.go @@ -323,7 +323,7 @@ func loadDatastore(options []engine.ClientOps, appConfig *AppConfig, testMode bo DatabasePath: appConfig.Db.SQLite.DatabasePath, // "" for in memory Shared: appConfig.Db.SQLite.Shared, })) - } else if appConfig.Db.Datastore.Engine == datastore.MySQL || appConfig.Db.Datastore.Engine == datastore.PostgreSQL { + } else if appConfig.Db.Datastore.Engine == datastore.PostgreSQL { tablePrefix := appConfig.Db.Datastore.TablePrefix if len(appConfig.Db.SQL.TablePrefix) > 0 { tablePrefix = appConfig.Db.SQL.TablePrefix @@ -349,16 +349,6 @@ func loadDatastore(options []engine.ClientOps, appConfig *AppConfig, testMode bo SslMode: appConfig.Db.SQL.SslMode, })) - } else if appConfig.Db.Datastore.Engine == datastore.MongoDB { - - debug := appConfig.Db.Datastore.Debug - tablePrefix := appConfig.Db.Datastore.TablePrefix - if len(appConfig.Db.Mongo.TablePrefix) > 0 { - tablePrefix = appConfig.Db.Mongo.TablePrefix - } - appConfig.Db.Mongo.Debug = debug - appConfig.Db.Mongo.TablePrefix = tablePrefix - options = append(options, engine.WithMongoDB(appConfig.Db.Mongo)) } else { return nil, errors.New("unsupported datastore engine: " + appConfig.Db.Datastore.Engine.String()) } diff --git a/config/validate_datastore.go b/config/validate_datastore.go index 0090da08..141e17d4 100644 --- a/config/validate_datastore.go +++ b/config/validate_datastore.go @@ -16,7 +16,7 @@ func (d *DbConfig) Validate() error { if d.SQLite == nil { return errors.New("missing sqlite config") } - } else if d.Datastore.Engine == datastore.MySQL || d.Datastore.Engine == datastore.PostgreSQL { + } else if d.Datastore.Engine == datastore.PostgreSQL { if d.SQL == nil { return errors.New("missing sql config") } else if len(d.SQL.Host) == 0 { @@ -26,14 +26,7 @@ func (d *DbConfig) Validate() error { } else if len(d.SQL.Name) == 0 { return errors.New("missing sql db name") } - } else if d.Datastore.Engine == datastore.MongoDB { - if d.Mongo == nil { - return errors.New("missing mongo config") - } else if len(d.Mongo.URI) == 0 { - return errors.New("missing mongo uri") - } else if len(d.Mongo.DatabaseName) == 0 { - return errors.New("missing mongo database name") - } } + return nil } diff --git a/config/validate_datastore_test.go b/config/validate_datastore_test.go index 88877340..a1ee99e3 100644 --- a/config/validate_datastore_test.go +++ b/config/validate_datastore_test.go @@ -14,7 +14,6 @@ func TestDatastoreConfig_Validate(t *testing.T) { t.Run("valid datastore config", func(t *testing.T) { d := DbConfig{ Datastore: &DatastoreConfig{Engine: datastore.SQLite}, - Mongo: &datastore.MongoDBConfig{}, SQL: &datastore.SQLConfig{}, SQLite: &datastore.SQLiteConfig{}, } @@ -27,7 +26,6 @@ func TestDatastoreConfig_Validate(t *testing.T) { t.Run("empty datastore", func(t *testing.T) { d := DbConfig{ Datastore: &DatastoreConfig{Engine: datastore.Empty}, - Mongo: &datastore.MongoDBConfig{}, SQL: &datastore.SQLConfig{}, SQLite: &datastore.SQLiteConfig{}, } @@ -40,7 +38,6 @@ func TestDatastoreConfig_Validate(t *testing.T) { t.Run("invalid datastore engine", func(t *testing.T) { d := DbConfig{ Datastore: &DatastoreConfig{Engine: ""}, - Mongo: &datastore.MongoDBConfig{}, SQL: &datastore.SQLConfig{}, SQLite: &datastore.SQLiteConfig{}, } diff --git a/docker-compose.yml b/docker-compose.yml index b5447d2d..3d6f9ccf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -118,23 +118,6 @@ services: timeout: 5s retries: 3 - wallet-mongodb: - image: mongo - environment: - MONGO_INITDB_ROOT_USERNAME: mongo - MONGO_INITDB_ROOT_PASSWORD: mongo - MONGO_INITDB_DATABASE: xapi - ports: - - '27017:27017' - volumes: - - wallet-mongodb-data:/data/db - healthcheck: - test: echo 'db.runCommand("ping").ok' | mongosh mongodb:27017/test --quiet - interval: 10s - timeout: 10s - retries: 5 - start_period: 40s - wallet-gateway: image: traefik:v2.11 container_name: traefik @@ -165,8 +148,6 @@ volumes: driver: local wallet-redis-data: driver: local - wallet-mongodb-data: - driver: local block-headers-service-data: driver: local wallet-gateway-data: diff --git a/engine/README.md b/engine/README.md index 6f0cf8c5..f51020ce 100644 --- a/engine/README.md +++ b/engine/README.md @@ -21,22 +21,22 @@ ## Table of Contents -- [SPV Wallet Engine](#spv-wallet-engine) - - [Table of Contents](#table-of-contents) - - [About](#about) - - [DISCLAIMER](#disclaimer) - - [SPV Wallet Engine: Out-of-the-box Features:](#spv-wallet-engine-out-of-the-box-features) - - [**Project Assumptions: MVP**](#project-assumptions-mvp) - - [Installation](#installation) - - [Documentation](#documentation) - - [Built-in Features](#built-in-features) - - [Usage](#usage) - - [Examples \& Tests](#examples--tests) - - [Benchmarks](#benchmarks) - - [Code Standards](#code-standards) - - [Usage](#usage-1) - - [Contributing](#contributing) - - [License](#license) +- [SPV Wallet Engine](#spv-wallet-engine) + - [Table of Contents](#table-of-contents) + - [About](#about) + - [DISCLAIMER](#disclaimer) + - [SPV Wallet Engine: Out-of-the-box Features:](#spv-wallet-engine-out-of-the-box-features) + - [**Project Assumptions: MVP**](#project-assumptions-mvp) + - [Installation](#installation) + - [Documentation](#documentation) + - [Built-in Features](#built-in-features) + - [Usage](#usage) + - [Examples \& Tests](#examples--tests) + - [Benchmarks](#benchmarks) + - [Code Standards](#code-standards) + - [Usage](#usage-1) + - [Contributing](#contributing) + - [License](#license)
@@ -61,7 +61,7 @@ #### SPV Wallet Engine: Out-of-the-box Features: - xPub & UTXO State Management (state, balance, utxos, destinations) -- Bring your own Database ([PostgreSQL](https://www.postgresql.org/), [SQLite](https://www.sqlite.org), [MySQL](https://www.mysql.com/), [Mongo](https://www.mongodb.com/) or [interface](./datastore/interface.go) your own) +- Bring your own Database ([PostgreSQL](https://www.postgresql.org/), [SQLite](https://www.sqlite.org), or [interface](./datastore/interface.go) your own) - Caching ([FreeCache](https://github.com/github.com/coocood/freecache), [Redis](https://redis.io/) or [interface](https://github.com/mrz1836/go-cachestore/blob/master/interface.go) your own) - Task Management ([TaskQ](https://github.com/vmihailenco/taskq) or [interface](taskmanager/interface.go) your own) - Transaction Syncing (queue, broadcast, push to mempool or on-chain, or [interface](chainstate/interface.go) your own) diff --git a/engine/client.go b/engine/client.go index cdbdb252..efa9388e 100644 --- a/engine/client.go +++ b/engine/client.go @@ -30,7 +30,7 @@ type ( cacheStore *cacheStoreOptions // Configuration options for Cachestore (ristretto, redis, etc.) cluster *clusterOptions // Configuration options for the cluster coordinator chainstate *chainstateOptions // Configuration options for Chainstate (broadcast, sync, etc.) - dataStore *dataStoreOptions // Configuration options for the DataStore (MySQL, etc.) + dataStore *dataStoreOptions // Configuration options for the DataStore (PostgreSQL, etc.) debug bool // If the client is in debug mode encryptionKey string // Encryption key for encrypting sensitive information (IE: paymail xPub) (hex encoded key) httpClient HTTPInterface // HTTP interface to use diff --git a/engine/client_datastore.go b/engine/client_datastore.go index 199f9078..751ec876 100644 --- a/engine/client_datastore.go +++ b/engine/client_datastore.go @@ -2,9 +2,6 @@ package engine import ( "encoding/json" - - "go.mongodb.org/mongo-driver/mongo" - "go.mongodb.org/mongo-driver/x/bsonx" ) const ( @@ -82,80 +79,3 @@ func processXpubMetadataConditions(conditions map[string]interface{}) { } delete(conditions, "xpub_metadata") } - -// getMongoIndexes will get indexes from mongo -func getMongoIndexes() map[string][]mongo.IndexModel { - return map[string][]mongo.IndexModel{ - "block_headers": { - mongo.IndexModel{Keys: bsonx.Doc{{ - Key: "height", - Value: bsonx.Int32(1), - }}}, - mongo.IndexModel{Keys: bsonx.Doc{{ - Key: "synced", - Value: bsonx.Int32(1), - }}}, - }, - "destinations": { - mongo.IndexModel{Keys: bsonx.Doc{{ - Key: "address", - Value: bsonx.Int32(1), - }}}, - }, - "draft_transactions": { - mongo.IndexModel{Keys: bsonx.Doc{{ - Key: "status", - Value: bsonx.Int32(1), - }}}, - mongo.IndexModel{Keys: bsonx.Doc{{ - Key: "xpub_id", - Value: bsonx.Int32(1), - }, { - Key: "status", - Value: bsonx.Int32(1), - }}}, - }, - "transactions": { - mongo.IndexModel{Keys: bsonx.Doc{{ - Key: "xpub_metadata.x", - Value: bsonx.Int32(1), - }, { - Key: "xpub_metadata.k", - Value: bsonx.Int32(1), - }, { - Key: "xpub_metadata.v", - Value: bsonx.Int32(1), - }}}, - mongo.IndexModel{Keys: bsonx.Doc{{ - Key: "xpub_in_ids", - Value: bsonx.Int32(1), - }}}, - mongo.IndexModel{Keys: bsonx.Doc{{ - Key: "xpub_out_ids", - Value: bsonx.Int32(1), - }}}, - }, - "utxos": { - mongo.IndexModel{Keys: bsonx.Doc{{ - Key: "transaction_id", - Value: bsonx.Int32(1), - }, { - Key: "output_index", - Value: bsonx.Int32(1), - }}}, - mongo.IndexModel{Keys: bsonx.Doc{{ - Key: "xpub_id", - Value: bsonx.Int32(1), - }, { - Key: "type", - Value: bsonx.Int32(1), - }, { - Key: "draft_id", - Value: bsonx.Int32(1), - }, { - Key: "spending_tx_id", - Value: bsonx.Int32(1), - }}}, - }, - } -} diff --git a/engine/client_internal.go b/engine/client_internal.go index ce7d20f8..db4ee758 100644 --- a/engine/client_internal.go +++ b/engine/client_internal.go @@ -73,18 +73,6 @@ func (c *Client) loadDatastore(ctx context.Context) (err error) { }, )) - // Add custom mongo processor - c.options.dataStore.options = append( - c.options.dataStore.options, - datastore.WithCustomMongoConditionProcessor(processCustomFields), - ) - - // Add custom mongo indexes - c.options.dataStore.options = append( - c.options.dataStore.options, - datastore.WithCustomMongoIndexer(getMongoIndexes), - ) - // Load the datastore client c.options.dataStore.ClientInterface, err = datastore.NewClient( ctx, c.options.dataStore.options..., diff --git a/engine/client_options.go b/engine/client_options.go index 15944906..97449bb1 100644 --- a/engine/client_options.go +++ b/engine/client_options.go @@ -26,7 +26,6 @@ import ( "github.com/rs/zerolog" "github.com/tonicpow/go-minercraft/v2" taskq "github.com/vmihailenco/taskq/v3" - "go.mongodb.org/mongo-driver/mongo" ) // ClientOps allow functional options to be supplied that overwrite default client options. @@ -417,7 +416,7 @@ func WithSQLConfigs(engine datastore.Engine, configs []*datastore.SQLConfig) Cli } } -// WithSQLConnection will set the Datastore to an existing connection for MySQL or PostgreSQL +// WithSQLConnection will set the Datastore to an existing connection for PostgreSQL func WithSQLConnection(engine datastore.Engine, sqlDB *sql.DB, tablePrefix string) ClientOps { return func(c *clientOptions) { if sqlDB != nil && !engine.IsEmpty() { @@ -429,27 +428,6 @@ func WithSQLConnection(engine datastore.Engine, sqlDB *sql.DB, tablePrefix strin } } -// WithMongoDB will set the Datastore to use MongoDB -func WithMongoDB(config *datastore.MongoDBConfig) ClientOps { - return func(c *clientOptions) { - if config != nil { - c.dataStore.options = append(c.dataStore.options, datastore.WithMongo(config)) - } - } -} - -// WithMongoConnection will set the Datastore to an existing connection for MongoDB -func WithMongoConnection(database *mongo.Database, tablePrefix string) ClientOps { - return func(c *clientOptions) { - if database != nil { - c.dataStore.options = append( - c.dataStore.options, - datastore.WithMongoConnection(database, tablePrefix), - ) - } - } -} - // ----------------------------------------------------------------- // PAYMAIL // ----------------------------------------------------------------- diff --git a/engine/datastore/client.go b/engine/datastore/client.go index 11e9a453..a7562d79 100644 --- a/engine/datastore/client.go +++ b/engine/datastore/client.go @@ -6,7 +6,6 @@ import ( zLogger "github.com/mrz1836/go-logger" "github.com/newrelic/go-agent/v3/newrelic" - "go.mongodb.org/mongo-driver/mongo" "gorm.io/gorm" gLogger "gorm.io/gorm/logger" ) @@ -23,26 +22,22 @@ type ( autoMigrate bool // Setting for Auto Migration of SQL tables db *gorm.DB // Database connection for Read-Only requests (can be same as Write) debug bool // Setting for global debugging - engine Engine // Datastore engine (MySQL, PostgreSQL, SQLite) + engine Engine // Datastore engine (PostgreSQL, SQLite) fields *fieldConfig // Configuration for custom fields logger zLogger.GormLoggerInterface // Custom logger interface (standard interface) loggerDB gLogger.Interface // Custom logger interface (for GORM) migratedModels []string // List of models (types) that have been migrated migrateModels []interface{} // Models for migrations - mongoDB *mongo.Database // Database connection for a MongoDB datastore - mongoDBConfig *MongoDBConfig // Configuration for a MongoDB datastore newRelicEnabled bool // If NewRelic is enabled (parent application) - sqlConfigs []*SQLConfig // Configuration for a MySQL or PostgreSQL datastore + sqlConfigs []*SQLConfig // Configuration for a PostgreSQL datastore sqLite *SQLiteConfig // Configuration for a SQLite datastore tablePrefix string // Model table prefix } // fieldConfig is the configuration for custom fields fieldConfig struct { - arrayFields []string // Fields that are an array (string, string, string) - customMongoConditionProcessor func(conditions map[string]interface{}) // Function for processing custom conditions (arrays, objects) - customMongoIndexer func() map[string][]mongo.IndexModel // Function for returning custom mongo indexes - objectFields []string // Fields that are objects/JSON (metadata) + arrayFields []string // Fields that are an array (string, string, string) + objectFields []string // Fields that are objects/JSON (metadata) } ) @@ -96,18 +91,12 @@ func NewClient(ctx context.Context, opts ...ClientOps) (ClientInterface, error) // Use different datastore configurations var err error - if client.Engine() == MySQL || client.Engine() == PostgreSQL { + if client.Engine() == PostgreSQL { if client.options.db, err = openSQLDatabase( client.options.loggerDB, client.options.sqlConfigs..., ); err != nil { return nil, err } - } else if client.Engine() == MongoDB { - if client.options.mongoDB, err = openMongoDatabase( - ctx, client.options.mongoDBConfig, - ); err != nil { - return nil, err - } } else { // SQLite if client.options.db, err = openSQLiteDatabase( client.options.loggerDB, client.options.sqLite, @@ -133,18 +122,10 @@ func (c *Client) Close(ctx context.Context) error { defer txn.StartSegment("close_datastore").End() } - // Close Mongo - if c.Engine() == MongoDB { - if err := c.options.mongoDB.Client().Disconnect(ctx); err != nil { - return err - } - c.options.mongoDB = nil - } else { // All other SQL database(s) - if err := closeSQLDatabase(c.options.db); err != nil { - return err - } - c.options.db = nil + if err := closeSQLDatabase(c.options.db); err != nil { + return err } + c.options.db = nil c.options.engine = Empty return nil @@ -177,10 +158,8 @@ func (c *Client) GetTableName(modelName string) string { // GetDatabaseName will return the full database name for the given model name func (c *Client) GetDatabaseName() string { - if c.Engine() == MySQL || c.Engine() == PostgreSQL { + if c.Engine() == PostgreSQL { return c.options.sqlConfigs[0].Name - } else if c.Engine() == MongoDB { - return c.options.mongoDBConfig.DatabaseName } return "" @@ -196,22 +175,6 @@ func (c *Client) GetObjectFields() []string { return c.options.fields.objectFields } -// GetMongoConditionProcessor will return a custom mongo condition processor if set -func (c *Client) GetMongoConditionProcessor() func(conditions map[string]interface{}) { - if c.options.fields.customMongoConditionProcessor != nil { - return c.options.fields.customMongoConditionProcessor - } - return nil -} - -// GetMongoIndexer will return a custom mongo condition indexer -func (c *Client) GetMongoIndexer() func() map[string][]mongo.IndexModel { - if c.options.fields.customMongoIndexer != nil { - return c.options.fields.customMongoIndexer - } - return nil -} - // HasMigratedModel will return if the model type has been migrated func (c *Client) HasMigratedModel(modelType string) bool { for _, t := range c.options.migratedModels { diff --git a/engine/datastore/client_options.go b/engine/datastore/client_options.go index ee53439a..bfc08daa 100644 --- a/engine/datastore/client_options.go +++ b/engine/datastore/client_options.go @@ -6,7 +6,6 @@ import ( zLogger "github.com/mrz1836/go-logger" "github.com/newrelic/go-agent/v3/newrelic" - "go.mongodb.org/mongo-driver/mongo" ) // ClientOps allow functional options to be supplied @@ -97,7 +96,7 @@ func WithSQLite(config *SQLiteConfig) ClientOps { func WithSQL(engine Engine, configs []*SQLConfig) ClientOps { return func(c *clientOptions) { // Do not set if engine is wrong - if engine != MySQL && engine != PostgreSQL { + if engine != PostgreSQL { return } @@ -129,11 +128,11 @@ func WithSQL(engine Engine, configs []*SQLConfig) ClientOps { } } -// WithSQLConnection will set the datastore to an existing connection for MySQL or PostgreSQL +// WithSQLConnection will set the datastore to an existing connection for PostgreSQL func WithSQLConnection(engine Engine, sqlDB *sql.DB, tablePrefix string) ClientOps { return func(c *clientOptions) { // Do not set if engine is wrong - if engine != MySQL && engine != PostgreSQL { + if engine != PostgreSQL { return } @@ -142,61 +141,19 @@ func WithSQLConnection(engine Engine, sqlDB *sql.DB, tablePrefix string) ClientO return } - // this was set for mock testing in MySQL - // failed to initialize database, got error all expectations were already fulfilled, - // call to Query 'SELECT VERSION()' with args [] was not expected - skipInitializeWithVersion := false - if engine == MySQL { - skipInitializeWithVersion = true - } - c.sqlConfigs = []*SQLConfig{{ CommonConfig: CommonConfig{ Debug: c.debug, TablePrefix: tablePrefix, }, - Driver: engine.String(), - ExistingConnection: sqlDB, - SkipInitializeWithVersion: skipInitializeWithVersion, + Driver: engine.String(), + ExistingConnection: sqlDB, }} c.engine = engine c.tablePrefix = tablePrefix } } -// WithMongo will set the datastore to use MongoDB -func WithMongo(config *MongoDBConfig) ClientOps { - return func(c *clientOptions) { - if config == nil { - return - } - c.engine = MongoDB - c.tablePrefix = config.TablePrefix - c.mongoDBConfig = config - if config.Debug { - c.debug = true - } - } -} - -// WithMongoConnection will set the datastore to use an existing Mongo database connection -func WithMongoConnection(database *mongo.Database, tablePrefix string) ClientOps { - return func(c *clientOptions) { - if database == nil { - return - } - c.engine = MongoDB - c.tablePrefix = tablePrefix - c.mongoDBConfig = &MongoDBConfig{ - CommonConfig: CommonConfig{ - Debug: c.debug, - TablePrefix: tablePrefix, - }, - ExistingConnection: database, - } - } -} - // WithLogger will set the custom logger interface func WithLogger(customLogger zLogger.GormLoggerInterface) ClientOps { return func(c *clientOptions) { @@ -225,21 +182,3 @@ func WithCustomFields(arrayFields []string, objectFields []string) ClientOps { } } } - -// WithCustomMongoConditionProcessor will add a custom mongo condition processor function -func WithCustomMongoConditionProcessor(f func(conditions map[string]interface{})) ClientOps { - return func(c *clientOptions) { - if f != nil { - c.fields.customMongoConditionProcessor = f - } - } -} - -// WithCustomMongoIndexer will add a custom mongo index function (returns custom mongo indexes) -func WithCustomMongoIndexer(f func() map[string][]mongo.IndexModel) ClientOps { - return func(c *clientOptions) { - if f != nil { - c.fields.customMongoIndexer = f - } - } -} diff --git a/engine/datastore/client_options_test.go b/engine/datastore/client_options_test.go index e0e1e8f6..a9438db2 100644 --- a/engine/datastore/client_options_test.go +++ b/engine/datastore/client_options_test.go @@ -2,7 +2,6 @@ package datastore import ( "context" - "database/sql" "os" "testing" @@ -10,7 +9,6 @@ import ( "github.com/newrelic/go-agent/v3/newrelic" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.mongodb.org/mongo-driver/mongo" ) // TestDefaultClientOptions will test the method defaultClientOptions() @@ -167,58 +165,6 @@ func TestWithSQL(t *testing.T) { assert.Equal(t, Engine(""), options.engine) assert.Nil(t, options.sqlConfigs) }) - - t.Run("test applying empty config", func(t *testing.T) { - options := &clientOptions{} - opt := WithSQL(MySQL, nil) - opt(options) - assert.Equal(t, Engine(""), options.engine) - assert.Nil(t, options.sqlConfigs) - }) - - t.Run("test applying option - mysql", func(t *testing.T) { - options := &clientOptions{} - config := &SQLConfig{ - CommonConfig: CommonConfig{ - Debug: true, - TablePrefix: testTablePrefix, - }, - Driver: MySQL.String(), - Host: testDatabaseHost, - Name: testDatabaseName, - Password: testDatabasePassword, - Port: testDatabasePortMySQL, - User: testDatabaseUser, - } - opt := WithSQL(MySQL, []*SQLConfig{config}) - opt(options) - assert.Len(t, options.sqlConfigs, 1) - assert.Equal(t, MySQL, options.engine) - assert.Equal(t, config.TablePrefix, options.tablePrefix) - assert.True(t, options.debug) - }) - - t.Run("test applying option - postgresql", func(t *testing.T) { - options := &clientOptions{} - config := &SQLConfig{ - CommonConfig: CommonConfig{ - Debug: true, - TablePrefix: testTablePrefix, - }, - Driver: PostgreSQL.String(), - Host: testDatabaseHost, - Name: testDatabaseName, - Password: testDatabasePassword, - Port: testDatabasePortMySQL, - User: testDatabaseUser, - } - opt := WithSQL(PostgreSQL, []*SQLConfig{config}) - opt(options) - assert.Len(t, options.sqlConfigs, 1) - assert.Equal(t, PostgreSQL, options.engine) - assert.Equal(t, config.TablePrefix, options.tablePrefix) - assert.True(t, options.debug) - }) } // TestWithSQLConnection will test the method WithSQLConnection() @@ -235,81 +181,6 @@ func TestWithSQLConnection(t *testing.T) { assert.Equal(t, Engine(""), options.engine) assert.Nil(t, options.sqlConfigs) }) - - t.Run("test applying empty connection", func(t *testing.T) { - options := &clientOptions{} - opt := WithSQLConnection(MySQL, nil, testTablePrefix) - opt(options) - assert.Equal(t, Engine(""), options.engine) - assert.Nil(t, options.sqlConfigs) - }) - - t.Run("test applying a connection", func(t *testing.T) { - options := &clientOptions{} - opt := WithSQLConnection(MySQL, &sql.DB{}, testTablePrefix) - opt(options) - assert.Equal(t, MySQL, options.engine) - assert.Len(t, options.sqlConfigs, 1) - assert.Equal(t, testTablePrefix, options.tablePrefix) - }) -} - -// TestWithMongo will test the method WithMongo() -func TestWithMongo(t *testing.T) { - t.Run("check type", func(t *testing.T) { - opt := WithMongo(nil) - assert.IsType(t, *new(ClientOps), opt) - }) - - t.Run("test applying nil config", func(t *testing.T) { - options := &clientOptions{} - opt := WithMongo(nil) - opt(options) - assert.Equal(t, Engine(""), options.engine) - assert.Nil(t, options.mongoDB) - }) - - t.Run("test applying valid config", func(t *testing.T) { - options := &clientOptions{} - opt := WithMongo(&MongoDBConfig{ - CommonConfig: CommonConfig{ - Debug: true, - TablePrefix: testTablePrefix, - }, - DatabaseName: testDatabaseName, - URI: testDatabaseURI, - }) - opt(options) - assert.Equal(t, MongoDB, options.engine) - assert.NotNil(t, options.mongoDBConfig) - assert.Equal(t, testTablePrefix, options.tablePrefix) - assert.True(t, options.debug) - }) -} - -// TestWithMongoConnection will test the method WithMongoConnection() -func TestWithMongoConnection(t *testing.T) { - t.Run("check type", func(t *testing.T) { - opt := WithMongoConnection(nil, testTablePrefix) - assert.IsType(t, *new(ClientOps), opt) - }) - - t.Run("test applying nil config", func(t *testing.T) { - options := &clientOptions{} - opt := WithMongoConnection(nil, testTablePrefix) - opt(options) - assert.Equal(t, Engine(""), options.engine) - assert.Nil(t, options.mongoDB) - }) - - t.Run("test applying valid config", func(t *testing.T) { - options := &clientOptions{} - opt := WithMongoConnection(&mongo.Database{}, testTablePrefix) - opt(options) - assert.Equal(t, MongoDB, options.engine) - assert.NotNil(t, options.mongoDBConfig) - assert.Equal(t, testTablePrefix, options.tablePrefix) - }) } // TestWithLogger will test the method WithLogger() diff --git a/engine/datastore/client_test.go b/engine/datastore/client_test.go index e904740e..26dda291 100644 --- a/engine/datastore/client_test.go +++ b/engine/datastore/client_test.go @@ -87,17 +87,7 @@ func TestClient_Engine(t *testing.T) { assert.Equal(t, SQLite, c.Engine()) }) - t.Run("[mongo] - failed to load", func(t *testing.T) { - c, err := NewClient(context.Background(), WithMongo(&MongoDBConfig{ - DatabaseName: "test", - Transactions: false, - URI: "", - })) - assert.Nil(t, c) - require.Error(t, err) - }) - - // todo: add MySQL, Postgresql and MongoDB + // todo: Postgresql } // TestClient_GetTableName will test the method GetTableName() diff --git a/engine/datastore/datastore_test.go b/engine/datastore/datastore_test.go index 3c82341f..cd046fb6 100644 --- a/engine/datastore/datastore_test.go +++ b/engine/datastore/datastore_test.go @@ -1,12 +1,10 @@ package datastore const ( - testDatabaseHost = "localhost" - testDatabaseName = "test_db" - testDatabasePassword = "some_unique_password" - testDatabasePortMySQL = "3306" - testDatabaseURI = "mongodb://localhost:3333/" + testDatabaseName - testDatabaseUser = "some_username" - testTablePrefix = "test" - testModelName = "test_model" + testDatabaseHost = "localhost" + testDatabaseName = "test_db" + testDatabasePassword = "some_unique_password" + testDatabaseUser = "some_username" + testTablePrefix = "test" + testModelName = "test_model" ) diff --git a/engine/datastore/definitions.go b/engine/datastore/definitions.go index dfea985c..b13fe93e 100644 --- a/engine/datastore/definitions.go +++ b/engine/datastore/definitions.go @@ -14,8 +14,6 @@ const ( defaultDatabaseMaxIdleTime = 360 * time.Second // Default max idle open connection time defaultDatabaseMaxTimeout = 60 * time.Second // Default max timeout on a query defaultDatabaseTxTimeout = 10 * time.Second // Default transaction timeout - defaultMySQLHost = "localhost" // Default host for MySQL - defaultMySQLPort = "3306" // Default port for MySQL defaultPageSize = 20 // The default amount of results to return defaultPostgreSQLHost = "localhost" // Default host for PostgreSQL defaultPostgreSQLPort = "5432" // Default port for PostgreSQL @@ -78,21 +76,20 @@ type CommonConfig struct { TablePrefix string `json:"table_prefix" mapstructure:"table_prefix"` // pre_users (pre) } -// SQLConfig is the configuration for each SQL connection (mysql or postgresql) +// SQLConfig is the configuration for each SQL connection (postgresql) type SQLConfig struct { - CommonConfig `json:",inline" mapstructure:",squash"` // Common configuration - Driver string `json:"driver" mapstructure:"driver"` // mysql or postgresql - ExistingConnection *sql.DB `json:"-" mapstructure:"-"` // Used for existing database connection - Host string `json:"host" mapstructure:"host"` // database host IE: localhost - Name string `json:"name" mapstructure:"name"` // database-name - Password string `json:"password" mapstructure:"password" encrypted:"true"` // user-password - Port string `json:"port" mapstructure:"port"` // 3306 - Replica bool `json:"replica" mapstructure:"replica"` // True if it's a replica (Read-Only) - SkipInitializeWithVersion bool `json:"skip_initialize_with_version" mapstructure:"skip_initialize_with_version"` // Skip using MySQL in test mode - TimeZone string `json:"time_zone" mapstructure:"time_zone"` // timezone (IE: Asia/Shanghai) - TxTimeout time.Duration `json:"tx_timeout" mapstructure:"tx_timeout"` // 5*time.Second - User string `json:"user" mapstructure:"user"` // database username - SslMode string `json:"ssl_mode" mapstructure:"ssl_mode"` // ssl mode (for PostgreSQL) [disable|allow|prefer|require|verify-ca|verify-full] + CommonConfig `json:",inline" mapstructure:",squash"` // Common configuration + Driver string `json:"driver" mapstructure:"driver"` // postgresql + ExistingConnection *sql.DB `json:"-" mapstructure:"-"` // Used for existing database connection + Host string `json:"host" mapstructure:"host"` // database host IE: localhost + Name string `json:"name" mapstructure:"name"` // database-name + Password string `json:"password" mapstructure:"password" encrypted:"true"` // user-password + Port string `json:"port" mapstructure:"port"` // 3306 + Replica bool `json:"replica" mapstructure:"replica"` // True if it's a replica (Read-Only) + TimeZone string `json:"time_zone" mapstructure:"time_zone"` // timezone (IE: Asia/Shanghai) + TxTimeout time.Duration `json:"tx_timeout" mapstructure:"tx_timeout"` // 5*time.Second + User string `json:"user" mapstructure:"user"` // database username + SslMode string `json:"ssl_mode" mapstructure:"ssl_mode"` // ssl mode (for PostgreSQL) [disable|allow|prefer|require|verify-ca|verify-full] } // SQLiteConfig is the configuration for each SQLite connection diff --git a/engine/datastore/engine.go b/engine/datastore/engine.go index dcb86a49..7f44f8f6 100644 --- a/engine/datastore/engine.go +++ b/engine/datastore/engine.go @@ -6,8 +6,6 @@ type Engine string // Supported engines (databases) const ( Empty Engine = "empty" - MongoDB Engine = "mongodb" - MySQL Engine = "mysql" PostgreSQL Engine = "postgresql" SQLite Engine = "sqlite" ) @@ -21,7 +19,6 @@ const ( // SQLDatabases is the list of supported SQL databases (via GORM) var SQLDatabases = []Engine{ - MySQL, PostgreSQL, SQLite, } diff --git a/engine/datastore/engine_test.go b/engine/datastore/engine_test.go index 12c88ccb..458d593b 100644 --- a/engine/datastore/engine_test.go +++ b/engine/datastore/engine_test.go @@ -10,8 +10,6 @@ import ( func TestEngine_String(t *testing.T) { t.Run("valid name", func(t *testing.T) { assert.Equal(t, "empty", Empty.String()) - assert.Equal(t, "mongodb", MongoDB.String()) - assert.Equal(t, "mysql", MySQL.String()) assert.Equal(t, "postgresql", PostgreSQL.String()) assert.Equal(t, "sqlite", SQLite.String()) }) @@ -22,22 +20,16 @@ func TestEngine_IsEmpty(t *testing.T) { t.Run("actually empty", func(t *testing.T) { assert.True(t, Empty.IsEmpty()) }) - - t.Run("not empty", func(t *testing.T) { - assert.False(t, MySQL.IsEmpty()) - }) } // TestIsSQLEngine will test the method IsSQLEngine() func TestIsSQLEngine(t *testing.T) { t.Run("test sql databases", func(t *testing.T) { - assert.True(t, IsSQLEngine(MySQL)) assert.True(t, IsSQLEngine(PostgreSQL)) assert.True(t, IsSQLEngine(SQLite)) }) t.Run("test other databases", func(t *testing.T) { - assert.False(t, IsSQLEngine(MongoDB)) assert.False(t, IsSQLEngine(Empty)) }) } diff --git a/engine/datastore/index.go b/engine/datastore/index.go index 1ab359ba..83a53505 100644 --- a/engine/datastore/index.go +++ b/engine/datastore/index.go @@ -1,85 +1,16 @@ package datastore -import ( - "context" - - "go.mongodb.org/mongo-driver/bson" - "go.mongodb.org/mongo-driver/mongo" -) - // IndexExists check whether the given index exists in the datastore func (c *Client) IndexExists(tableName, indexName string) (bool, error) { - if c.Engine() == MySQL { - return c.indexExistsMySQL(tableName, indexName) - } - return false, ErrUnknownSQL } -// indexExistsMySQL is unique for MySQL -func (c *Client) indexExistsMySQL(tableName, indexName string) (bool, error) { - indexQuery := `SELECT 1 - FROM INFORMATION_SCHEMA.STATISTICS - WHERE TABLE_SCHEMA = '` + c.GetDatabaseName() + `' - AND TABLE_NAME = '` + tableName + `' - AND INDEX_NAME = '` + indexName + `'` - - tx := c.Raw(indexQuery) - if tx.Error != nil { - return false, tx.Error - } - - var count int - if tx = tx.Scan(&count); tx.Error != nil { - return false, tx.Error - } - return count > 0, nil -} - // IndexMetadata check and creates the metadata json index func (c *Client) IndexMetadata(tableName, field string) error { indexName := "idx_" + tableName + "_" + field - if c.Engine() == MySQL { //nolint:revive // leave for comment - /* - //No way to index JSON in a generic way in MySQL? - - // workaround is to index the keys you are using yourself in the database - ALTER TABLE tableName - ADD new_column_name VARCHAR(255) - AS (metadata->>'$.columnName') STORED - ADD INDEX (new_column_name) - - exists, err := c.indexExistsMySQL(tableName, indexName) - if err != nil { - return err - } - if !exists { - query := "" - tx := c.Execute(query) - return tx.Error - } - */ - } else if c.Engine() == PostgreSQL { + if c.Engine() == PostgreSQL { tx := c.Execute(`CREATE INDEX IF NOT EXISTS ` + indexName + ` ON ` + tableName + ` USING gin (` + field + ` jsonb_path_ops)`) return tx.Error - } else if c.Engine() == MongoDB { - ctx := context.Background() - - // todo: this changed in the new version of mongo (needs to be tested) - /*return createMongoIndex(ctx, c.options, tableName, true, mongo.IndexModel{Keys: bsonx.Doc{{ - Key: metadataField + ".k", - Value: bsonx.Int32(1), - }, { - Key: metadataField + ".v", - Value: bsonx.Int32(1), - }}})*/ - - return createMongoIndex(ctx, c.options, tableName, true, mongo.IndexModel{ - Keys: bson.D{ - {Key: metadataField + ".k", Value: 1}, - {Key: metadataField + ".v", Value: 1}, - }, - }) } return nil diff --git a/engine/datastore/interface.go b/engine/datastore/interface.go index 8858dcb9..70a2b939 100644 --- a/engine/datastore/interface.go +++ b/engine/datastore/interface.go @@ -4,7 +4,6 @@ import ( "context" "time" - "go.mongodb.org/mongo-driver/mongo" "gorm.io/gorm" ) @@ -36,10 +35,6 @@ type StorageService interface { type GetterInterface interface { GetArrayFields() []string GetDatabaseName() string - GetMongoCollection(collectionName string) *mongo.Collection - GetMongoCollectionByTableName(tableName string) *mongo.Collection - GetMongoConditionProcessor() func(conditions map[string]interface{}) - GetMongoIndexer() func() map[string][]mongo.IndexModel GetObjectFields() []string GetTableName(modelName string) string } diff --git a/engine/datastore/migrate.go b/engine/datastore/migrate.go index fd8b94d6..165de543 100644 --- a/engine/datastore/migrate.go +++ b/engine/datastore/migrate.go @@ -6,8 +6,6 @@ import ( "fmt" "github.com/newrelic/go-agent/v3/newrelic" - "go.mongodb.org/mongo-driver/mongo" - mongoOptions "go.mongodb.org/mongo-driver/mongo/options" "gorm.io/gorm" "gorm.io/gorm/logger" ) @@ -21,10 +19,8 @@ func (c *Client) AutoMigrateDatabase(ctx context.Context, models ...interface{}) } // Make sure we have a supported engine - if c.Engine() != MySQL && - c.Engine() != PostgreSQL && - c.Engine() != SQLite && - c.Engine() != MongoDB { + if c.Engine() != PostgreSQL && + c.Engine() != SQLite { return ErrUnsupportedEngine } @@ -45,11 +41,6 @@ func (c *Client) AutoMigrateDatabase(ctx context.Context, models ...interface{}) c.options.migratedModels, )) - // Migrate database for Mongo - if c.Engine() == MongoDB { - return autoMigrateMongoDatabase(ctx, c.Engine(), c.options, models...) - } - // Migrate database for SQL (using GORM) return autoMigrateSQLDatabase(ctx, c.Engine(), c.options.db, c.IsDebug(), c.options.loggerDB, models...) } @@ -59,43 +50,6 @@ func (c *Client) IsAutoMigrate() bool { return c.options.autoMigrate } -// autoMigrateMongoDatabase will start a new database for Mongo -func autoMigrateMongoDatabase(ctx context.Context, _ Engine, options *clientOptions, - _ ...interface{}, -) error { - var err error - - if options.fields.customMongoIndexer != nil { - for collectionName, idx := range options.fields.customMongoIndexer() { - for _, index := range idx { - if err = createMongoIndex( - ctx, options, collectionName, false, index, - ); err != nil { - return err - } - } - } - } - - return nil -} - -// createMongoIndex will create a mongo index -func createMongoIndex(ctx context.Context, options *clientOptions, modelName string, withPrefix bool, - index mongo.IndexModel, -) error { - collectionName := modelName - if !withPrefix { - collectionName = setPrefix(options.mongoDBConfig.TablePrefix, collectionName) - } - collection := options.mongoDB.Collection(collectionName) - _, err := collection.Indexes().CreateOne( - ctx, index, mongoOptions.CreateIndexes().SetMaxTime(defaultDatabaseCreateIndexTimeout), - ) - - return err -} - // autoMigrateSQLDatabase will attempt to create or update table schema // // See: https://gorm.io/docs/migration.html @@ -111,11 +65,6 @@ func autoMigrateSQLDatabase(ctx context.Context, engine Engine, sqlWriteDB *gorm // Create a session with config settings sessionDb := sqlWriteDB.Session(getGormSessionConfig(sqlWriteDB.PrepareStmt, debug, optionalLogger)) - // Run the auto migrate method - if engine == MySQL { - return sessionDb.Set("gorm:table_options", "ENGINE=InnoDB").AutoMigrate(models...) - } - // PostgreSQL and SQLite return sessionDb.AutoMigrate(models...) } diff --git a/engine/datastore/models.go b/engine/datastore/models.go index 1375af8a..81a4ab5f 100644 --- a/engine/datastore/models.go +++ b/engine/datastore/models.go @@ -23,15 +23,7 @@ func (c *Client) SaveModel( tx *Transaction, newRecord, commitTx bool, ) error { - // MongoDB (does not support transactions at this time) - if c.Engine() == MongoDB { - sessionContext := ctx //nolint:contextcheck // we need to overwrite the ctx for transaction support - if tx.mongoTx != nil { - // set the context to the session context -> mongo transaction - sessionContext = *tx.mongoTx - } - return c.saveWithMongo(sessionContext, model, newRecord) - } else if !IsSQLEngine(c.Engine()) { + if !IsSQLEngine(c.Engine()) { return ErrUnsupportedEngine } @@ -50,7 +42,7 @@ func (c *Client) SaveModel( if newRecord { if err := tx.sqlTx.Omit(clause.Associations).Create(model).Error; err != nil { _ = tx.Rollback() - // todo add duplicate key check for MySQL, Postgres and SQLite + // todo add duplicate key check for Postgres and SQLite return err } } else { @@ -78,9 +70,7 @@ func (c *Client) IncrementModel( fieldName string, increment int64, ) (newValue int64, err error) { - if c.Engine() == MongoDB { - return c.incrementWithMongo(ctx, model, fieldName, increment) - } else if !IsSQLEngine(c.Engine()) { + if !IsSQLEngine(c.Engine()) { return 0, ErrUnsupportedEngine } @@ -119,10 +109,6 @@ func (c *Client) CreateInBatches( models interface{}, batchSize int, ) error { - if c.Engine() == MongoDB { - return c.CreateInBatchesMongo(ctx, models, batchSize) - } - tx := c.options.db.CreateInBatches(models, batchSize) return tx.Error } @@ -151,10 +137,7 @@ func (c *Client) GetModel( timeout time.Duration, forceWriteDB bool, ) error { - // Switch on the datastore engines - if c.Engine() == MongoDB { // Get using Mongo - return c.getWithMongo(ctx, model, conditions, nil, nil) - } else if !IsSQLEngine(c.Engine()) { + if !IsSQLEngine(c.Engine()) { return ErrUnsupportedEngine } @@ -164,7 +147,7 @@ func (c *Client) GetModel( tx := ctxDB.Model(model) - if forceWriteDB && (c.Engine() == MySQL || c.Engine() == PostgreSQL) { + if forceWriteDB && c.Engine() == PostgreSQL { tx = ctxDB.Clauses(dbresolver.Write) } @@ -202,9 +185,7 @@ func (c *Client) GetModels( queryParams.SortDirection = strings.ToLower(queryParams.SortDirection) // Switch on the datastore engines - if c.Engine() == MongoDB { // Get using Mongo - return c.getWithMongo(ctx, models, conditions, fieldResults, queryParams) - } else if !IsSQLEngine(c.Engine()) { + if !IsSQLEngine(c.Engine()) { return ErrUnsupportedEngine } return c.find(ctx, models, conditions, queryParams, fieldResults, timeout) @@ -218,9 +199,7 @@ func (c *Client) GetModelCount( timeout time.Duration, ) (int64, error) { // Switch on the datastore engines - if c.Engine() == MongoDB { - return c.countWithMongo(ctx, model, conditions) - } else if !IsSQLEngine(c.Engine()) { + if !IsSQLEngine(c.Engine()) { return 0, ErrUnsupportedEngine } @@ -232,9 +211,7 @@ func (c *Client) GetModelsAggregate(ctx context.Context, models interface{}, conditions map[string]interface{}, aggregateColumn string, timeout time.Duration, ) (map[string]interface{}, error) { // Switch on the datastore engines - if c.Engine() == MongoDB { - return c.aggregateWithMongo(ctx, models, conditions, aggregateColumn, timeout) - } else if !IsSQLEngine(c.Engine()) { + if !IsSQLEngine(c.Engine()) { return nil, ErrUnsupportedEngine } @@ -343,9 +320,7 @@ func (c *Client) aggregate(ctx context.Context, model interface{}, conditions ma // Check for a known date field if StringInSlice(aggregateCol, DateFields) { - if c.Engine() == MySQL { - aggregateCol = "DATE_FORMAT(" + aggregateCol + ", '%Y%m%d')" - } else if c.Engine() == PostgreSQL { + if c.Engine() == PostgreSQL { aggregateCol = "to_char(" + aggregateCol + ", 'YYYYMMDD')" } else { aggregateCol = "strftime('%Y%m%d', " + aggregateCol + ")" diff --git a/engine/datastore/mongodb.go b/engine/datastore/mongodb.go deleted file mode 100644 index 4997794d..00000000 --- a/engine/datastore/mongodb.go +++ /dev/null @@ -1,583 +0,0 @@ -package datastore - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "reflect" - "time" - - "github.com/newrelic/go-agent/v3/integrations/nrmongo" - "go.mongodb.org/mongo-driver/bson" - "go.mongodb.org/mongo-driver/mongo" - "go.mongodb.org/mongo-driver/mongo/options" - "go.mongodb.org/mongo-driver/mongo/readpref" -) - -const ( - logLine = "MONGO %s %s: %+v\n" - logErrorLine = "MONGO %s %s: %e: %+v\n" -) - -// saveWithMongo will save a given struct to MongoDB -func (c *Client) saveWithMongo( - ctx context.Context, - model interface{}, - newRecord bool, -) (err error) { - collectionName := GetModelTableName(model) - if collectionName == nil { - return ErrUnknownCollection - } - - // Set the collection - collection := c.options.mongoDB.Collection( - setPrefix(c.options.mongoDBConfig.TablePrefix, *collectionName), - ) - - // Create or update - if newRecord { - c.DebugLog(ctx, fmt.Sprintf(logLine, "insert", *collectionName, model)) - _, err = collection.InsertOne(ctx, model) - } else { - id := GetModelStringAttribute(model, sqlIDFieldProper) - update := bson.M{conditionSet: model} - unset := GetModelUnset(model) - if len(unset) > 0 { - update = bson.M{conditionSet: model, conditionUnSet: unset} - } - - c.DebugLog(ctx, fmt.Sprintf(logLine, "update", *collectionName, model)) - - _, err = collection.UpdateOne( - ctx, bson.M{mongoIDField: *id}, update, - ) - } - - // Check for duplicate key (insert error, record exists) - if mongo.IsDuplicateKeyError(err) { - c.DebugLog(ctx, fmt.Sprintf(logErrorLine, "error", *collectionName, ErrDuplicateKey, model)) - return ErrDuplicateKey - } - - if err != nil { - c.DebugLog(ctx, fmt.Sprintf(logErrorLine, "error", *collectionName, err, model)) - } - - return -} - -// incrementWithMongo will save a given struct to MongoDB -func (c *Client) incrementWithMongo( - ctx context.Context, - model interface{}, - fieldName string, - increment int64, -) (newValue int64, err error) { - collectionName := GetModelTableName(model) - if collectionName == nil { - return newValue, ErrUnknownCollection - } - - // Set the collection - collection := c.options.mongoDB.Collection( - setPrefix(c.options.mongoDBConfig.TablePrefix, *collectionName), - ) - - id := GetModelStringAttribute(model, sqlIDFieldProper) - if id == nil { - return newValue, errors.New("can only increment by " + sqlIDField) - } - update := bson.M{conditionIncrement: bson.M{fieldName: increment}} - - c.DebugLog(ctx, fmt.Sprintf(logLine, "increment", *collectionName, model)) - - result := collection.FindOneAndUpdate( - ctx, bson.M{mongoIDField: *id}, update, - ) - if result.Err() != nil { - return newValue, result.Err() - } - var rawValue bson.Raw - if rawValue, err = result.DecodeBytes(); err != nil { - return - } - var newModel map[string]interface{} - _ = bson.Unmarshal(rawValue, &newModel) // todo: cannot check error, breaks code atm - - newValue = newModel[fieldName].(int64) + increment - - if err != nil { - c.DebugLog(ctx, fmt.Sprintf(logErrorLine, "error", *collectionName, err, model)) - } - - return -} - -// CreateInBatchesMongo insert multiple models vai bulk.Write -func (c *Client) CreateInBatchesMongo( - ctx context.Context, - models interface{}, - batchSize int, -) error { - collectionName := GetModelTableName(models) - if collectionName == nil { - return ErrUnknownCollection - } - - mongoModels := make([]mongo.WriteModel, 0) - collection := c.GetMongoCollection(*collectionName) - bulkOptions := options.BulkWrite().SetOrdered(true) - count := 0 - - if reflect.TypeOf(models).Kind() == reflect.Slice { - s := reflect.ValueOf(models) - for i := 0; i < s.Len(); i++ { - m := mongo.NewInsertOneModel() - m.SetDocument(s.Index(i).Interface()) - mongoModels = append(mongoModels, m) - count++ - - if count%batchSize == 0 { - _, err := collection.BulkWrite(ctx, mongoModels, bulkOptions) - if err != nil { - return err - } - // reset the bulk - mongoModels = make([]mongo.WriteModel, 0) - } - } - } - - if count%batchSize != 0 { - _, err := collection.BulkWrite(ctx, mongoModels, bulkOptions) - if err != nil { - return err - } - } - - return nil -} - -// getWithMongo will get given struct(s) from MongoDB -func (c *Client) getWithMongo( - ctx context.Context, - models interface{}, - conditions map[string]interface{}, - fieldResult interface{}, - queryParams *QueryParams, -) error { - queryConditions := getMongoQueryConditions(models, conditions, c.GetMongoConditionProcessor()) - collectionName := GetModelTableName(models) - if collectionName == nil { - return ErrUnknownCollection - } - - // Set the collection - collection := c.options.mongoDB.Collection( - setPrefix(c.options.mongoDBConfig.TablePrefix, *collectionName), - ) - - var fields []string - if fieldResult != nil { - fields = getFieldNames(fieldResult) - } - - if IsModelSlice(models) { - c.DebugLog(ctx, fmt.Sprintf(logLine, "findMany", *collectionName, queryConditions)) - - var opts []*options.FindOptions - if fields != nil { - projection := bson.D{} - for _, field := range fields { - projection = append(projection, bson.E{Key: field, Value: 1}) - } - opts = append(opts, options.Find().SetProjection(projection)) - } - - if queryParams.Page > 0 { - opts = append(opts, options.Find().SetLimit(int64(queryParams.PageSize)).SetSkip(int64(queryParams.PageSize*(queryParams.Page-1)))) - } - - if queryParams.OrderByField == sqlIDField { - queryParams.OrderByField = mongoIDField // use Mongo _id instead of default id field - } - if queryParams.OrderByField != "" { - sortOrder := 1 - if queryParams.SortDirection == SortDesc { - sortOrder = -1 - } - opts = append(opts, options.Find().SetSort(bson.D{{Key: queryParams.OrderByField, Value: sortOrder}})) - } - - cursor, err := collection.Find(ctx, queryConditions, opts...) - if err != nil { - return err - } - if err = cursor.Err(); errors.Is(err, mongo.ErrNoDocuments) { - return ErrNoResults - } else if err != nil { - return cursor.Err() - } - - if fieldResult != nil { - if err = cursor.All(ctx, fieldResult); err != nil { - return err - } - } else { - if err = cursor.All(ctx, models); err != nil { - return err - } - } - } else { - c.DebugLog(ctx, fmt.Sprintf(logLine, "find", *collectionName, queryConditions)) - - var opts []*options.FindOneOptions - if fields != nil { - projection := bson.D{} - for _, field := range fields { - projection = append(projection, bson.E{Key: field, Value: 1}) - } - opts = append(opts, options.FindOne().SetProjection(projection)) - } - - result := collection.FindOne(ctx, queryConditions, opts...) - if err := result.Err(); errors.Is(err, mongo.ErrNoDocuments) { - c.DebugLog(ctx, fmt.Sprintf(logLine, "result", *collectionName, "no result")) - return ErrNoResults - } else if err != nil { - c.DebugLog(ctx, fmt.Sprintf(logLine, "result error", *collectionName, err)) - return result.Err() - } - - if fieldResult != nil { - if err := result.Decode(fieldResult); err != nil { - c.DebugLog(ctx, fmt.Sprintf(logLine, "result error", *collectionName, err)) - return err - } - } else { - if err := result.Decode(models); err != nil { - c.DebugLog(ctx, fmt.Sprintf(logLine, "result error", *collectionName, err)) - return err - } - } - } - - return nil -} - -// countWithMongo will get a count of all models matching the conditions -func (c *Client) countWithMongo( - ctx context.Context, - models interface{}, - conditions map[string]interface{}, -) (int64, error) { - queryConditions := getMongoQueryConditions(models, conditions, c.GetMongoConditionProcessor()) - collectionName := GetModelTableName(models) - if collectionName == nil { - return 0, ErrUnknownCollection - } - - // Set the collection - collection := c.options.mongoDB.Collection( - setPrefix(c.options.mongoDBConfig.TablePrefix, *collectionName), - ) - - c.DebugLog(ctx, fmt.Sprintf(logLine, accumulationCountField, *collectionName, queryConditions)) - - count, err := collection.CountDocuments(ctx, queryConditions) - if err != nil { - return 0, err - } - - return count, nil -} - -// aggregateWithMongo will get a count of all models aggregate by aggregateColumn matching the conditions -func (c *Client) aggregateWithMongo( - ctx context.Context, - models interface{}, - conditions map[string]interface{}, - aggregateColumn string, - timeout time.Duration, -) (map[string]interface{}, error) { - queryConditions := getMongoQueryConditions(models, conditions, c.GetMongoConditionProcessor()) - collectionName := GetModelTableName(models) - if collectionName == nil { - return nil, ErrUnknownCollection - } - - // Set the collection - collection := c.options.mongoDB.Collection( - setPrefix(c.options.mongoDBConfig.TablePrefix, *collectionName), - ) - - c.DebugLog(ctx, fmt.Sprintf(logLine, accumulationCountField, *collectionName, queryConditions)) - - // Marshal the data - var matchStage bson.D - data, err := bson.Marshal(queryConditions) - if err != nil { - return nil, err - } - - // Unmarshal the bson - if err = bson.Unmarshal(data, &matchStage); err != nil { - return nil, err - } - - aggregateOn := bson.E{ - Key: mongoIDField, - Value: "$" + aggregateColumn, - } // default - - // Check for date field - if StringInSlice(aggregateColumn, DateFields) { - aggregateOn = bson.E{ - Key: mongoIDField, - Value: bson.D{ - { - Key: conditionDateToString, - Value: bson.D{ - {Key: "format", Value: "%Y%m%d"}, - {Key: "date", Value: "$" + aggregateColumn}, - }, - }, - }, - } - } - - // Grouping - groupStage := bson.D{{Key: conditionGroup, Value: bson.D{ - aggregateOn, { - Key: accumulationCountField, - Value: bson.D{{ - Key: conditionSum, - Value: 1, - }}, - }, - }}} - - pipeline := mongo.Pipeline{ - bson.D{ - {Key: conditionMatch, Value: matchStage}, - }, groupStage, - } - - // anonymous struct for unmarshalling result bson - var results []struct { - ID string `bson:"_id"` - Count int64 `bson:"count"` - } - - var aggregateCursor *mongo.Cursor - aggregateCtx, cancel := context.WithTimeout(ctx, timeout) - defer cancel() - - // Get the aggregation - if aggregateCursor, err = collection.Aggregate( - aggregateCtx, pipeline, - ); err != nil { - return nil, err - } - - // Cursor: All - if err = aggregateCursor.All(ctx, &results); err != nil { - return nil, err - } - - // Create the result - aggregateResult := make(map[string]interface{}) - for _, result := range results { - aggregateResult[result.ID] = result.Count - } - - return aggregateResult, nil -} - -// GetMongoCollection will get the mongo collection for the given tableName -func (c *Client) GetMongoCollection( - collectionName string, -) *mongo.Collection { - return c.options.mongoDB.Collection( - setPrefix(c.options.mongoDBConfig.TablePrefix, collectionName), - ) -} - -// GetMongoCollectionByTableName will get the mongo collection for the given tableName -func (c *Client) GetMongoCollectionByTableName( - tableName string, -) *mongo.Collection { - return c.options.mongoDB.Collection(tableName) -} - -// getFieldNames will get the field names in a slice of strings -func getFieldNames(fieldResult interface{}) []string { - if fieldResult == nil { - return []string{} - } - - fields := make([]string, 0) - - model := reflect.ValueOf(fieldResult) - if model.Kind() == reflect.Ptr { - model = model.Elem() - } - if model.Kind() == reflect.Slice { - elemType := model.Type().Elem() - fmt.Println(elemType.Kind()) - if elemType.Kind() == reflect.Ptr { - model = reflect.New(elemType.Elem()) - } else { - model = reflect.New(elemType) - } - } - if model.Kind() == reflect.Ptr { - model = model.Elem() - } - - for i := 0; i < model.Type().NumField(); i++ { - field := model.Type().Field(i) - fields = append(fields, field.Tag.Get(bsonTagName)) - } - - return fields -} - -// setPrefix will automatically append the table prefix if found -func setPrefix(prefix, collection string) string { - if len(prefix) > 0 { - return prefix + "_" + collection - } - return collection -} - -// getMongoQueryConditions will build the Mongo query conditions -// this functions tries to mimic the way gorm generates a where clause (naively) -func getMongoQueryConditions( - model interface{}, - conditions map[string]interface{}, - customProcessor func(conditions map[string]interface{}), -) map[string]interface{} { - if conditions == nil { - conditions = map[string]interface{}{} - } else { - // check for id field - _, ok := conditions[sqlIDField] - if ok { - conditions[mongoIDField] = conditions[sqlIDField] - delete(conditions, sqlIDField) - } - - processMongoConditions(conditions, customProcessor) - } - - // add model ID to the query conditions, if set on the model - id := GetModelStringAttribute(model, sqlIDFieldProper) - if id != nil && *id != "" { - conditions[mongoIDField] = *id - } - - return conditions -} - -// processMongoConditions will process all conditions for Mongo, including custom processing -func processMongoConditions(conditions map[string]interface{}, - customProcessor func(conditions map[string]interface{}), -) map[string]interface{} { - // Transform the id field to mongo _id field - _, ok := conditions[sqlIDField] - if ok { - conditions[mongoIDField] = conditions[sqlIDField] - delete(conditions, sqlIDField) - } - - // Transform the map of metadata to key / value query - _, ok = conditions[metadataField] - if ok { - processMetadataConditions(conditions) - } - - // Do we have a custom processor? - if customProcessor != nil { - customProcessor(conditions) - } - - // Handle all conditions post-processing - for key, condition := range conditions { - if key == conditionAnd || key == conditionOr { - var slice []map[string]interface{} - a, _ := json.Marshal(condition) //nolint:errchkjson // this check might break the current code - _ = json.Unmarshal(a, &slice) - var newConditions []map[string]interface{} - for _, c := range slice { - newConditions = append(newConditions, processMongoConditions(c, customProcessor)) //nolint:scopelint,gosec // ignore for now - } - conditions[key] = newConditions - } - } - - return conditions -} - -// processMetadataConditions will process metadata conditions -func processMetadataConditions(conditions map[string]interface{}) { - // marshal / unmarshal into standard map[string]interface{} - m, _ := json.Marshal(conditions[metadataField]) //nolint:errchkjson // this check might break the current code - var r map[string]interface{} - _ = json.Unmarshal(m, &r) - - // Loop and create the key associations - metadata := make([]map[string]interface{}, 0) - for key, value := range r { - metadata = append(metadata, map[string]interface{}{ - metadataField + ".k": key, - metadataField + ".v": value, - }) - } - - // Found some metadata - if len(metadata) > 0 { - _, ok := conditions[conditionAnd] - if ok { - and := conditions[conditionAnd].([]map[string]interface{}) - and = append(and, metadata...) - conditions[conditionAnd] = and - } else { - conditions[conditionAnd] = metadata - } - } - - // Remove the field from conditions - delete(conditions, metadataField) -} - -// openMongoDatabase will open a new database or use an existing connection -func openMongoDatabase(ctx context.Context, config *MongoDBConfig) (*mongo.Database, error) { - // Use an existing connection - if config.ExistingConnection != nil { - return config.ExistingConnection, nil - } - - // Create the new client - nrMon := nrmongo.NewCommandMonitor(nil) - client, err := mongo.Connect( - ctx, - options.Client().SetMonitor(nrMon), - options.Client().ApplyURI(config.URI), - ) - if err != nil { - return nil, err - } - - // Check the connection - if err = client.Ping(ctx, readpref.Primary()); err != nil { - return nil, err - } - - // Return the client - return client.Database( - config.DatabaseName, - ), nil -} diff --git a/engine/datastore/mongodb_test.go b/engine/datastore/mongodb_test.go deleted file mode 100644 index 12a77597..00000000 --- a/engine/datastore/mongodb_test.go +++ /dev/null @@ -1,469 +0,0 @@ -package datastore - -import ( - "encoding/json" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -type mockModel struct { - ID string `json:"id"` -} - -type testStruct struct { - ID string `json:"id" toml:"id" yaml:"hash" bson:"_id"` - CurrentValue uint64 `json:"current_value" toml:"current_value" yaml:"current_value" bson:"current_value"` - InternalNum uint32 `json:"internal_num" toml:"internal_num" yaml:"internal_num" bson:"internal_num"` - ExternalNum uint32 `json:"external_num" toml:"external_num" yaml:"external_num" bson:"external_num"` -} - -const ( - objectMetadataField = "object_metadata" - fieldInIDs = "field_in_ids" - fieldOutIDs = "field_out_ids" -) - -// TestClient_getFieldNames will test the method getFieldNames() -func TestClient_getFieldNames(t *testing.T) { - t.Run("nil value", func(t *testing.T) { - fields := getFieldNames(nil) - assert.Empty(t, fields) - assert.Equal(t, []string{}, fields) - }) - - t.Run("normal struct", func(t *testing.T) { - s := testStruct{} - fields := getFieldNames(s) - assert.Len(t, fields, 4) - assert.Equal(t, []string{mongoIDField, "current_value", "internal_num", "external_num"}, fields) - }) - - t.Run("pointer struct", func(t *testing.T) { - s := &testStruct{} - fields := getFieldNames(s) - assert.Len(t, fields, 4) - assert.Equal(t, []string{mongoIDField, "current_value", "internal_num", "external_num"}, fields) - }) - - t.Run("slice of structs", func(t *testing.T) { - s := []testStruct{} - fields := getFieldNames(s) - assert.Len(t, fields, 4) - assert.Equal(t, []string{mongoIDField, "current_value", "internal_num", "external_num"}, fields) - }) - - t.Run("pointer of slice of structs", func(t *testing.T) { - s := &[]testStruct{} - fields := getFieldNames(s) - assert.Len(t, fields, 4) - assert.Equal(t, []string{mongoIDField, "current_value", "internal_num", "external_num"}, fields) - }) - - t.Run("pointer of slice of pointers of structs", func(t *testing.T) { - s := &[]*testStruct{} - fields := getFieldNames(s) - assert.Len(t, fields, 4) - assert.Equal(t, []string{mongoIDField, "current_value", "internal_num", "external_num"}, fields) - }) -} - -// TestClient_getMongoQueryConditions will test the method getMongoQueryConditions() -func TestClient_getMongoQueryConditions(t *testing.T) { - t.Run("nil value", func(t *testing.T) { - condition := map[string]interface{}{} - queryConditions := getMongoQueryConditions(Transaction{}, condition, nil) - assert.Equal(t, map[string]interface{}{}, queryConditions) - }) - - t.Run("simple", func(t *testing.T) { - condition := map[string]interface{}{ - "test-key": "test-value", - } - queryConditions := getMongoQueryConditions(Transaction{}, condition, nil) - assert.Equal(t, map[string]interface{}{"test-key": "test-value"}, queryConditions) - }) - - t.Run("test "+sqlIDFieldProper, func(t *testing.T) { - condition := map[string]interface{}{} - queryConditions := getMongoQueryConditions(mockModel{ - ID: "identifier", - }, condition, nil) - assert.Equal(t, map[string]interface{}{mongoIDField: "identifier"}, queryConditions) - }) - - t.Run(conditionOr+" "+sqlIDFieldProper, func(t *testing.T) { - condition := map[string]interface{}{ - conditionOr: []map[string]interface{}{{ - sqlIDField: "test-key", - }}, - } - queryConditions := getMongoQueryConditions(nil, condition, nil) - expected := map[string]interface{}{ - conditionOr: []map[string]interface{}{{ - mongoIDField: "test-key", - }}, - } - assert.Equal(t, expected, queryConditions) - }) - - t.Run(conditionAnd+" "+conditionOr+" "+sqlIDFieldProper, func(t *testing.T) { - condition := map[string]interface{}{ - metadataField: map[string]interface{}{}, - conditionAnd: []map[string]interface{}{{ - conditionOr: []map[string]interface{}{{ - sqlIDField: "test-key", - }}, - }}, - } - queryConditions := getMongoQueryConditions(nil, condition, nil) - expected := map[string]interface{}{ - conditionAnd: []map[string]interface{}{{ - conditionOr: []map[string]interface{}{{ - mongoIDField: "test-key", - }}, - }}, - } - assert.Equal(t, expected, queryConditions) - }) - - t.Run("embedded "+sqlIDFieldProper, func(t *testing.T) { - condition := map[string]interface{}{ - conditionAnd: []map[string]interface{}{{ - metadataField: map[string]interface{}{ - "test-key": "test-value", - }, - }, { - sqlIDField: "identifier", - }}, - } - expected := map[string]interface{}{ - conditionAnd: []map[string]interface{}{{ - conditionAnd: []map[string]interface{}{{ - metadataField + ".k": "test-key", metadataField + ".v": "test-value", - }}, - }, { - mongoIDField: "identifier", - }}, - } - queryConditions := getMongoQueryConditions(mockModel{}, condition, nil) - assert.Equal(t, expected, queryConditions) - }) - - t.Run(metadataField, func(t *testing.T) { - condition := map[string]interface{}{ - metadataField: map[string]interface{}{ - "test-key": "test-value", - }, - } - queryConditions := getMongoQueryConditions(mockModel{}, condition, nil) - expected := map[string]interface{}{ - conditionAnd: []map[string]interface{}{{ - metadataField + ".k": "test-key", - metadataField + ".v": "test-value", - }}, - } - assert.Equal(t, expected, queryConditions) - }) - - t.Run(metadataField+" test 2", func(t *testing.T) { - condition := map[string]interface{}{ - metadataField: map[string]interface{}{ - "test-key": "test-value", - "test-key2": "test-value2", - }, - } - queryConditions := getMongoQueryConditions(mockModel{}, condition, nil) - expected := []map[string]interface{}{{ - metadataField + ".k": "test-key", - metadataField + ".v": "test-value", - }, { - metadataField + ".k": "test-key2", - metadataField + ".v": "test-value2", - }} - assert.Len(t, queryConditions[conditionAnd], 2) - assert.Contains(t, expected, queryConditions[conditionAnd].([]map[string]interface{})[0]) - assert.Contains(t, expected, queryConditions[conditionAnd].([]map[string]interface{})[1]) - }) - - t.Run(metadataField+" test 3", func(t *testing.T) { - condition := map[string]interface{}{ - metadataField: map[string]interface{}{ - "test-key": "test-value", - "test-key2": "test-value2", - }, - conditionAnd: []map[string]interface{}{{ - "amount": map[string]interface{}{ - conditionLessThan: 98, - }, - }}, - } - queryConditions := getMongoQueryConditions(mockModel{}, condition, nil) - expected := []map[string]interface{}{{ - metadataField + ".k": "test-key", - metadataField + ".v": "test-value", - }, { - metadataField + ".k": "test-key2", - metadataField + ".v": "test-value2", - }, { - "amount": map[string]interface{}{ - conditionLessThan: float64(98), - }, - }} - assert.Len(t, queryConditions[conditionAnd], 3) - assert.Contains(t, expected, queryConditions[conditionAnd].([]map[string]interface{})[0]) - assert.Contains(t, expected, queryConditions[conditionAnd].([]map[string]interface{})[1]) - assert.Contains(t, expected, queryConditions[conditionAnd].([]map[string]interface{})[2]) - }) - - t.Run(metadataField+" "+conditionOr, func(t *testing.T) { - condition := map[string]interface{}{ - metadataField: map[string]interface{}{ - "test-key": "test-value", - "test-key2": "test-value2", - }, - conditionOr: []map[string]interface{}{{ - "amount": map[string]interface{}{ - conditionLessThan: 98, - }, - }}, - } - queryConditions := getMongoQueryConditions(mockModel{}, condition, nil) - expected := []map[string]interface{}{{ - metadataField + ".k": "test-key", - metadataField + ".v": "test-value", - }, { - metadataField + ".k": "test-key2", - metadataField + ".v": "test-value2", - }} - expectedOr := []map[string]interface{}{{ - "amount": map[string]interface{}{ - conditionLessThan: float64(98), - }, - }} - assert.Len(t, queryConditions[conditionAnd], 2) - assert.Len(t, queryConditions[conditionOr], 1) - assert.Contains(t, expected, queryConditions[conditionAnd].([]map[string]interface{})[0]) - assert.Contains(t, expected, queryConditions[conditionAnd].([]map[string]interface{})[1]) - assert.Contains(t, expectedOr, queryConditions[conditionOr].([]map[string]interface{})[0]) - }) - - t.Run("testing "+objectMetadataField, func(t *testing.T) { - condition := map[string]interface{}{ - objectMetadataField: map[string]interface{}{ - "testID": map[string]interface{}{ - "test-key": "test-value", - }, - }, - conditionAnd: []map[string]interface{}{{ - "amount": map[string]interface{}{ - conditionLessThan: 98, - }, - }}, - } - queryConditions := getMongoQueryConditions(mockModel{}, condition, processObjectMetadataConditions) - expected := []map[string]interface{}{{ - objectMetadataField + ".x": "testID", - objectMetadataField + ".k": "test-key", - objectMetadataField + ".v": "test-value", - }, { - "amount": map[string]interface{}{ - conditionLessThan: float64(98), - }, - }} - assert.Contains(t, expected, queryConditions[conditionAnd].([]map[string]interface{})[0]) - assert.Contains(t, expected, queryConditions[conditionAnd].([]map[string]interface{})[1]) - }) - - t.Run("testing "+objectMetadataField+" x2", func(t *testing.T) { - condition := map[string]interface{}{ - objectMetadataField: map[string]interface{}{ - "testID": map[string]interface{}{ - "test-key": "test-value", - "test-key2": "test-value2", - }, - }, - } - queryConditions := getMongoQueryConditions(mockModel{}, condition, processObjectMetadataConditions) - expected := []map[string]interface{}{{ - objectMetadataField + ".x": "testID", - objectMetadataField + ".k": "test-key", - objectMetadataField + ".v": "test-value", - }, { - objectMetadataField + ".x": "testID", - objectMetadataField + ".k": "test-key2", - objectMetadataField + ".v": "test-value2", - }} - assert.Len(t, queryConditions[conditionAnd], 2) - assert.Contains(t, expected, queryConditions[conditionAnd].([]map[string]interface{})[0]) - assert.Contains(t, expected, queryConditions[conditionAnd].([]map[string]interface{})[1]) - }) - - t.Run("testing json interface", func(t *testing.T) { - condition := map[string]interface{}{ - objectMetadataField: map[string]interface{}{ - "testID": map[string]interface{}{ - "test-key": "test-value", - "test-key2": "test-value2", - }, - }, - } - c, err := json.Marshal(condition) - require.NoError(t, err) - - var cc interface{} - err = json.Unmarshal(c, &cc) - require.NoError(t, err) - queryConditions := getMongoQueryConditions(mockModel{}, cc.(map[string]interface{}), processObjectMetadataConditions) - expected := []map[string]interface{}{{ - objectMetadataField + ".x": "testID", - objectMetadataField + ".k": "test-key", - objectMetadataField + ".v": "test-value", - }, { - objectMetadataField + ".x": "testID", - objectMetadataField + ".k": "test-key2", - objectMetadataField + ".v": "test-value2", - }} - assert.Len(t, queryConditions[conditionAnd], 2) - assert.Contains(t, expected, queryConditions[conditionAnd].([]map[string]interface{})[0]) - assert.Contains(t, expected, queryConditions[conditionAnd].([]map[string]interface{})[1]) - }) - - t.Run("testing "+objectMetadataField+" x3", func(t *testing.T) { - arrayName1 := fieldInIDs - arrayName2 := fieldOutIDs - condition := map[string]interface{}{ - conditionOr: []map[string]interface{}{{ - arrayName1: "test_id", - }, { - arrayName2: "test_id", - }}, - conditionAnd: []map[string]interface{}{{ - conditionOr: []map[string]interface{}{{ - metadataField: map[string]interface{}{"test-key": "test-value"}, - }, { - objectMetadataField: map[string]interface{}{ - "test_id": map[string]interface{}{"test-key": "test-value"}, - }, - }}, - }}, - } - queryConditions := getMongoQueryConditions(mockModel{}, condition, processObjectMetadataConditions) - // {"$and":[{"$or":[{"$and":[{"metadata.k":"test-key","metadata.v":"test-value"}]},{"$and":[{"object_metadata.k":"test-key","object_metadata.v":"test-value"}],"object_metadata.x":"test_id"}]}],"$or":[{"field_in_ids":"test_id"},{"field_out_ids":"test_id"}]} - assert.Len(t, queryConditions[conditionAnd], 1) - assert.Len(t, queryConditions[conditionOr], 2) - - expectedXpubID := []map[string]interface{}{{ - arrayName1: "test_id", - }, { - arrayName2: "test_id", - }} - assert.Contains(t, expectedXpubID, queryConditions[conditionOr].([]map[string]interface{})[0]) - assert.Contains(t, expectedXpubID, queryConditions[conditionOr].([]map[string]interface{})[1]) - - expected0 := map[string]interface{}{ - metadataField + ".k": "test-key", - metadataField + ".v": "test-value", - } - expected1 := map[string]interface{}{ - objectMetadataField + ".x": "test_id", - objectMetadataField + ".k": "test-key", - objectMetadataField + ".v": "test-value", - } - or := (queryConditions[conditionAnd].([]map[string]interface{})[0])[conditionOr] - or0 := or.([]map[string]interface{})[0] - or1 := or.([]map[string]interface{})[1] - assert.Equal(t, expected0, or0[conditionAnd].([]map[string]interface{})[0]) - assert.Equal(t, expected1, or1[conditionAnd].([]map[string]interface{})[0]) - }) - - t.Run("object_output_value", func(t *testing.T) { - fieldName := "object_output_value" - condition := map[string]interface{}{ - fieldName: map[string]interface{}{ - "testID": map[string]interface{}{ - conditionGreaterThan: 0, - }, - }, - conditionAnd: []map[string]interface{}{{ - "amount": map[string]interface{}{ - conditionLessThan: 98, - }, - }}, - } - queryConditions := getMongoQueryConditions(mockModel{}, condition, processObjectOutputValueConditions) - expected := []map[string]interface{}{{ - fieldName + ".testID": map[string]interface{}{ - conditionGreaterThan: float64(0), - }, - }, { - "amount": map[string]interface{}{ - conditionLessThan: float64(98), - }, - }} - assert.Contains(t, expected, queryConditions[conditionAnd].([]map[string]interface{})[0]) - assert.Contains(t, expected, queryConditions[conditionAnd].([]map[string]interface{})[1]) - }) -} - -// processObjectMetadataConditions is an example of processing custom object metadata -// ObjectID -> Key/Value -func processObjectMetadataConditions(conditions map[string]interface{}) { - // marshal / unmarshal into standard map[string]interface{} - m, _ := json.Marshal(conditions[objectMetadataField]) //nolint:errchkjson // this check might break the current code - var r map[string]interface{} - _ = json.Unmarshal(m, &r) - - for object, xr := range r { - objectMetadata := make([]map[string]interface{}, 0) - for key, value := range xr.(map[string]interface{}) { - objectMetadata = append(objectMetadata, map[string]interface{}{ - objectMetadataField + ".x": object, - objectMetadataField + ".k": key, - objectMetadataField + ".v": value, - }) - } - if len(objectMetadata) > 0 { - _, ok := conditions[conditionAnd] - if ok { - and := conditions[conditionAnd].([]map[string]interface{}) - and = append(and, objectMetadata...) - conditions[conditionAnd] = and - } else { - conditions[conditionAnd] = objectMetadata - } - } - } - delete(conditions, objectMetadataField) -} - -// processObjectOutputValueConditions is an example of processing custom object value -// ObjectID -> Value -func processObjectOutputValueConditions(conditions map[string]interface{}) { - fieldName := "object_output_value" - - m, _ := json.Marshal(conditions[fieldName]) //nolint:errchkjson // this check might break the current code - var r map[string]interface{} - _ = json.Unmarshal(m, &r) - - objectOutputValue := make([]map[string]interface{}, 0) - for object, value := range r { - outputKey := fieldName + "." + object - objectOutputValue = append(objectOutputValue, map[string]interface{}{ - outputKey: value, - }) - } - if len(objectOutputValue) > 0 { - _, ok := conditions[conditionAnd] - if ok { - and := conditions[conditionAnd].([]map[string]interface{}) - and = append(and, objectOutputValue...) - conditions[conditionAnd] = and - } else { - conditions[conditionAnd] = objectOutputValue - } - } - - delete(conditions, fieldName) -} diff --git a/engine/datastore/sql.go b/engine/datastore/sql.go index 9ed05e2c..32fcc6e8 100644 --- a/engine/datastore/sql.go +++ b/engine/datastore/sql.go @@ -6,7 +6,6 @@ import ( "os" "time" - "gorm.io/driver/mysql" "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" @@ -17,7 +16,6 @@ import ( /* // Load the NewRelic capable drivers -// _ "github.com/newrelic/go-agent/v3/integrations/nrmysql" // _ "github.com/newrelic/go-agent/v3/integrations/nrpgx" // _ "github.com/newrelic/go-agent/v3/integrations/nrsqlite3" */ @@ -25,12 +23,9 @@ import ( // SQL related default settings // todo: make this configurable for the end-user? const ( - defaultDatetimePrecision = true // disable datetime precision, which not supported before MySQL 5.6 - defaultDontSupportRenameColumn = true // `change` when rename column, rename column not supported before MySQL 8, MariaDB - defaultDontSupportRenameIndex = true // drop & create when rename index, rename index not supported before MySQL 5.7, MariaDB - defaultFieldStringSize uint = 256 // default size for string fields - dsnDefault = "file::memory:" // DSN for connection (file or memory, default is memory) - defaultPreparedStatements = false // Flag for prepared statements for SQL + defaultFieldStringSize uint = 256 // default size for string fields + dsnDefault = "file::memory:" // DSN for connection (file or memory, default is memory) + defaultPreparedStatements = false // Flag for prepared statements for SQL ) // openSQLDatabase will open a new SQL database @@ -42,7 +37,7 @@ func openSQLDatabase(optionalLogger glogger.Interface, configs ...*SQLConfig) (d } // Not a valid driver? - if sourceConfig.Driver != MySQL.String() && sourceConfig.Driver != PostgreSQL.String() { + if sourceConfig.Driver != PostgreSQL.String() { return nil, ErrUnsupportedDriver } @@ -180,37 +175,9 @@ func getDNS(databasePath string, shared bool) (dsn string) { // getDialector will return a new gorm.Dialector based on driver func getDialector(config *SQLConfig) gorm.Dialector { - if config.Driver == MySQL.String() { - return mySQLDialector(config) - } return postgreSQLDialector(config) } -// mySQLDialector will return a gorm.Dialector -func mySQLDialector(config *SQLConfig) gorm.Dialector { - // Create the default MySQL configuration - cfg := mysql.Config{ - // DriverName: "nrmysql", - // todo: make all params customizable via config - DSN: config.User + ":" + config.Password + - "@tcp(" + config.Host + ":" + config.Port + ")/" + - config.Name + "?charset=utf8&parseTime=True&loc=Local", // data source name (connection string) - DefaultStringSize: defaultFieldStringSize, // default size for string fields - DisableDatetimePrecision: defaultDatetimePrecision, // disable datetime precision, which not supported before MySQL 5.6 - DontSupportRenameIndex: defaultDontSupportRenameIndex, // drop & create when rename index, rename index not supported before MySQL 5.7, MariaDB - DontSupportRenameColumn: defaultDontSupportRenameColumn, // `change` when rename column, rename column not supported before MySQL 8, MariaDB - SkipInitializeWithVersion: config.SkipInitializeWithVersion, // autoconfigure based on currently MySQL version - } - - // Do we have an existing connection - if config.ExistingConnection != nil { - cfg.DSN = "" - cfg.Conn = config.ExistingConnection - } - - return mysql.New(cfg) -} - // postgreSQLDialector will return a gorm.Dialector func postgreSQLDialector(config *SQLConfig) gorm.Dialector { // Create the default PostgreSQL configuration @@ -369,18 +336,10 @@ func (s *SQLConfig) sqlDefaults(engine Engine) *SQLConfig { s.MaxConnectionIdleTime = defaultDatabaseMaxIdleTime } if len(s.Port) == 0 { - if engine == MySQL { - s.Port = defaultMySQLPort - } else { - s.Port = defaultPostgreSQLPort - } + s.Port = defaultPostgreSQLPort } if len(s.Host) == 0 { - if engine == MySQL { - s.Host = defaultMySQLHost - } else { - s.Host = defaultPostgreSQLHost - } + s.Host = defaultPostgreSQLHost } if len(s.TimeZone) == 0 { s.TimeZone = defaultTimeZone diff --git a/engine/datastore/sql_test.go b/engine/datastore/sql_test.go deleted file mode 100644 index 14694329..00000000 --- a/engine/datastore/sql_test.go +++ /dev/null @@ -1,125 +0,0 @@ -package datastore - -import ( - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -// TestClient_getSourceDatabase will test the method getSourceDatabase() -func TestClient_getSourceDatabase(t *testing.T) { - t.Run("single write db", func(t *testing.T) { - source, configs := getSourceDatabase( - []*SQLConfig{ - { - CommonConfig: CommonConfig{ - Debug: true, - MaxConnectionIdleTime: 10 * time.Second, - MaxConnectionTime: 10 * time.Second, - MaxIdleConnections: 1, - MaxOpenConnections: 1, - TablePrefix: "test", - }, - Driver: MySQL.String(), - Host: "host-write.domain.com", - Name: "db_name", - Password: "test", - Port: defaultMySQLPort, - Replica: false, - TimeZone: defaultTimeZone, - TxTimeout: defaultDatabaseTxTimeout, - User: "test", - }, - }, - ) - require.NotNil(t, source) - require.Empty(t, len(configs)) - assert.False(t, source.Replica) - assert.Equal(t, "host-write.domain.com", source.Host) - }) - - t.Run("read vs write", func(t *testing.T) { - source, configs := getSourceDatabase( - []*SQLConfig{ - { - CommonConfig: CommonConfig{ - Debug: true, - MaxConnectionIdleTime: 10 * time.Second, - MaxConnectionTime: 10 * time.Second, - MaxIdleConnections: 1, - MaxOpenConnections: 1, - TablePrefix: "test", - }, - Driver: MySQL.String(), - Host: "host-write.domain.com", - Name: "db_name", - Password: "test", - Port: defaultMySQLPort, - Replica: false, - TimeZone: defaultTimeZone, - TxTimeout: defaultDatabaseTxTimeout, - User: "test", - }, - { - CommonConfig: CommonConfig{ - Debug: true, - MaxConnectionIdleTime: 10 * time.Second, - MaxConnectionTime: 10 * time.Second, - MaxIdleConnections: 1, - MaxOpenConnections: 1, - TablePrefix: "test", - }, - Driver: MySQL.String(), - Host: "host-read.domain.com", - Name: "db_name", - Password: "test", - Port: defaultMySQLPort, - Replica: true, - TimeZone: defaultTimeZone, - TxTimeout: defaultDatabaseTxTimeout, - User: "test", - }, - }, - ) - require.NotNil(t, source) - - assert.False(t, source.Replica) - assert.Equal(t, "host-write.domain.com", source.Host) - - assert.Len(t, configs, 1) - assert.True(t, configs[0].Replica) - assert.Equal(t, "host-read.domain.com", configs[0].Host) - }) - - t.Run("only replica, no source found", func(t *testing.T) { - source, configs := getSourceDatabase( - []*SQLConfig{ - { - CommonConfig: CommonConfig{ - Debug: true, - MaxConnectionIdleTime: 10 * time.Second, - MaxConnectionTime: 10 * time.Second, - MaxIdleConnections: 1, - MaxOpenConnections: 1, - TablePrefix: "test", - }, - Driver: MySQL.String(), - Host: "host-read.domain.com", - Name: "db_name", - Password: "test", - Port: defaultMySQLPort, - Replica: true, - TimeZone: defaultTimeZone, - TxTimeout: defaultDatabaseTxTimeout, - User: "test", - }, - }, - ) - require.Nil(t, source) - assert.Len(t, configs, 1) - assert.True(t, configs[0].Replica) - assert.Equal(t, "host-read.domain.com", configs[0].Host) - }) -} diff --git a/engine/datastore/transaction.go b/engine/datastore/transaction.go index 260afbca..cbce9ef4 100644 --- a/engine/datastore/transaction.go +++ b/engine/datastore/transaction.go @@ -3,7 +3,6 @@ package datastore import ( "context" - "go.mongodb.org/mongo-driver/mongo" "gorm.io/gorm" ) @@ -17,19 +16,6 @@ func (c *Client) NewTx(ctx context.Context, fn func(*Transaction) error) error { }) } - // For MongoDB - if c.options.mongoDBConfig.Transactions { - return c.options.mongoDB.Client().UseSession(ctx, func(sessionContext mongo.SessionContext) error { - if err := sessionContext.StartTransaction(); err != nil { - return err - } - return fn(&Transaction{ - sqlTx: nil, - mongoTx: &sessionContext, - }) - }) - } - // Empty transaction return fn(&Transaction{}) } @@ -44,12 +30,6 @@ func (c *Client) NewRawTx() (*Transaction, error) { }, nil } - // For MongoDB - // todo: implement - but the issue is Mongo uses a callback - if c.options.mongoDBConfig.Transactions { - return nil, ErrNotImplemented - } - // Empty transaction return &Transaction{}, nil } @@ -57,14 +37,13 @@ func (c *Client) NewRawTx() (*Transaction, error) { // Transaction is the internal datastore transaction type Transaction struct { committed bool - mongoTx *mongo.SessionContext rowsAffected int64 sqlTx *gorm.DB } // CanCommit will return true if it can commit func (tx *Transaction) CanCommit() bool { - return !tx.committed && (tx.sqlTx != nil || tx.mongoTx != nil) + return !tx.committed && tx.sqlTx != nil } // Rollback the transaction @@ -73,10 +52,6 @@ func (tx *Transaction) Rollback() error { tx.sqlTx.Rollback() } - if tx.mongoTx != nil { - return (*tx.mongoTx).AbortTransaction(*tx.mongoTx) - } - return nil } @@ -85,8 +60,7 @@ func (tx *Transaction) Commit() error { // Have we already committed? if tx.committed { return nil - } else if tx.sqlTx == nil && - tx.mongoTx == nil { + } else if tx.sqlTx == nil { return nil } @@ -101,13 +75,5 @@ func (tx *Transaction) Commit() error { tx.rowsAffected = result.RowsAffected } - if tx.mongoTx != nil { - if err := (*tx.mongoTx).CommitTransaction(*tx.mongoTx); err != nil { - return err - } - tx.committed = true - tx.rowsAffected = 1 // todo: can we get all rows affected ? - } - return nil } diff --git a/engine/datastore/where_builder.go b/engine/datastore/where_builder.go index 289b5fa1..ef23ac86 100644 --- a/engine/datastore/where_builder.go +++ b/engine/datastore/where_builder.go @@ -82,20 +82,12 @@ func (builder *whereBuilder) applyJSONArrayContains(tx customWhereInterface, key switch engine { case PostgreSQL: builder.applyPostgresJSONB(tx, columnName, fmt.Sprintf(`["%s"]`, condition)) - case MySQL: - varName := builder.nextVarName() - tx.Where( - fmt.Sprintf("JSON_CONTAINS(%s, CAST(@%s AS JSON))", columnName, varName), - map[string]interface{}{varName: fmt.Sprintf(`["%s"]`, condition)}, - ) case SQLite: varName := builder.nextVarName() tx.Where( fmt.Sprintf("EXISTS (SELECT 1 FROM json_each(%s) WHERE value = @%s)", columnName, varName), map[string]interface{}{varName: condition}, ) - case MongoDB, Empty: - panic("Database engine not supported") default: panic("Unknown database engine") } @@ -112,7 +104,7 @@ func (builder *whereBuilder) applyJSONCondition(tx customWhereInterface, key str if engine == PostgreSQL { builder.applyPostgresJSONB(tx, columnName, condition) - } else if engine == MySQL || engine == SQLite { + } else if engine == SQLite { builder.applyJSONExtract(tx, columnName, condition) } else { panic("Database engine not supported") @@ -208,9 +200,6 @@ func (builder *whereBuilder) formatNullTime(condition customtypes.NullTime) inte return nil } engine := builder.client.Engine() - if engine == MySQL { - return condition.Time.Format("2006-01-02 15:04:05") - } if engine == PostgreSQL { return condition.Time.Format("2006-01-02T15:04:05Z07:00") } diff --git a/engine/datastore/where_mocks_test.go b/engine/datastore/where_mocks_test.go index 9be3117d..9dd942a7 100644 --- a/engine/datastore/where_mocks_test.go +++ b/engine/datastore/where_mocks_test.go @@ -11,7 +11,6 @@ import ( "github.com/bitcoin-sv/spv-wallet/engine/utils" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/bsontype" - "gorm.io/driver/mysql" "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" @@ -32,12 +31,6 @@ type mockObject struct { func mockDialector(engine Engine) gorm.Dialector { mockDb, _, _ := sqlmock.New() switch engine { - case MySQL: - return mysql.New(mysql.Config{ - Conn: mockDb, - SkipInitializeWithVersion: true, - DriverName: "mysql", - }) case PostgreSQL: return postgres.New(postgres.Config{ Conn: mockDb, @@ -45,9 +38,6 @@ func mockDialector(engine Engine) gorm.Dialector { }) case SQLite: return sqlite.Open("file::memory:?cache=shared") - case MongoDB, Empty: - // the where builder is not applicable for MongoDB - return nil default: return nil } diff --git a/engine/datastore/where_test.go b/engine/datastore/where_test.go index b92ffaa1..2cdddb5d 100644 --- a/engine/datastore/where_test.go +++ b/engine/datastore/where_test.go @@ -46,20 +46,6 @@ func Test_whereObject(t *testing.T) { assert.Contains(t, raw, `"$.domain"`) assert.Contains(t, raw, `"test-domain"`) }) - - t.Run("MySQL", func(t *testing.T) { - client, gdb := mockClient(MySQL) - - raw := gdb.ToSQL(func(tx *gorm.DB) *gorm.DB { - tx, err := ApplyCustomWhere(client, tx, conditions, mockObject{}) - assert.NoError(t, err) - return tx.First(&mockObject{}) - }) - - assert.Contains(t, raw, "JSON_EXTRACT(metadata") - assert.Contains(t, raw, "'$.domain'") - assert.Contains(t, raw, "'test-domain'") - }) } // Test_whereObject test the SQL where selector @@ -86,22 +72,6 @@ func Test_whereSlice(t *testing.T) { assert.Contains(t, raw, `'["test"]'`) }) - t.Run("MySQL", func(t *testing.T) { - client, gdb := mockClient(MySQL) - WithCustomFields([]string{"field_in_ids"}, nil)(client.options) - - raw := gdb.ToSQL(func(tx *gorm.DB) *gorm.DB { - tx, err := ApplyCustomWhere(client, tx, conditions, mockObject{}) - assert.NoError(t, err) - return tx.First(&mockObject{}) - }) - // produced SQL: - // SELECT * FROM `mock_objects` WHERE JSON_CONTAINS(field_in_ids, CAST('["test"]' AS JSON)) ORDER BY `mock_objects`.`id` LIMIT 1 - - assert.Contains(t, raw, "JSON_CONTAINS(field_in_ids") - assert.Contains(t, raw, `'["test"]'`) - }) - t.Run("SQLite", func(t *testing.T) { client, gdb := mockClient(SQLite) WithCustomFields([]string{"field_in_ids"}, nil)(client.options) @@ -138,20 +108,6 @@ func Test_processConditions(t *testing.T) { }, } - t.Run("MySQL", func(t *testing.T) { - client, gdb := mockClient(MySQL) - - raw := gdb.ToSQL(func(tx *gorm.DB) *gorm.DB { - tx, err := ApplyCustomWhere(client, tx, conditions, mockObject{}) - assert.NoError(t, err) - return tx.First(&mockObject{}) - }) - - assert.Contains(t, raw, "2022-04-04 15:12:37") - assert.Contains(t, raw, "AND") - assert.Regexp(t, "(.+)unique_field_name(.+)IS NOT NULL", raw) - }) - t.Run("Postgres", func(t *testing.T) { client, gdb := mockClient(PostgreSQL) @@ -279,23 +235,6 @@ func TestCustomWhere(t *testing.T) { assert.Contains(t, raw, `JSON_EXTRACT(metadata, "$.field_name") = "field_value"`) }) - t.Run("MySQL metadata", func(t *testing.T) { - client, gdb := mockClient(MySQL) - conditions := map[string]interface{}{ - metadataField: map[string]interface{}{ - "field_name": "field_value", - }, - } - - raw := gdb.ToSQL(func(tx *gorm.DB) *gorm.DB { - tx, err := ApplyCustomWhere(client, tx, conditions, mockObject{}) - assert.NoError(t, err) - return tx.First(&mockObject{}) - }) - - assert.Contains(t, raw, "JSON_EXTRACT(metadata, '$.field_name') = 'field_value'") - }) - t.Run("PostgreSQL metadata", func(t *testing.T) { client, gdb := mockClient(PostgreSQL) conditions := map[string]interface{}{ @@ -342,35 +281,6 @@ func TestCustomWhere(t *testing.T) { assert.Regexp(t, "AND(.*)AND", raw) }) - t.Run("MySQL $and", func(t *testing.T) { - client, gdb := mockClient(MySQL) - WithCustomFields([]string{"field_in_ids", "field_out_ids"}, nil)(client.options) - - conditions := map[string]interface{}{ - conditionAnd: []map[string]interface{}{{ - "reference_id": "reference", - }, { - "number": 12, - }, { - conditionOr: []map[string]interface{}{{ - "field_in_ids": "value_id", - }, { - "field_out_ids": "value_id", - }}, - }}, - } - - raw := gdb.ToSQL(func(tx *gorm.DB) *gorm.DB { - tx, err := ApplyCustomWhere(client, tx, conditions, mockObject{}) - assert.NoError(t, err) - return tx.First(&mockObject{}) - }) - - assert.Regexp(t, "reference_id(.*)\\=(.*)reference", raw) - assert.Regexp(t, "number(.*)\\=(.*)12", raw) - assert.Regexp(t, "AND(.*)AND", raw) - }) - t.Run("PostgreSQL $and", func(t *testing.T) { client, gdb := mockClient(PostgreSQL) WithCustomFields([]string{"field_in_ids", "field_out_ids"}, nil)(client.options) diff --git a/engine/db_model_transactions.go b/engine/db_model_transactions.go index 503964ef..b54c467c 100644 --- a/engine/db_model_transactions.go +++ b/engine/db_model_transactions.go @@ -158,11 +158,7 @@ func (m *Transaction) ChildModels() (childModels []ModelInterface) { // Migrate model specific migration on startup func (m *Transaction) Migrate(client datastore.ClientInterface) error { tableName := client.GetTableName(tableTransactions) - if client.Engine() == datastore.MySQL { - if err := m.migrateMySQL(client, tableName); err != nil { - return err - } - } else if client.Engine() == datastore.PostgreSQL { + if client.Engine() == datastore.PostgreSQL { if err := m.migratePostgreSQL(client, tableName); err != nil { return err } @@ -186,43 +182,3 @@ func (m *Transaction) migratePostgreSQL(client datastore.ClientInterface, tableN return nil } - -// migrateMySQL is specific migration SQL for MySQL -func (m *Transaction) migrateMySQL(client datastore.ClientInterface, tableName string) error { - idxName := "idx_" + tableName + "_xpub_in_ids" - idxExists, err := client.IndexExists(tableName, idxName) - if err != nil { - return err - } - if !idxExists { - tx := client.Execute("ALTER TABLE `" + tableName + "`" + - " ADD INDEX " + idxName + " ( (CAST(xpub_in_ids AS CHAR(64) ARRAY)) )") - if tx.Error != nil { - m.Client().Logger().Error().Msg("failed creating json index on mysql: " + tx.Error.Error()) - return nil //nolint:nolintlint,nilerr // error is not needed - } - } - - idxName = "idx_" + tableName + "_xpub_out_ids" - if idxExists, err = client.IndexExists( - tableName, idxName, - ); err != nil { - return err - } - if !idxExists { - tx := client.Execute("ALTER TABLE `" + tableName + "`" + - " ADD INDEX " + idxName + " ( (CAST(xpub_out_ids AS CHAR(64) ARRAY)) )") - if tx.Error != nil { - m.Client().Logger().Error().Msg("failed creating json index on mysql: " + tx.Error.Error()) - return nil //nolint:nolintlint,nilerr // error is not needed - } - } - - tx := client.Execute("ALTER TABLE `" + tableName + "` MODIFY COLUMN hex longtext") - if tx.Error != nil { - m.Client().Logger().Error().Msg("failed changing hex type to longtext in MySQL: " + tx.Error.Error()) - return nil //nolint:nolintlint,nilerr // error is not needed - } - - return nil -} diff --git a/engine/definitions.go b/engine/definitions.go index 56fe6b92..a085bf8e 100644 --- a/engine/definitions.go +++ b/engine/definitions.go @@ -18,7 +18,6 @@ const ( defaultQueryTxTimeout = 10 * time.Second // Default timeout for syncing on-chain information defaultUserAgent = "spv-wallet: " + version // Default user agent dustLimit = uint64(1) // Dust limit - mongoTestVersion = "6.0.4" // Mongo Testing Version sqliteTestVersion = "3.37.0" // SQLite Testing Version (dummy version for now) version = "v0.14.2" // SPV Wallet Engine version ) diff --git a/engine/examples/client/mysql/mysql.go b/engine/examples/client/mysql/mysql.go deleted file mode 100644 index 31bf8240..00000000 --- a/engine/examples/client/mysql/mysql.go +++ /dev/null @@ -1,48 +0,0 @@ -package main - -import ( - "context" - "log" - "os" - "time" - - "github.com/bitcoin-sv/spv-wallet/engine" - "github.com/bitcoin-sv/spv-wallet/engine/datastore" -) - -func main() { - defaultTimeouts := 10 * time.Second - - client, err := engine.NewClient( - context.Background(), // Set context - engine.WithSQL(datastore.MySQL, &datastore.SQLConfig{ // Load using a MySQL configuration - CommonConfig: datastore.CommonConfig{ - Debug: true, - MaxConnectionIdleTime: defaultTimeouts, - MaxConnectionTime: defaultTimeouts, - MaxIdleConnections: 10, - MaxOpenConnections: 10, - TablePrefix: "spv", - }, - Driver: datastore.MySQL.String(), - Host: "localhost", - Name: os.Getenv("DB_NAME"), - Password: os.Getenv("DB_PASSWORD"), - Port: "3306", - TimeZone: "UTC", - TxTimeout: defaultTimeouts, - User: os.Getenv("DB_USER"), - }), - engine.WithPaymailSupport([]string{"test.com"}, "example@test.com", false, false), - engine.WithAutoMigrate(engine.BaseModels...), - ) - if err != nil { - log.Fatalln("error: " + err.Error()) - } - - defer func() { - _ = client.Close(context.Background()) - }() - - log.Println("client loaded!", client.UserAgent()) -} diff --git a/engine/go.mod b/engine/go.mod index 45ec86d3..a49cac76 100644 --- a/engine/go.mod +++ b/engine/go.mod @@ -1,16 +1,17 @@ module github.com/bitcoin-sv/spv-wallet/engine -go 1.21.5 +go 1.22 + +toolchain go1.22.3 require ( github.com/DATA-DOG/go-sqlmock v1.5.2 github.com/bitcoin-sv/go-broadcast-client v0.18.1 github.com/bitcoin-sv/go-paymail v0.14.0 github.com/bitcoinschema/go-bitcoin/v2 v2.0.5 - github.com/bitcoinschema/go-map v0.1.0 + github.com/bitcoinschema/go-map v0.1.1 github.com/coocood/freecache v1.2.4 - github.com/dolthub/go-mysql-server v0.17.0 - github.com/fergusstrange/embedded-postgres v1.25.0 + github.com/fergusstrange/embedded-postgres v1.27.0 github.com/go-redis/redis/v8 v8.11.5 github.com/go-redis/redis_rate/v9 v9.1.2 github.com/gomodule/redigo v2.0.0+incompatible @@ -20,66 +21,58 @@ require ( github.com/libsv/go-bt v1.0.8 github.com/libsv/go-bt/v2 v2.2.5 github.com/mrz1836/go-cache v0.9.7 - github.com/mrz1836/go-cachestore v0.3.6 + github.com/mrz1836/go-cachestore v0.3.10 github.com/mrz1836/go-logger v0.3.3 - github.com/newrelic/go-agent/v3 v3.31.0 + github.com/newrelic/go-agent/v3 v3.33.0 github.com/pkg/errors v0.9.1 github.com/rafaeljusto/redigomock v2.4.0+incompatible github.com/robfig/cron/v3 v3.0.1 - github.com/rs/zerolog v1.32.0 + github.com/rs/zerolog v1.33.0 github.com/stretchr/testify v1.9.0 - github.com/tonicpow/go-minercraft/v2 v2.0.8 - github.com/tryvium-travels/memongo v0.11.0 + github.com/tonicpow/go-minercraft/v2 v2.1.0 github.com/vmihailenco/taskq/v3 v3.2.9 go.elastic.co/ecszerolog v0.2.0 - go.mongodb.org/mongo-driver v1.13.1 - gorm.io/gorm v1.25.9 + go.mongodb.org/mongo-driver v1.15.0 + gorm.io/gorm v1.25.10 ) require ( - github.com/bytedance/sonic v1.10.2 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect - github.com/chenzhuoyu/iasm v0.9.1 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect + github.com/bytedance/sonic v1.11.7 // indirect + github.com/bytedance/sonic/loader v0.1.1 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.4 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/gin-gonic/gin v1.9.1 // indirect + github.com/gin-gonic/gin v1.10.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.18.0 // indirect - github.com/goccy/go-json v0.10.2 // indirect + github.com/go-playground/validator/v10 v10.20.0 // indirect + github.com/goccy/go-json v0.10.3 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/cpuid/v2 v2.2.6 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect - golang.org/x/arch v0.7.0 // indirect + golang.org/x/arch v0.8.0 // indirect ) require ( - github.com/99designs/gqlgen v0.17.43 - github.com/acobaugh/osrelease v0.1.0 // indirect + github.com/99designs/gqlgen v0.17.47 github.com/beorn7/perks v1.0.1 // indirect github.com/bitcoinschema/go-bpu v0.1.3 // indirect github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173 // indirect github.com/bitcoinsv/bsvutil v0.0.0-20181216182056-1d77cf353ea9 // indirect github.com/bsm/redislock v0.9.4 // indirect github.com/capnm/sysinfo v0.0.0-20130621111458-5909a53897f3 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 // indirect - github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e // indirect - github.com/dolthub/jsonpath v0.0.2-0.20230525180605-8dc13778fd72 // indirect - github.com/dolthub/vitess v0.0.0-20230823204737-4a21a94e90c3 // indirect - github.com/go-kit/kit v0.13.0 // indirect - github.com/go-resty/resty/v2 v2.11.0 // indirect + github.com/go-resty/resty/v2 v2.13.1 // indirect github.com/go-sql-driver/mysql v1.7.1 // indirect - github.com/gocraft/dbr/v2 v2.7.6 // indirect github.com/gojektech/heimdall/v6 v6.1.0 // indirect github.com/gojektech/valkyrie v0.0.0-20190210220504-8f62c1e7ba45 // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -89,66 +82,50 @@ require ( github.com/iancoleman/strcase v0.3.0 github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect - github.com/jackc/pgx/v5 v5.5.3 // indirect + github.com/jackc/pgx/v5 v5.5.5 // indirect github.com/jackc/puddle/v2 v2.2.1 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect - github.com/jmoiron/sqlx v1.3.5 // indirect - github.com/klauspost/compress v1.17.6 // indirect - github.com/lestrrat-go/strftime v1.0.6 // indirect + github.com/klauspost/compress v1.17.8 // indirect github.com/lib/pq v1.10.9 // indirect - github.com/libsv/go-p2p v0.1.5 // indirect + github.com/libsv/go-p2p v0.2.3 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-sqlite3 v1.14.22 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect - github.com/miekg/dns v1.1.57 // indirect - github.com/mitchellh/hashstructure v1.1.0 // indirect + github.com/miekg/dns v1.1.59 // indirect github.com/montanaflynn/stats v0.7.1 // indirect - github.com/newrelic/go-agent/v3/integrations/nrmongo v1.1.3 github.com/onsi/gomega v1.27.5 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.18.0 - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.45.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect - github.com/shopspring/decimal v1.3.1 // indirect - github.com/sirupsen/logrus v1.9.3 // indirect - github.com/sosodev/duration v1.2.0 // indirect - github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/spf13/afero v1.11.0 // indirect + github.com/prometheus/client_golang v1.19.1 + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.53.0 // indirect + github.com/prometheus/procfs v0.15.0 // indirect + github.com/sosodev/duration v1.3.1 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/tetratelabs/wazero v1.5.0 // indirect - github.com/tidwall/gjson v1.17.0 // indirect - github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect - github.com/tidwall/sjson v1.2.5 // indirect - github.com/vektah/gqlparser/v2 v2.5.11 // indirect + github.com/vektah/gqlparser/v2 v2.5.12 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect - github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect - go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.16.1 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa // indirect - google.golang.org/grpc v1.62.1 // indirect - google.golang.org/protobuf v1.33.0 // indirect - gopkg.in/src-d/go-errors.v1 v1.0.0 // indirect + github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect + golang.org/x/tools v0.21.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e // indirect + google.golang.org/grpc v1.64.0 // indirect + google.golang.org/protobuf v1.34.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gorm.io/driver/mysql v1.5.6 + gorm.io/driver/mysql v1.5.6 // indirect gorm.io/driver/postgres v1.5.7 gorm.io/driver/sqlite v1.5.5 - gorm.io/plugin/dbresolver v1.5.0 + gorm.io/plugin/dbresolver v1.5.1 ) // Issue with redislock package - related to taskq diff --git a/engine/go.sum b/engine/go.sum index ba1d6831..07a18a3b 100644 --- a/engine/go.sum +++ b/engine/go.sum @@ -1,19 +1,13 @@ -github.com/99designs/gqlgen v0.17.43 h1:I4SYg6ahjowErAQcHFVKy5EcWuwJ3+Xw9z2fLpuFCPo= -github.com/99designs/gqlgen v0.17.43/go.mod h1:lO0Zjy8MkZgBdv4T1U91x09r0e0WFOdhVUutlQs1Rsc= +github.com/99designs/gqlgen v0.17.47 h1:M9DTK8X3+3ATNBfZlHBwMwNngn4hhZWDxNmTiuQU5tQ= +github.com/99designs/gqlgen v0.17.47/go.mod h1:ejVkldSdtmuudqmtfaiqjwlGXWAhIv0DKXGXFY25F04= github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU= github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/DataDog/datadog-go v3.7.1+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/acobaugh/osrelease v0.1.0 h1:Yb59HQDGGNhCj4suHaFQQfBps5wyoKLSSX/J/+UifRE= -github.com/acobaugh/osrelease v0.1.0/go.mod h1:4bFEs0MtgHNHBrmHCt67gNisnabCRAlzdVasCEGHTWY= github.com/afex/hystrix-go v0.0.0-20180209013831-27fae8d30f1a/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 h1:uvdUDbHQHO85qeSydJtItA4T55Pw6BtAejd0APRJOCE= github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.31.1 h1:7XAt0uUg3DtwEKW5ZAGa+K7FZV2DdKQo5K/6TTnfX8Y= -github.com/alicebob/miniredis/v2 v2.31.1/go.mod h1:UB/T2Uztp7MlFSDakaX1sTXUv5CASoprx0wulRT6HBg= +github.com/alicebob/miniredis/v2 v2.32.1 h1:Bz7CciDnYSaa0mX5xODh6GUITRSx+cVhjNoOR4JssBo= +github.com/alicebob/miniredis/v2 v2.32.1/go.mod h1:AqkLNAfUm0K07J28hnAyyQKf/x0YkCY/g5DCtuL01Mw= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/aws/aws-sdk-go v1.43.45 h1:2708Bj4uV+ym62MOtBnErm/CDX61C4mFe9V2gXy1caE= @@ -26,106 +20,81 @@ github.com/bitcoin-sv/go-paymail v0.14.0 h1:xG/fql8BOUI2365oLFUVP2KJ6SpI57R5R5tI github.com/bitcoin-sv/go-paymail v0.14.0/go.mod h1:IuT/blY8OjhmMLQ2cgCmoL/2NfJL2gME46VHj5HAzxA= github.com/bitcoinschema/go-bitcoin/v2 v2.0.5 h1:Sgh5Eb746Zck/46rFDrZZEXZWyO53fMuWYhNoZa1tck= github.com/bitcoinschema/go-bitcoin/v2 v2.0.5/go.mod h1:JjO1ivfZv6vhK0uAXzyH08AAHlzNMAfnyK1Fiv9r4ZA= -github.com/bitcoinschema/go-bob v0.4.0 h1:adsAEboLQCg0D6e9vwcJUJEJScszsouAYCYu35UAiGo= -github.com/bitcoinschema/go-bob v0.4.0/go.mod h1:Qc8BG9MsYrumSVyihHVuvLhd22FHjHVVAAq4cdcOMaQ= +github.com/bitcoinschema/go-bob v0.4.3 h1:0iboiIQ3PY2+rrqPr8Gsh5RX+9Ha6Uzyo0bw720Ljlc= +github.com/bitcoinschema/go-bob v0.4.3/go.mod h1:XEHhQ/v+to/s8THRNKU099OpsDreRFYnU/822IihjR8= github.com/bitcoinschema/go-bpu v0.1.3 h1:O7SvuptH4Q7hemD6G9OotPLINZ61CAVOgWKJWKM+edY= github.com/bitcoinschema/go-bpu v0.1.3/go.mod h1:y4ZEDC0fSYRrA6N6bzKwHXdtMrRiQhpurpkTVobz07I= -github.com/bitcoinschema/go-map v0.1.0 h1:dM8OJ/E5MnEm9m1xNI/B3msCgSI9s7Ps3Vk0BFP53eI= -github.com/bitcoinschema/go-map v0.1.0/go.mod h1:36YXG/kob/Z+tCK3EpHMdN9+ADMSDMPYA7JFuPOBi3M= +github.com/bitcoinschema/go-map v0.1.1 h1:r4YF3E0yOMFOJJkjQyKIw+mOwMx3CODRC2RJr7X8Pyw= +github.com/bitcoinschema/go-map v0.1.1/go.mod h1:Q8em9GcLZQ7io9fg3v1Oq3J0u9uAwHTDfOocitxwP/4= github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173 h1:2yTIV9u7H0BhRDGXH5xrAwAz7XibWJtX2dNezMeNsUo= github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173/go.mod h1:BZ1UcC9+tmcDEcdVXgpt13hMczwJxWzpAn68wNs7zRA= github.com/bitcoinsv/bsvutil v0.0.0-20181216182056-1d77cf353ea9 h1:hFI8rT84FCA0FFy3cFrkW5Nz4FyNKlIdCvEvvTNySKg= github.com/bitcoinsv/bsvutil v0.0.0-20181216182056-1d77cf353ea9/go.mod h1:p44KuNKUH5BC8uX4ONEODaHUR4+ibC8todEAOGQEJAM= github.com/bsm/redislock v0.7.2 h1:jggqOio8JyX9FJBKIfjF3fTxAu/v7zC5mAID9LveqG4= github.com/bsm/redislock v0.7.2/go.mod h1:kS2g0Yvlymc9Dz8V3iVYAtLAaSVruYbAFdYBDrmC5WU= -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= -github.com/bytedance/sonic v1.10.2 h1:GQebETVBxYB7JGWJtLBi07OVzWwt+8dWA00gEVW2ZFE= -github.com/bytedance/sonic v1.10.2/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= +github.com/bytedance/sonic v1.11.7 h1:k/l9p1hZpNIMJSk37wL9ltkcpqLfIho1vYthi4xT2t4= +github.com/bytedance/sonic v1.11.7/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= +github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/cactus/go-statsd-client/statsd v0.0.0-20200423205355-cb0885a1018c/go.mod h1:l/bIBLeOl9eX+wxJAzxS4TveKRtAqlyDpHjhkfO0MEI= github.com/capnm/sysinfo v0.0.0-20130621111458-5909a53897f3 h1:IHZ1Le1ejzkmS7Si7dIzJvYDWe+BIoNmqMnfWHBZSVw= github.com/capnm/sysinfo v0.0.0-20130621111458-5909a53897f3/go.mod h1:M5XHQLu90v2JNm/bW2tdsYar+5vhV0gEcBcmDBNAN1Y= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= -github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= -github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA= -github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= -github.com/chenzhuoyu/iasm v0.9.1 h1:tUHQJXo3NhBqw6s33wkGn9SP3bvrWLdlVIJ3hQBL7P0= -github.com/chenzhuoyu/iasm v0.9.1/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/coocood/freecache v1.2.4 h1:UdR6Yz/X1HW4fZOuH0Z94KwG851GWOSknua5VUbb/5M= github.com/coocood/freecache v1.2.4/go.mod h1:RBUWa/Cy+OHdfTGFEhEuE1pMCMX51Ncizj7rthiQ3vk= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denisenkom/go-mssqldb v0.11.0 h1:9rHa233rhdOyrz2GcP9NM+gi2psgJZ4GWDpL/7ND8HI= -github.com/denisenkom/go-mssqldb v0.11.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 h1:u3PMzfF8RkKd3lB9pZ2bfn0qEG+1Gms9599cr0REMww= -github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2/go.mod h1:mIEZOHnFx4ZMQeawhw9rhsj+0zwQj7adVsnBX7t+eKY= -github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e h1:kPsT4a47cw1+y/N5SSCkma7FhAPw7KeGmD6c9PBZW9Y= -github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e/go.mod h1:KPUcpx070QOfJK1gNe0zx4pA5sicIK1GMikIGLKC168= -github.com/dolthub/go-mysql-server v0.17.0 h1:ztJjA001l6ZvutCPmwbSpegOlF0W0KKpzDk1m9SYq0s= -github.com/dolthub/go-mysql-server v0.17.0/go.mod h1:vSQ47leaIPTtvSLKo89D1FdYdypU5OH6VBV63B2MS8Y= -github.com/dolthub/jsonpath v0.0.2-0.20230525180605-8dc13778fd72 h1:NfWmngMi1CYUWU4Ix8wM+USEhjc+mhPlT9JUR/anvbQ= -github.com/dolthub/jsonpath v0.0.2-0.20230525180605-8dc13778fd72/go.mod h1:ZWUdY4iszqRQ8OcoXClkxiAVAoWoK3cq0Hvv4ddGRuM= -github.com/dolthub/vitess v0.0.0-20230823204737-4a21a94e90c3 h1:lY3oQbYNMSVjT02n6f2M2H0u4icF6lGbS/IpWr27ti8= -github.com/dolthub/vitess v0.0.0-20230823204737-4a21a94e90c3/go.mod h1:IwjNXSQPymrja5pVqmfnYdcy7Uv7eNJNBPK/MEh9OOw= -github.com/fergusstrange/embedded-postgres v1.25.0 h1:sa+k2Ycrtz40eCRPOzI7Ry7TtkWXXJ+YRsxpKMDhxK0= -github.com/fergusstrange/embedded-postgres v1.25.0/go.mod h1:t/MLs0h9ukYM6FSt99R7InCHs1nW0ordoVCcnzmpTYw= +github.com/fergusstrange/embedded-postgres v1.27.0 h1:RAlpWL194IhEpPgeJceTM0ifMJKhiSVxBVIDYB1Jee8= +github.com/fergusstrange/embedded-postgres v1.27.0/go.mod h1:t/MLs0h9ukYM6FSt99R7InCHs1nW0ordoVCcnzmpTYw= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= -github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= +github.com/gabriel-vasile/mimetype v1.4.4 h1:QjV6pZ7/XZ7ryI2KuyeEDE8wnh7fHP9YnQy+R0LnH8I= +github.com/gabriel-vasile/mimetype v1.4.4/go.mod h1:JwLei5XPtWdGiMFB5Pjle1oEeoSeEuJfJE+TtfvdB/s= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= -github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= -github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= +github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= +github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.18.0 h1:BvolUXjp4zuvkZ5YN5t7ebzbhlUtPsPm2S9NAZ5nl9U= -github.com/go-playground/validator/v10 v10.18.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8= +github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-redis/redis_rate/v9 v9.1.2 h1:H0l5VzoAtOE6ydd38j8MCq3ABlGLnvvbA1xDSVVCHgQ= github.com/go-redis/redis_rate/v9 v9.1.2/go.mod h1:oam2de2apSgRG8aJzwJddXbNu91Iyz1m8IKJE2vpvlQ= -github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8= -github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= +github.com/go-resty/resty/v2 v2.13.1 h1:x+LHXBI2nMB1vqndymf26quycC4aggYJ7DECYbiz03g= +github.com/go-resty/resty/v2 v2.13.1/go.mod h1:GznXlLxkq6Nh4sU59rPmUw3VtgpO3aS96ORAI6Q7d+0= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/gocraft/dbr/v2 v2.7.6 h1:ASHKFgCbTLODbb9f756Cl8VAlnvQLKqIzx9E1Cfb7eo= -github.com/gocraft/dbr/v2 v2.7.6/go.mod h1:8IH98S8M8J0JSEiYk0MPH26ZDUKemiQ/GvmXL5jo+Uw= +github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= +github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gojektech/heimdall/v6 v6.1.0 h1:M9L1xryMKGWUlAA33D0r0BaKiXWzvuReltDPPkC5loM= github.com/gojektech/heimdall/v6 v6.1.0/go.mod h1:8g/ohsh0GXn8fzOf+qVrjX5pQLf7qQy8vEBjBUJ/9L4= github.com/gojektech/valkyrie v0.0.0-20180215180059-6aee720afcdf/go.mod h1:tDYRk1s5Pms6XJjj5m2PxAzmQvaDU8GqDf1u6x7yxKw= github.com/gojektech/valkyrie v0.0.0-20190210220504-8f62c1e7ba45 h1:MO2DsGCZz8phRhLnpFvHEQgTH521sVN/6F2GZTbNO3Q= github.com/gojektech/valkyrie v0.0.0-20190210220504-8f62c1e7ba45/go.mod h1:tDYRk1s5Pms6XJjj5m2PxAzmQvaDU8GqDf1u6x7yxKw= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -165,8 +134,8 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA= github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.5.3 h1:Ces6/M3wbDXYpM8JyyPD57ivTtJACFZJd885pdIaV2s= -github.com/jackc/pgx/v5 v5.5.3/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= +github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw= +github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jarcoal/httpmock v1.3.1 h1:iUx3whfZWVf3jT01hQTO/Eo5sAYtB2/rqaUuOtpInww= @@ -178,18 +147,16 @@ github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= -github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/kisielk/sqlstruct v0.0.0-20201105191214-5f3e10d3ab46/go.mod h1:yyMNCyc/Ib3bDTKd379tNMpB/7/H5TjM2Y9QJ5THLbE= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= +github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= -github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= +github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -200,11 +167,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= -github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= -github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= -github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205AhTIGQQ= -github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libsv/go-bc v0.1.28 h1:LubB5VmRGF3EfkOVbb8Gmoq9Ku7XvtkwIkSW55sfnlo= @@ -215,26 +177,21 @@ github.com/libsv/go-bt v1.0.8 h1:nWLLcnUm0dxNO3exqrL5jvAcTGkl0dsnBuQqB6+M6vQ= github.com/libsv/go-bt v1.0.8/go.mod h1:yO023bNYLh5DwcOYl+ZqLAeTemoy6K+2UbQlIBMv+EQ= github.com/libsv/go-bt/v2 v2.2.5 h1:VoggBLMRW9NYoFujqe5bSYKqnw5y+fYfufgERSoubog= github.com/libsv/go-bt/v2 v2.2.5/go.mod h1:cV45+jDlPOLfhJLfpLmpQoWzrIvVth9Ao2ZO1f6CcqU= -github.com/libsv/go-p2p v0.1.5 h1:zbUE1UQ73J7LN/s3gruQBTh3Sz0DSSmj3cWhC1ZQVM0= -github.com/libsv/go-p2p v0.1.5/go.mod h1:9KhX8e+3oEmGiYQSeF/CrHj22YNHqiof3TH77VqcMCs= +github.com/libsv/go-p2p v0.2.3 h1:vbBm4b2uu08pK+BuUm6Umdd8Zc3ADp5yX0UNNCXjkeo= +github.com/libsv/go-p2p v0.2.3/go.mod h1:TENFxbTT/bfSfuiirjU6l+PfAWxwZgF8GYUxs5tzc/M= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mattn/goveralls v0.0.6/go.mod h1:h8b4ow6FxSPMQHF6o2ve3qsclnffZjYTNEKmLesRwqw= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g= github.com/maxatome/go-testdeep v1.12.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM= -github.com/miekg/dns v1.1.57 h1:Jzi7ApEIzwEPLHWRcafCN9LZSBbqQpxjt/wpgvg7wcM= -github.com/miekg/dns v1.1.57/go.mod h1:uqRjCRUuEAA6qsOiJvDd+CFo/vW+y5WR6SNmHE55hZk= -github.com/mitchellh/hashstructure v1.1.0 h1:P6P1hdjqAAknpY/M1CGipelZgp+4y9ja9kmUZPXP+H0= -github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/6d8ulp4AwfLKrmA= +github.com/miekg/dns v1.1.59 h1:C9EXc/UToRwKLhK5wKU/I4QVsBUc8kE6MkHBkeypWZs= +github.com/miekg/dns v1.1.59/go.mod h1:nZpewl5p6IvctfgrckopVx2OlSEHPRO/U4SYkRklrEk= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -245,14 +202,12 @@ github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8 github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/mrz1836/go-cache v0.9.7 h1:v9QhZqwkDCkKxbA4HuuKoP6cvf9PFTE2Q7dOpxxuDcE= github.com/mrz1836/go-cache v0.9.7/go.mod h1:j3Jm/6bUEb9ilzYmKXu6nGy6D488e0vP7//dnqyQUpc= -github.com/mrz1836/go-cachestore v0.3.6 h1:/llHdNN6nXvFaRaN6T2icGQ/FHNZwWkTvDwNuIsZbY4= -github.com/mrz1836/go-cachestore v0.3.6/go.mod h1:IR9VXbyE+FN/1VguWRlXK4sAbu375FS1XUAb8IXOzvs= +github.com/mrz1836/go-cachestore v0.3.10 h1:h9M4w9Vmzu7iKZJ+gmcGVwtKxZTYM9UZkd+am5q78nc= +github.com/mrz1836/go-cachestore v0.3.10/go.mod h1:c54HUBBvmrB9pq/xDhiiktDbuwA6i+Q3H6ov091IbHM= github.com/mrz1836/go-logger v0.3.3 h1:L/u+So5yrsYi7KhkFWlZ8v28cmoHt6aB7X8uVEIEHu8= github.com/mrz1836/go-logger v0.3.3/go.mod h1:hlP6K2fnTcisDbcYw9u3eV+1TW5jCsYUfoujA4+38NY= -github.com/newrelic/go-agent/v3 v3.31.0 h1:MVZA93FO6IEybg5EZUcOHUoDg5oBFuy8nrUIa2hfd8M= -github.com/newrelic/go-agent/v3 v3.31.0/go.mod h1:MnbPbcIAmtKH80ZRXovE9kQLDs0Nc32IQa7bWydDKsk= -github.com/newrelic/go-agent/v3/integrations/nrmongo v1.1.3 h1:Z85RJZKk+hghOQYJzsKUo3s4vP9W7/HUlB+CuLelqnc= -github.com/newrelic/go-agent/v3/integrations/nrmongo v1.1.3/go.mod h1:BzSK3ljUwW9PaTPdKstpKwQszKPnrU3xUaqidleearI= +github.com/newrelic/go-agent/v3 v3.33.0 h1:0Phrvp6KWOcJPsIxskL9ZrVddhrZDl1xokNtTjN4GpQ= +github.com/newrelic/go-agent/v3 v3.33.0/go.mod h1:SMdqPzE/ghkWdY0rYGSD7Clw2daK/XH6pUnVd4albg4= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -266,21 +221,21 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.27.5 h1:T/X6I0RNFw/kTqgfkZPcQ5KU6vCnWNBGdtrIx2dpGeQ= github.com/onsi/gomega v1.27.5/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= +github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= +github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= +github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= github.com/rafaeljusto/redigomock v2.4.0+incompatible h1:d7uo5MVINMxnRr20MxbgDkmZ8QRfevjOVgEa4n0OZyY= github.com/rafaeljusto/redigomock v2.4.0+incompatible/go.mod h1:JaY6n2sDr+z2WTsXkOmNRUfDy6FN0L6Nk7x06ndm4tY= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -290,25 +245,16 @@ github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= -github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= -github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= -github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= -github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= -github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= -github.com/sosodev/duration v1.2.0 h1:pqK/FLSjsAADWY74SyWDCjOcd5l7H8GSnnOGEB9A1Us= -github.com/sosodev/duration v1.2.0/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= -github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/sosodev/duration v1.3.1 h1:qtHBDMQ6lvMQsL15g4aopM4HEfOaYuhWBw3NPTtlqq4= +github.com/sosodev/duration v1.3.1/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -326,29 +272,17 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/tetratelabs/wazero v1.5.0 h1:Yz3fZHivfDiZFUXnWMPUoiW7s8tC1sjdBtlJn08qYa0= -github.com/tetratelabs/wazero v1.5.0/go.mod h1:0U0G41+ochRKoPKCJlh0jMg1CHkyfK8kDqiirMmKY8A= -github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM= -github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= -github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= -github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= -github.com/tonicpow/go-minercraft/v2 v2.0.8 h1:gDjHOpmD0P5qRLpgRLUHDcDR39DdT5c/XhmOKPDfNjY= -github.com/tonicpow/go-minercraft/v2 v2.0.8/go.mod h1:mfr1fgOpnu2GkTmPDT4Sanoh4wOfV6kcwOrjVdo8vPk= -github.com/tryvium-travels/memongo v0.11.0 h1:VpFkeigK7bge9aXH+oVG+H3OI2ih12riTROk0CvERrk= -github.com/tryvium-travels/memongo v0.11.0/go.mod h1:riRUHKRQ5JbeX2ryzFfmr7P2EYXIkNwgloSQJPpBikA= +github.com/tonicpow/go-minercraft/v2 v2.1.0 h1:F9jDhZ+0o6xNiCbT0FzGRTdky6ZgZIi5EKqXJULTToI= +github.com/tonicpow/go-minercraft/v2 v2.1.0/go.mod h1:tyjPBBc3xejO5uNtxmiS3fz/7Oairj1jbBaeqhWjeeE= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/vektah/gqlparser/v2 v2.5.11 h1:JJxLtXIoN7+3x6MBdtIP59TP1RANnY7pXOaDnADQSf8= -github.com/vektah/gqlparser/v2 v2.5.11/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc= +github.com/vektah/gqlparser/v2 v2.5.12 h1:COMhVVnql6RoaF7+aTBWiTADdpLGyZWU3K/NwW0ph98= +github.com/vektah/gqlparser/v2 v2.5.12/go.mod h1:WQQjFc+I1YIzoPvZBhUQX7waZgg3pMLi0r8KymvAE2w= github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= @@ -366,8 +300,8 @@ github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gi github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= -github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4= +github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76 h1:tBiBTKHnIjovYoLX/TPkcf+OjqqKGQrPtGT3Foz+Pgo= +github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76/go.mod h1:SQliXeA7Dhkt//vS29v3zpbEwoa+zb2Cn5xj5uO4K5U= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -377,33 +311,28 @@ go.elastic.co/ecszerolog v0.2.0 h1:nbX4dQ08jb3+vsvACfmzAqGDoBh8F2HQDUgpqwAVTg0= go.elastic.co/ecszerolog v0.2.0/go.mod h1:wR5Mv0BVQJ17LopUX5Fd0LLKCC9iF++58iKY+lL09lc= go.mongodb.org/mongo-driver v1.11.7 h1:LIwYxASDLGUg/8wOhgOOZhX8tQa/9tgZPgzZoVqJvcs= go.mongodb.org/mongo-driver v1.11.7/go.mod h1:G9TgswdsWjX4tmDA5zfs2+6AEPpYJwqblyjsfuh8oXY= -go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= -go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= -go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= -go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.7.0 h1:pskyeJh/3AmoQ8CPE95vxHLqp1G1GfGNXTmcl9NEKTc= -golang.org/x/arch v0.7.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= +golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -416,9 +345,9 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -426,8 +355,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -442,7 +371,6 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -450,14 +378,16 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -465,10 +395,9 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -479,16 +408,16 @@ golang.org/x/tools v0.0.0-20200530233709-52effbd89c51/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= -golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= +golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa h1:RBgMaUMP+6soRkik4VoN8ojR2nex2TqZwjSSogic+eo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e h1:Elxv5MwEkCI9f5SkoL6afed6NTdxaGoAo39eANBwHL8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -497,15 +426,13 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/src-d/go-errors.v1 v1.0.0 h1:cooGdZnCjYbeS1zb1s6pVAAimTdKceRrpn7aKOnNIfc= -gopkg.in/src-d/go-errors.v1 v1.0.0/go.mod h1:q1cBlomlw2FnDBDNGlnh6X0jPihy+QxZfMMNxPCbdYg= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -525,9 +452,9 @@ gorm.io/driver/sqlite v1.5.5/go.mod h1:6NgQ7sQWAIFsPrJJl1lSNSu2TABh0ZZ/zm5fosATa gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.25.2/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= -gorm.io/gorm v1.25.9 h1:wct0gxZIELDk8+ZqF/MVnHLkA1rvYlBWUMv2EdsK1g8= -gorm.io/gorm v1.25.9/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= -gorm.io/plugin/dbresolver v1.5.0 h1:XVHLxh775eP0CqVh3vcfJtYqja3uFl5Wr3cKlY8jgDY= -gorm.io/plugin/dbresolver v1.5.0/go.mod h1:l4Cn87EHLEYuqUncpEeTC2tTJQkjngPSD+lo8hIvcT0= +gorm.io/gorm v1.25.10 h1:dQpO+33KalOA+aFYGlK+EfxcI5MbO7EP2yYygwh9h+s= +gorm.io/gorm v1.25.10/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= +gorm.io/plugin/dbresolver v1.5.1 h1:s9Dj9f7r+1rE3nx/Ywzc85nXptUEaeOO0pt27xdopM8= +gorm.io/plugin/dbresolver v1.5.1/go.mod h1:l4Cn87EHLEYuqUncpEeTC2tTJQkjngPSD+lo8hIvcT0= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/engine/model_contact.go b/engine/model_contact.go index 50238763..eec41e59 100644 --- a/engine/model_contact.go +++ b/engine/model_contact.go @@ -275,14 +275,8 @@ func (c *Contact) BeforeUpdating(_ context.Context) (err error) { // Migrate model specific migration on startup func (c *Contact) Migrate(client datastore.ClientInterface) error { tableName := client.GetTableName(tableContacts) - if client.Engine() == datastore.MySQL { - if err := c.migrateMySQL(client, tableName); err != nil { - return err - } - } else if client.Engine() == datastore.PostgreSQL { - if err := c.migratePostgreSQL(client, tableName); err != nil { - return err - } + if err := c.migratePostgreSQL(client, tableName); err != nil { + return err } return client.IndexMetadata(client.GetTableName(tableContacts), MetadataField) @@ -297,20 +291,3 @@ func (c *Contact) migratePostgreSQL(client datastore.ClientInterface, tableName } return nil } - -// migrateMySQL is specific migration SQL for MySQL -func (c *Contact) migrateMySQL(client datastore.ClientInterface, tableName string) error { - idxName := "idx_" + tableName + "_contacts" - idxExists, err := client.IndexExists(tableName, idxName) - if err != nil { - return err - } - if !idxExists { - tx := client.Execute("CREATE INDEX " + idxName + " ON `" + tableName + "` (full_name, paymail)") - if tx.Error != nil { - c.Client().Logger().Error().Msgf("failed creating json index on mysql: %s", tx.Error.Error()) - return nil //nolint:nolintlint,nilerr // error is not needed - } - } - return nil -} diff --git a/engine/model_destinations_test.go b/engine/model_destinations_test.go index 6a7c3ea4..a5cc9c85 100644 --- a/engine/model_destinations_test.go +++ b/engine/model_destinations_test.go @@ -440,53 +440,6 @@ func (ts *EmbeddedDBTestSuite) TestDestination_Save() { assert.Equal(t, true, setCmd.Called) }) - ts.T().Run("[mysql] [redis] [mocking] - create destination", func(t *testing.T) { - tc := ts.genericMockedDBClient(t, datastore.MySQL) - defer tc.Close(tc.ctx) - - xPub := newXpub(testXPub, append(tc.client.DefaultModelOptions(), New())...) - require.NotNil(t, xPub) - - destination := newDestination(xPub.ID, testLockingScript, append(tc.client.DefaultModelOptions(), New())...) - require.NotNil(t, destination) - destination.DraftID = testDraftID - - // Create the expectations - tc.MockSQLDB.ExpectBegin() - - // Create model - tc.MockSQLDB.ExpectExec("INSERT INTO `"+tc.tablePrefix+"_destinations` ("+ - "`created_at`,`updated_at`,`metadata`,`deleted_at`,`id`,`xpub_id`,`locking_script`,"+ - "`type`,`chain`,`num`,`paymail_external_derivation_num`,`address`,`draft_id`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)").WithArgs( - tester.AnyTime{}, // created_at - tester.AnyTime{}, // updated_at - nil, // metadata - nil, // deleted_at - tester.AnyGUID{}, // id - xPub.GetID(), // xpub_id - testLockingScript, // locking_script - destination.Type, // type - 0, // chain - 0, // num - nil, // paymail_external_derivation_num - destination.Address, // address - testDraftID, // draft_id - ).WillReturnResult(sqlmock.NewResult(1, 1)) - - // Commit the TX - tc.MockSQLDB.ExpectCommit() - - // @mrz: this is only testing a SET cmd is fired, not the data being set (that is tested elsewhere) - setCmd := tc.redisConn.GenericCommand(cache.SetCommand).Expect("ok") - - err := destination.Save(tc.ctx) - require.NoError(t, err) - - err = tc.MockSQLDB.ExpectationsWereMet() - require.NoError(t, err) - assert.Equal(t, true, setCmd.Called) - }) - ts.T().Run("[postgresql] [redis] [mocking] - create destination", func(t *testing.T) { tc := ts.genericMockedDBClient(t, datastore.PostgreSQL) defer tc.Close(tc.ctx) diff --git a/engine/model_paymail_addresses.go b/engine/model_paymail_addresses.go index 8a270c53..de6be0cd 100644 --- a/engine/model_paymail_addresses.go +++ b/engine/model_paymail_addresses.go @@ -335,14 +335,8 @@ func (m *PaymailAddress) AfterCreated(_ context.Context) error { // Migrate model specific migration on startup func (m *PaymailAddress) Migrate(client datastore.ClientInterface) error { tableName := client.GetTableName(tablePaymailAddresses) - if client.Engine() == datastore.MySQL { - if err := m.migrateMySQL(client, tableName); err != nil { - return err - } - } else if client.Engine() == datastore.PostgreSQL { - if err := m.migratePostgreSQL(client, tableName); err != nil { - return err - } + if err := m.migratePostgreSQL(client, tableName); err != nil { + return err } return client.IndexMetadata(client.GetTableName(tablePaymailAddresses), MetadataField) @@ -358,23 +352,6 @@ func (m *PaymailAddress) migratePostgreSQL(client datastore.ClientInterface, tab return nil } -// migrateMySQL is specific migration SQL for MySQL -func (m *PaymailAddress) migrateMySQL(client datastore.ClientInterface, tableName string) error { - idxName := "idx_" + tableName + "_paymail_address" - idxExists, err := client.IndexExists(tableName, idxName) - if err != nil { - return err - } - if !idxExists { - tx := client.Execute("CREATE UNIQUE INDEX " + idxName + " ON `" + tableName + "` (alias, domain)") - if tx.Error != nil { - m.Client().Logger().Error().Msgf("failed creating json index on mysql: %s", tx.Error.Error()) - return nil //nolint:nolintlint,nilerr // error is not needed - } - } - return nil -} - func (m *PaymailAddress) String() string { return fmt.Sprintf("%s@%s", m.Alias, m.Domain) } diff --git a/engine/model_utxos.go b/engine/model_utxos.go index c32474d4..1372f711 100644 --- a/engine/model_utxos.go +++ b/engine/model_utxos.go @@ -444,41 +444,20 @@ func (m *Utxo) GenerateID() string { return utils.Hash(fmt.Sprintf("%s|%d", m.TransactionID, m.OutputIndex)) } -// Migrate model specific migration on startup -func (m *Utxo) Migrate(client datastore.ClientInterface) error { - tableName := client.GetTableName(tableUTXOs) - if client.Engine() == datastore.MySQL { - if err := m.migrateMySQL(client, tableName); err != nil { - return err - } - } else if client.Engine() == datastore.PostgreSQL { - if err := m.migratePostgreSQL(client, tableName); err != nil { - return err - } - } - - return client.IndexMetadata(client.GetTableName(tableUTXOs), metadataField) -} - // migratePostgreSQL is specific migration SQL for Postgresql func (m *Utxo) migratePostgreSQL(client datastore.ClientInterface, tableName string) error { tx := client.Execute(`CREATE INDEX IF NOT EXISTS "idx_utxo_reserved" ON "` + tableName + `" ("xpub_id","type","draft_id","spending_tx_id")`) return tx.Error } -// migrateMySQL is specific migration SQL for MySQL -func (m *Utxo) migrateMySQL(client datastore.ClientInterface, tableName string) error { - idxName := "idx_" + tableName + "_reserved" - idxExists, err := client.IndexExists(tableName, idxName) - if err != nil { - return err - } - if !idxExists { - tx := client.Execute("CREATE INDEX `" + idxName + "` ON `" + tableName + "` (xpub_id,type,draft_id,spending_tx_id)") - if tx.Error != nil { - return tx.Error +// Migrate model specific migration on startup +func (m *Utxo) Migrate(client datastore.ClientInterface) error { + tableName := client.GetTableName(tableUTXOs) + if client.Engine() == datastore.PostgreSQL { + if err := m.migratePostgreSQL(client, tableName); err != nil { + return err } } - return nil + return client.IndexMetadata(client.GetTableName(tableUTXOs), metadataField) } diff --git a/engine/model_xpubs_test.go b/engine/model_xpubs_test.go index 20ea666e..f66f293d 100644 --- a/engine/model_xpubs_test.go +++ b/engine/model_xpubs_test.go @@ -370,45 +370,6 @@ func (ts *EmbeddedDBTestSuite) TestXpub_Save() { assert.Equal(t, true, setCmd.Called) }) - ts.T().Run("[mysql] [redis] [mocking] - create xpub", func(t *testing.T) { - tc := ts.genericMockedDBClient(t, datastore.MySQL) - defer tc.Close(tc.ctx) - - xPub := newXpub(testXPub, append(tc.client.DefaultModelOptions(), New())...) - require.NotNil(t, xPub) - - // Create the expectations - tc.MockSQLDB.ExpectBegin() - - // Create model - tc.MockSQLDB.ExpectExec("INSERT INTO `"+tc.tablePrefix+"_"+tableXPubs+"` (`created_at`,`updated_at`,`metadata`,`deleted_at`,`id`,"+ - "`current_balance`,`next_internal_num`,`next_external_num`"+ - ") VALUES (?,?,?,?,?,?,?,?)").WithArgs( - tester.AnyTime{}, // created_at - tester.AnyTime{}, // updated_at - nil, // metadata - nil, // deleted_at - xPub.GetID(), // id - 0, // current_balance - 0, // next_internal_num - 0, // next_external_num - ).WillReturnResult(sqlmock.NewResult(1, 1)) - - // Commit the TX - tc.MockSQLDB.ExpectCommit() - - // @mrz: this is only testing a SET cmd is fired, not the data being set (that is tested elsewhere) - setCmd := tc.redisConn.GenericCommand(cache.SetCommand).Expect("ok") - - err := xPub.Save(tc.ctx) - require.NoError(t, err) - - err = tc.MockSQLDB.ExpectationsWereMet() - require.NoError(t, err) - - assert.Equal(t, true, setCmd.Called) - }) - ts.T().Run("[postgresql] [redis] [mocking] - create xpub", func(t *testing.T) { tc := ts.genericMockedDBClient(t, datastore.PostgreSQL) defer tc.Close(tc.ctx) @@ -445,8 +406,4 @@ func (ts *EmbeddedDBTestSuite) TestXpub_Save() { assert.Equal(t, true, setCmd.Called) }) - - ts.T().Run("[mongo] [redis] [mocking] - create xpub", func(t *testing.T) { - // todo: mocking for MongoDB - }) } diff --git a/engine/spv_wallet_engine_suite_test.go b/engine/spv_wallet_engine_suite_test.go index 8428c699..0c442e51 100644 --- a/engine/spv_wallet_engine_suite_test.go +++ b/engine/spv_wallet_engine_suite_test.go @@ -13,22 +13,15 @@ import ( "github.com/bitcoin-sv/spv-wallet/engine/datastore" "github.com/bitcoin-sv/spv-wallet/engine/taskmanager" "github.com/bitcoin-sv/spv-wallet/engine/tester" - "github.com/dolthub/go-mysql-server/server" embeddedPostgres "github.com/fergusstrange/embedded-postgres" - "github.com/rs/zerolog/log" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/tryvium-travels/memongo" ) const ( defaultDatabaseName = "spv-wallet-test" defaultNewRelicTx = "testing-transaction" defaultNewRelicApp = "testing-app" - mySQLHost = "localhost" - mySQLPassword = "" - mySQLTestPort = uint32(3307) - mySQLUsername = "root" postgresqlTestHost = "localhost" postgresqlTestName = "postgres" postgresqlTestPort = uint32(61333) @@ -49,8 +42,6 @@ type dbTestCase struct { // dbTestCases is the list of supported databases var dbTestCases = []dbTestCase{ - {name: "[mongo] [in-memory]", database: datastore.MongoDB}, - {name: "[mysql] [in-memory]", database: datastore.MySQL}, {name: "[postgresql] [in-memory]", database: datastore.PostgreSQL}, {name: "[sqlite] [in-memory]", database: datastore.SQLite}, } @@ -58,38 +49,12 @@ var dbTestCases = []dbTestCase{ // EmbeddedDBTestSuite is for testing the entire package using real/mocked services type EmbeddedDBTestSuite struct { suite.Suite - MongoServer *memongo.Server // In-memory Mongo server - MySQLServer *server.Server // In-memory MySQL server PostgresqlServer *embeddedPostgres.EmbeddedPostgres // In-memory Postgresql server } -// serveMySQL will serve the MySQL server and exit if quit -func (ts *EmbeddedDBTestSuite) serveMySQL() { - err := ts.MySQLServer.Start() - if err != nil { - log.Error().Msgf("mysql server error: %s", err.Error()) - } -} - // SetupSuite runs at the start of the suite func (ts *EmbeddedDBTestSuite) SetupSuite() { var err error - - // Create the MySQL server - if ts.MySQLServer, err = tester.CreateMySQL( - mySQLHost, defaultDatabaseName, mySQLUsername, mySQLPassword, mySQLTestPort, - ); err != nil { - require.NoError(ts.T(), err) - } - - // Don't block, serve the MySQL instance - go ts.serveMySQL() - - // Create the Mongo server - if ts.MongoServer, err = tester.CreateMongoServer(mongoTestVersion); err != nil { - require.NoError(ts.T(), err) - } - // Create the Postgresql server if ts.PostgresqlServer, err = tester.CreatePostgresServer(postgresqlTestPort); err != nil { require.NoError(ts.T(), err) @@ -104,26 +69,10 @@ func (ts *EmbeddedDBTestSuite) SetupSuite() { // TearDownSuite runs after the suite finishes func (ts *EmbeddedDBTestSuite) TearDownSuite() { - // Stop the Mongo server - if ts.MongoServer != nil { - ts.MongoServer.Stop() - } - // Stop the postgresql server if ts.PostgresqlServer != nil { _ = ts.PostgresqlServer.Stop() } - - // Stop the MySQL server - if ts.MySQLServer != nil { - /* - defer ts.wg.Done() - if ts.quit != nil { - close(ts.quit) - } - */ - _ = ts.MySQLServer.Close() - } } // SetupTest runs before each test @@ -174,12 +123,9 @@ func (ts *EmbeddedDBTestSuite) createTestClient(ctx context.Context, database da }, ExistingConnection: tc.SQLConn, })) - } else if database == datastore.MySQL { - opts = append(opts, WithSQLConnection(datastore.MySQL, tc.SQLConn, tablePrefix)) } else if database == datastore.PostgreSQL { opts = append(opts, WithSQLConnection(datastore.PostgreSQL, tc.SQLConn, tablePrefix)) - } else { // todo: finish more Datastore support (missing: Mongo) - // "https://medium.com/@victor.neuret/mocking-the-official-mongo-golang-driver-5aad5b226a78" + } else { return nil, ErrDatastoreNotSupported } @@ -195,24 +141,6 @@ func (ts *EmbeddedDBTestSuite) createTestClient(ctx context.Context, database da Shared: true, // mrz: TestTransaction_Save requires this to be true for some reason // I get the error: no such table: _17a1f3e22f2eec56_utxos })) - } else if database == datastore.MongoDB { - - // Sanity check - if ts.MongoServer == nil { - return nil, ErrLoadServerFirst - } - - // Add the new Mongo connection - opts = append(opts, WithMongoDB(&datastore.MongoDBConfig{ - CommonConfig: datastore.CommonConfig{ - MaxIdleConnections: 1, - MaxOpenConnections: 1, - TablePrefix: tablePrefix, - }, - URI: ts.MongoServer.URIWithRandomDB(), - DatabaseName: memongo.RandomDatabase(), - })) - } else if database == datastore.PostgreSQL { // Sanity check @@ -227,34 +155,11 @@ func (ts *EmbeddedDBTestSuite) createTestClient(ctx context.Context, database da MaxOpenConnections: 1, TablePrefix: tablePrefix, }, - Host: postgresqlTestHost, - Name: postgresqlTestName, - User: postgresqlTestUser, - Password: postgresTestPassword, - Port: fmt.Sprintf("%d", postgresqlTestPort), - SkipInitializeWithVersion: true, - })) - - } else if database == datastore.MySQL { - - // Sanity check - if ts.MySQLServer == nil { - return nil, ErrLoadServerFirst - } - - // Add the new Postgresql connection - opts = append(opts, WithSQL(datastore.MySQL, &datastore.SQLConfig{ - CommonConfig: datastore.CommonConfig{ - MaxIdleConnections: 1, - MaxOpenConnections: 1, - TablePrefix: tablePrefix, - }, - Host: mySQLHost, - Name: defaultDatabaseName, - User: mySQLUsername, - Password: mySQLPassword, - Port: fmt.Sprintf("%d", mySQLTestPort), - SkipInitializeWithVersion: true, + Host: postgresqlTestHost, + Name: postgresqlTestName, + User: postgresqlTestUser, + Password: postgresTestPassword, + Port: fmt.Sprintf("%d", postgresqlTestPort), })) } else { diff --git a/engine/tester/database.go b/engine/tester/database.go index c6b8f285..2f280108 100644 --- a/engine/tester/database.go +++ b/engine/tester/database.go @@ -2,18 +2,10 @@ package tester import ( "database/sql/driver" - "fmt" - "os" "time" "github.com/bitcoin-sv/spv-wallet/engine/datastore" - sqle "github.com/dolthub/go-mysql-server" - "github.com/dolthub/go-mysql-server/memory" - "github.com/dolthub/go-mysql-server/server" - "github.com/dolthub/go-mysql-server/sql" - "github.com/dolthub/go-mysql-server/sql/information_schema" embeddedPostgres "github.com/fergusstrange/embedded-postgres" - "github.com/tryvium-travels/memongo" ) // AnyTime will fill the need for any timestamp field @@ -51,48 +43,6 @@ func CreatePostgresServer(port uint32) (*embeddedPostgres.EmbeddedPostgres, erro return postgres, nil } -// CreateMongoServer will create a new mongo server -func CreateMongoServer(version string) (*memongo.Server, error) { - mongoServer, err := memongo.StartWithOptions( - &memongo.Options{ - MongoVersion: version, - ShouldUseReplica: false, - DownloadURL: os.Getenv("SPV_WALLET_MONGODB_DOWNLOAD_URL"), - }, - ) - if err != nil { - return nil, err - } - - return mongoServer, nil -} - -// CreateMySQL will make a new MySQL server -// NOTE: not using username, password anymore since the mysql package removed "auth" -func CreateMySQL(host, databaseName, _, _ string, port uint32) (*server.Server, error) { - engine := sqle.NewDefault( - sql.NewDatabaseProvider( - CreateMySQLTestDatabase(databaseName), - information_schema.NewInformationSchemaDatabase(), - )) - config := server.Config{ - Protocol: "tcp", - Address: fmt.Sprintf("%s:%d", host, port), - // This package is no longer found in: github.com/dolthub/go-mysql-server v0.12.0 - // Auth: auth.NewNativeSingle(username, password, auth.AllPermissions), - } - s, err := server.NewDefaultServer(config, engine) - if err != nil { - return nil, err - } - return s, nil -} - -// CreateMySQLTestDatabase is a dummy database for MySQL -func CreateMySQLTestDatabase(databaseName string) *memory.Database { - return memory.NewDatabase(databaseName) -} - // SQLiteTestConfig will return a test-version of SQLite func SQLiteTestConfig(debug, shared bool) *datastore.SQLiteConfig { return &datastore.SQLiteConfig{ diff --git a/engine/tester/embedded_test.go b/engine/tester/embedded_test.go deleted file mode 100644 index aab60eac..00000000 --- a/engine/tester/embedded_test.go +++ /dev/null @@ -1,82 +0,0 @@ -//go:build database_tests -// +build database_tests - -package tester - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -const ( - // testDatabasePort1 = 23902 - testDatabaseHost = "localhost" - testDatabaseName = "test" - testDatabasePassword = "tester-pw" - testDatabasePort2 = 23903 - testDatabaseUser = "tester" - //testMongoVersion = "4.2.1" - testMongoVersion = "6.0.4" -) - -// TestCreateMongoServer will test the method CreateMongoServer() -func TestCreateMongoServer(t *testing.T) { - t.Parallel() - - t.Run("valid server", func(t *testing.T) { - server, err := CreateMongoServer( - testMongoVersion, - ) - require.NoError(t, err) - require.NotNil(t, server) - server.Stop() - }) -} - -/* -@mrz: This has some strange issues re-running and fails inconsistently - -// TestCreatePostgresServer will test the method CreatePostgresServer() -func TestCreatePostgresServer(t *testing.T) { - // t.Parallel() (disabled for now) - - t.Run("valid server", func(t *testing.T) { - server, err := CreatePostgresServer( - 23902, - ) - require.NoError(t, err) - require.NotNil(t, server) - err = server.Stop() - require.NoError(t, err) - }) -} -*/ - -// TestCreateMySQL will test the method CreateMySQL() -func TestCreateMySQL(t *testing.T) { - t.Parallel() - - t.Run("valid server", func(t *testing.T) { - server, err := CreateMySQL( - testDatabaseHost, testDatabaseName, testDatabaseUser, - testDatabasePassword, testDatabasePort2, - ) - require.NoError(t, err) - require.NotNil(t, server) - err = server.Close() - require.NoError(t, err) - }) -} - -// TestCreateMySQLTestDatabase will test the method CreateMySQLTestDatabase() -func TestCreateMySQLTestDatabase(t *testing.T) { - t.Parallel() - - t.Run("valid db", func(t *testing.T) { - db := CreateMySQLTestDatabase(testDatabaseName) - require.NotNil(t, db) - assert.Equal(t, testDatabaseName, db.Name()) - }) -} diff --git a/go.mod b/go.mod index ccda979c..c24635b7 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/bitcoin-sv/spv-wallet -go 1.21.5 +go 1.22 + +toolchain go1.22.3 // NOTE: The following replace directives are essential for maintaining the cohesion and functionality of this project. // We are using the packages github.com/bitcoin-sv/spv-wallet/models and github.com/bitcoin-sv/spv-wallet/engine directly @@ -13,58 +15,61 @@ replace github.com/bitcoin-sv/spv-wallet/engine => ./engine require ( github.com/bitcoin-sv/go-broadcast-client v0.18.1 - github.com/bitcoin-sv/spv-wallet/engine v0.0.0-00010101000000-000000000000 - github.com/bitcoin-sv/spv-wallet/models v0.25.0 - github.com/gin-contrib/pprof v1.4.0 - github.com/gin-gonic/gin v1.9.1 + github.com/bitcoin-sv/spv-wallet/engine v0.27.3 + github.com/bitcoin-sv/spv-wallet/models v0.27.3 + github.com/gin-contrib/pprof v1.5.0 + github.com/gin-gonic/gin v1.10.0 github.com/go-ozzo/ozzo-validation v3.6.0+incompatible github.com/go-redis/redis/v8 v8.11.5 - github.com/mrz1836/go-cachestore v0.3.9 - github.com/mrz1836/go-sanitize v1.3.1 + github.com/mrz1836/go-cachestore v0.3.10 + github.com/mrz1836/go-sanitize v1.3.2 github.com/mrz1836/go-validate v0.2.1 - github.com/newrelic/go-agent/v3 v3.32.0 - github.com/prometheus/client_golang v1.19.0 - github.com/rs/zerolog v1.32.0 + github.com/newrelic/go-agent/v3 v3.33.0 + github.com/prometheus/client_golang v1.19.1 + github.com/rs/zerolog v1.33.0 github.com/spf13/viper v1.18.2 github.com/stretchr/testify v1.9.0 github.com/swaggo/swag v1.16.3 ) require ( - github.com/99designs/gqlgen v0.17.43 // indirect + github.com/bytedance/sonic/loader v0.1.1 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect +) + +require ( + github.com/99designs/gqlgen v0.17.47 // indirect github.com/KyleBanks/depth v1.2.1 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bitcoin-sv/go-paymail v0.14.0 // indirect github.com/bitcoinschema/go-bitcoin/v2 v2.0.5 github.com/bitcoinschema/go-bpu v0.1.3 // indirect - github.com/bitcoinschema/go-map v0.1.0 // indirect + github.com/bitcoinschema/go-map v0.1.1 // indirect github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173 // indirect github.com/bitcoinsv/bsvutil v0.0.0-20181216182056-1d77cf353ea9 // indirect github.com/bsm/redislock v0.9.4 // indirect - github.com/bytedance/sonic v1.10.2 // indirect + github.com/bytedance/sonic v1.11.7 // indirect github.com/capnm/sysinfo v0.0.0-20130621111458-5909a53897f3 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect - github.com/chenzhuoyu/iasm v0.9.1 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/coocood/freecache v1.2.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect + github.com/gabriel-vasile/mimetype v1.4.4 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-openapi/jsonpointer v0.20.2 // indirect - github.com/go-openapi/jsonreference v0.20.4 // indirect - github.com/go-openapi/spec v0.20.14 // indirect - github.com/go-openapi/swag v0.22.9 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/spec v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.18.0 // indirect + github.com/go-playground/validator/v10 v10.20.0 // indirect github.com/go-redis/redis_rate/v9 v9.1.2 // indirect - github.com/go-resty/resty/v2 v2.11.0 // indirect - github.com/go-sql-driver/mysql v1.7.1 // indirect - github.com/goccy/go-json v0.10.2 // indirect + github.com/go-resty/resty/v2 v2.13.1 // indirect + github.com/goccy/go-json v0.10.3 // indirect github.com/gojektech/heimdall/v6 v6.1.0 // indirect github.com/gojektech/valkyrie v0.0.0-20190210220504-8f62c1e7ba45 // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -82,38 +87,37 @@ require ( github.com/jinzhu/now v1.1.5 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.6 // indirect - github.com/klauspost/cpuid/v2 v2.2.6 // indirect + github.com/klauspost/compress v1.17.8 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/libsv/go-bc v0.1.28 // indirect github.com/libsv/go-bk v0.1.6 // indirect github.com/libsv/go-bt v1.0.8 // indirect github.com/libsv/go-bt/v2 v2.2.5 - github.com/libsv/go-p2p v0.1.9 // indirect + github.com/libsv/go-p2p v0.2.3 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-sqlite3 v1.14.22 // indirect - github.com/miekg/dns v1.1.58 // indirect + github.com/miekg/dns v1.1.59 // indirect github.com/mitchellh/mapstructure v1.5.0 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/montanaflynn/stats v0.7.1 // indirect github.com/mrz1836/go-cache v0.9.7 // indirect github.com/mrz1836/go-logger v0.3.3 // indirect - github.com/newrelic/go-agent/v3/integrations/nrmongo v1.1.3 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.48.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.53.0 // indirect + github.com/prometheus/procfs v0.15.0 // indirect github.com/rafaeljusto/redigomock v2.4.0+incompatible // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/sosodev/duration v1.2.0 // indirect + github.com/sosodev/duration v1.3.1 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.6.0 // indirect @@ -122,39 +126,38 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect github.com/swaggo/files v1.0.1 github.com/swaggo/gin-swagger v1.6.0 - github.com/tonicpow/go-minercraft/v2 v2.0.8 + github.com/tonicpow/go-minercraft/v2 v2.1.0 github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect - github.com/vektah/gqlparser/v2 v2.5.11 // indirect + github.com/vektah/gqlparser/v2 v2.5.12 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/vmihailenco/taskq/v3 v3.2.9 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect - github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect + github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76 // indirect go.elastic.co/ecszerolog v0.2.0 - go.mongodb.org/mongo-driver v1.13.1 // indirect + go.mongodb.org/mongo-driver v1.15.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/arch v0.7.0 // indirect - golang.org/x/crypto v0.22.0 // indirect - golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 // indirect - golang.org/x/mod v0.16.0 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.19.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa // indirect - google.golang.org/grpc v1.62.1 // indirect - google.golang.org/protobuf v1.33.0 // indirect + golang.org/x/arch v0.8.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect + golang.org/x/tools v0.21.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e // indirect + google.golang.org/grpc v1.64.0 // indirect + google.golang.org/protobuf v1.34.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gorm.io/driver/mysql v1.5.6 // indirect gorm.io/driver/postgres v1.5.7 // indirect gorm.io/driver/sqlite v1.5.5 // indirect - gorm.io/gorm v1.25.9 // indirect - gorm.io/plugin/dbresolver v1.5.0 // indirect + gorm.io/gorm v1.25.10 // indirect + gorm.io/plugin/dbresolver v1.5.1 // indirect ) // Issue with redislock package diff --git a/go.sum b/go.sum index 19014bd4..8a8eb917 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,10 @@ -github.com/99designs/gqlgen v0.17.43 h1:I4SYg6ahjowErAQcHFVKy5EcWuwJ3+Xw9z2fLpuFCPo= -github.com/99designs/gqlgen v0.17.43/go.mod h1:lO0Zjy8MkZgBdv4T1U91x09r0e0WFOdhVUutlQs1Rsc= +github.com/99designs/gqlgen v0.17.47 h1:M9DTK8X3+3ATNBfZlHBwMwNngn4hhZWDxNmTiuQU5tQ= +github.com/99designs/gqlgen v0.17.47/go.mod h1:ejVkldSdtmuudqmtfaiqjwlGXWAhIv0DKXGXFY25F04= github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU= github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/DataDog/datadog-go v3.7.1+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= -github.com/acobaugh/osrelease v0.1.0 h1:Yb59HQDGGNhCj4suHaFQQfBps5wyoKLSSX/J/+UifRE= -github.com/acobaugh/osrelease v0.1.0/go.mod h1:4bFEs0MtgHNHBrmHCt67gNisnabCRAlzdVasCEGHTWY= github.com/afex/hystrix-go v0.0.0-20180209013831-27fae8d30f1a/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 h1:uvdUDbHQHO85qeSydJtItA4T55Pw6BtAejd0APRJOCE= github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= @@ -26,41 +24,35 @@ github.com/bitcoin-sv/go-paymail v0.14.0 h1:xG/fql8BOUI2365oLFUVP2KJ6SpI57R5R5tI github.com/bitcoin-sv/go-paymail v0.14.0/go.mod h1:IuT/blY8OjhmMLQ2cgCmoL/2NfJL2gME46VHj5HAzxA= github.com/bitcoinschema/go-bitcoin/v2 v2.0.5 h1:Sgh5Eb746Zck/46rFDrZZEXZWyO53fMuWYhNoZa1tck= github.com/bitcoinschema/go-bitcoin/v2 v2.0.5/go.mod h1:JjO1ivfZv6vhK0uAXzyH08AAHlzNMAfnyK1Fiv9r4ZA= -github.com/bitcoinschema/go-bob v0.4.0 h1:adsAEboLQCg0D6e9vwcJUJEJScszsouAYCYu35UAiGo= -github.com/bitcoinschema/go-bob v0.4.0/go.mod h1:Qc8BG9MsYrumSVyihHVuvLhd22FHjHVVAAq4cdcOMaQ= +github.com/bitcoinschema/go-bob v0.4.3 h1:0iboiIQ3PY2+rrqPr8Gsh5RX+9Ha6Uzyo0bw720Ljlc= +github.com/bitcoinschema/go-bob v0.4.3/go.mod h1:XEHhQ/v+to/s8THRNKU099OpsDreRFYnU/822IihjR8= github.com/bitcoinschema/go-bpu v0.1.3 h1:O7SvuptH4Q7hemD6G9OotPLINZ61CAVOgWKJWKM+edY= github.com/bitcoinschema/go-bpu v0.1.3/go.mod h1:y4ZEDC0fSYRrA6N6bzKwHXdtMrRiQhpurpkTVobz07I= -github.com/bitcoinschema/go-map v0.1.0 h1:dM8OJ/E5MnEm9m1xNI/B3msCgSI9s7Ps3Vk0BFP53eI= -github.com/bitcoinschema/go-map v0.1.0/go.mod h1:36YXG/kob/Z+tCK3EpHMdN9+ADMSDMPYA7JFuPOBi3M= +github.com/bitcoinschema/go-map v0.1.1 h1:r4YF3E0yOMFOJJkjQyKIw+mOwMx3CODRC2RJr7X8Pyw= +github.com/bitcoinschema/go-map v0.1.1/go.mod h1:Q8em9GcLZQ7io9fg3v1Oq3J0u9uAwHTDfOocitxwP/4= github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173 h1:2yTIV9u7H0BhRDGXH5xrAwAz7XibWJtX2dNezMeNsUo= github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173/go.mod h1:BZ1UcC9+tmcDEcdVXgpt13hMczwJxWzpAn68wNs7zRA= github.com/bitcoinsv/bsvutil v0.0.0-20181216182056-1d77cf353ea9 h1:hFI8rT84FCA0FFy3cFrkW5Nz4FyNKlIdCvEvvTNySKg= github.com/bitcoinsv/bsvutil v0.0.0-20181216182056-1d77cf353ea9/go.mod h1:p44KuNKUH5BC8uX4ONEODaHUR4+ibC8todEAOGQEJAM= github.com/bsm/redislock v0.7.2 h1:jggqOio8JyX9FJBKIfjF3fTxAu/v7zC5mAID9LveqG4= github.com/bsm/redislock v0.7.2/go.mod h1:kS2g0Yvlymc9Dz8V3iVYAtLAaSVruYbAFdYBDrmC5WU= -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= -github.com/bytedance/sonic v1.10.2 h1:GQebETVBxYB7JGWJtLBi07OVzWwt+8dWA00gEVW2ZFE= -github.com/bytedance/sonic v1.10.2/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= +github.com/bytedance/sonic v1.11.7 h1:k/l9p1hZpNIMJSk37wL9ltkcpqLfIho1vYthi4xT2t4= +github.com/bytedance/sonic v1.11.7/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= +github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/cactus/go-statsd-client/statsd v0.0.0-20200423205355-cb0885a1018c/go.mod h1:l/bIBLeOl9eX+wxJAzxS4TveKRtAqlyDpHjhkfO0MEI= github.com/capnm/sysinfo v0.0.0-20130621111458-5909a53897f3 h1:IHZ1Le1ejzkmS7Si7dIzJvYDWe+BIoNmqMnfWHBZSVw= github.com/capnm/sysinfo v0.0.0-20130621111458-5909a53897f3/go.mod h1:M5XHQLu90v2JNm/bW2tdsYar+5vhV0gEcBcmDBNAN1Y= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= -github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= -github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA= -github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= -github.com/chenzhuoyu/iasm v0.9.1 h1:tUHQJXo3NhBqw6s33wkGn9SP3bvrWLdlVIJ3hQBL7P0= -github.com/chenzhuoyu/iasm v0.9.1/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/coocood/freecache v1.2.4 h1:UdR6Yz/X1HW4fZOuH0Z94KwG851GWOSknua5VUbb/5M= github.com/coocood/freecache v1.2.4/go.mod h1:RBUWa/Cy+OHdfTGFEhEuE1pMCMX51Ncizj7rthiQ3vk= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -69,16 +61,6 @@ github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WA github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 h1:u3PMzfF8RkKd3lB9pZ2bfn0qEG+1Gms9599cr0REMww= -github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2/go.mod h1:mIEZOHnFx4ZMQeawhw9rhsj+0zwQj7adVsnBX7t+eKY= -github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e h1:kPsT4a47cw1+y/N5SSCkma7FhAPw7KeGmD6c9PBZW9Y= -github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e/go.mod h1:KPUcpx070QOfJK1gNe0zx4pA5sicIK1GMikIGLKC168= -github.com/dolthub/go-mysql-server v0.17.0 h1:ztJjA001l6ZvutCPmwbSpegOlF0W0KKpzDk1m9SYq0s= -github.com/dolthub/go-mysql-server v0.17.0/go.mod h1:vSQ47leaIPTtvSLKo89D1FdYdypU5OH6VBV63B2MS8Y= -github.com/dolthub/jsonpath v0.0.2-0.20230525180605-8dc13778fd72 h1:NfWmngMi1CYUWU4Ix8wM+USEhjc+mhPlT9JUR/anvbQ= -github.com/dolthub/jsonpath v0.0.2-0.20230525180605-8dc13778fd72/go.mod h1:ZWUdY4iszqRQ8OcoXClkxiAVAoWoK3cq0Hvv4ddGRuM= -github.com/dolthub/vitess v0.0.0-20230823204737-4a21a94e90c3 h1:lY3oQbYNMSVjT02n6f2M2H0u4icF6lGbS/IpWr27ti8= -github.com/dolthub/vitess v0.0.0-20230823204737-4a21a94e90c3/go.mod h1:IwjNXSQPymrja5pVqmfnYdcy7Uv7eNJNBPK/MEh9OOw= github.com/fergusstrange/embedded-postgres v1.25.0 h1:sa+k2Ycrtz40eCRPOzI7Ry7TtkWXXJ+YRsxpKMDhxK0= github.com/fergusstrange/embedded-postgres v1.25.0/go.mod h1:t/MLs0h9ukYM6FSt99R7InCHs1nW0ordoVCcnzmpTYw= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -87,58 +69,47 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= -github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= +github.com/gabriel-vasile/mimetype v1.4.4 h1:QjV6pZ7/XZ7ryI2KuyeEDE8wnh7fHP9YnQy+R0LnH8I= +github.com/gabriel-vasile/mimetype v1.4.4/go.mod h1:JwLei5XPtWdGiMFB5Pjle1oEeoSeEuJfJE+TtfvdB/s= github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4= github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk= -github.com/gin-contrib/pprof v1.4.0 h1:XxiBSf5jWZ5i16lNOPbMTVdgHBdhfGRD5PZ1LWazzvg= -github.com/gin-contrib/pprof v1.4.0/go.mod h1:RrehPJasUVBPK6yTUwOl8/NP6i0vbUgmxtis+Z5KE90= +github.com/gin-contrib/pprof v1.5.0 h1:E/Oy7g+kNw94KfdCy3bZxQFtyDnAX2V7axRS7sNYVrU= +github.com/gin-contrib/pprof v1.5.0/go.mod h1:GqFL6LerKoCQ/RSWnkYczkTJ+tOAUVN/8sbnEtaqOKs= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= -github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= -github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= -github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= -github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= -github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= -github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU= -github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4= -github.com/go-openapi/spec v0.20.14 h1:7CBlRnw+mtjFGlPDRZmAMnq35cRzI91xj03HVyUi/Do= -github.com/go-openapi/spec v0.20.14/go.mod h1:8EOhTpBoFiask8rrgwbLC3zmJfz4zsCUueRuPM6GNkw= -github.com/go-openapi/swag v0.22.9 h1:XX2DssF+mQKM2DHsbgZK74y/zj4mo9I99+89xUmuZCE= -github.com/go-openapi/swag v0.22.9/go.mod h1:3/OXnFfnMAwBD099SwYRk7GD3xOrr1iL7d/XNLXVVwE= +github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= +github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY= +github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-ozzo/ozzo-validation v3.6.0+incompatible h1:msy24VGS42fKO9K1vLz82/GeYW1cILu7Nuuj1N3BBkE= github.com/go-ozzo/ozzo-validation v3.6.0+incompatible/go.mod h1:gsEKFIVnabGBt6mXmxK0MoFy+cZoTJY6mu5Ll3LVLBU= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-playground/validator/v10 v10.18.0 h1:BvolUXjp4zuvkZ5YN5t7ebzbhlUtPsPm2S9NAZ5nl9U= -github.com/go-playground/validator/v10 v10.18.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8= +github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-redis/redis_rate/v9 v9.1.2 h1:H0l5VzoAtOE6ydd38j8MCq3ABlGLnvvbA1xDSVVCHgQ= github.com/go-redis/redis_rate/v9 v9.1.2/go.mod h1:oam2de2apSgRG8aJzwJddXbNu91Iyz1m8IKJE2vpvlQ= -github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8= -github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= +github.com/go-resty/resty/v2 v2.13.1 h1:x+LHXBI2nMB1vqndymf26quycC4aggYJ7DECYbiz03g= +github.com/go-resty/resty/v2 v2.13.1/go.mod h1:GznXlLxkq6Nh4sU59rPmUw3VtgpO3aS96ORAI6Q7d+0= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/gocraft/dbr/v2 v2.7.6 h1:ASHKFgCbTLODbb9f756Cl8VAlnvQLKqIzx9E1Cfb7eo= -github.com/gocraft/dbr/v2 v2.7.6/go.mod h1:8IH98S8M8J0JSEiYk0MPH26ZDUKemiQ/GvmXL5jo+Uw= +github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= +github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gojektech/heimdall/v6 v6.1.0 h1:M9L1xryMKGWUlAA33D0r0BaKiXWzvuReltDPPkC5loM= github.com/gojektech/heimdall/v6 v6.1.0/go.mod h1:8g/ohsh0GXn8fzOf+qVrjX5pQLf7qQy8vEBjBUJ/9L4= @@ -205,26 +176,21 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= +github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= -github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= +github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= -github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205AhTIGQQ= -github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libsv/go-bc v0.1.28 h1:LubB5VmRGF3EfkOVbb8Gmoq9Ku7XvtkwIkSW55sfnlo= @@ -235,15 +201,14 @@ github.com/libsv/go-bt v1.0.8 h1:nWLLcnUm0dxNO3exqrL5jvAcTGkl0dsnBuQqB6+M6vQ= github.com/libsv/go-bt v1.0.8/go.mod h1:yO023bNYLh5DwcOYl+ZqLAeTemoy6K+2UbQlIBMv+EQ= github.com/libsv/go-bt/v2 v2.2.5 h1:VoggBLMRW9NYoFujqe5bSYKqnw5y+fYfufgERSoubog= github.com/libsv/go-bt/v2 v2.2.5/go.mod h1:cV45+jDlPOLfhJLfpLmpQoWzrIvVth9Ao2ZO1f6CcqU= -github.com/libsv/go-p2p v0.1.9 h1:cMo8FS66oMOS47lmh8yPVNm0nGIz2Zlxi/zncPD0/o8= -github.com/libsv/go-p2p v0.1.9/go.mod h1:9KhX8e+3oEmGiYQSeF/CrHj22YNHqiof3TH77VqcMCs= +github.com/libsv/go-p2p v0.2.3 h1:vbBm4b2uu08pK+BuUm6Umdd8Zc3ADp5yX0UNNCXjkeo= +github.com/libsv/go-p2p v0.2.3/go.mod h1:TENFxbTT/bfSfuiirjU6l+PfAWxwZgF8GYUxs5tzc/M= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= @@ -251,10 +216,8 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mattn/goveralls v0.0.6/go.mod h1:h8b4ow6FxSPMQHF6o2ve3qsclnffZjYTNEKmLesRwqw= -github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4= -github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY= -github.com/mitchellh/hashstructure v1.1.0 h1:P6P1hdjqAAknpY/M1CGipelZgp+4y9ja9kmUZPXP+H0= -github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/6d8ulp4AwfLKrmA= +github.com/miekg/dns v1.1.59 h1:C9EXc/UToRwKLhK5wKU/I4QVsBUc8kE6MkHBkeypWZs= +github.com/miekg/dns v1.1.59/go.mod h1:nZpewl5p6IvctfgrckopVx2OlSEHPRO/U4SYkRklrEk= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -267,18 +230,16 @@ github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8 github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/mrz1836/go-cache v0.9.7 h1:v9QhZqwkDCkKxbA4HuuKoP6cvf9PFTE2Q7dOpxxuDcE= github.com/mrz1836/go-cache v0.9.7/go.mod h1:j3Jm/6bUEb9ilzYmKXu6nGy6D488e0vP7//dnqyQUpc= -github.com/mrz1836/go-cachestore v0.3.9 h1:SBdj+rVaK2vhqAiVLpTm9EH4uEpda2GZK6l8/dF+A/Y= -github.com/mrz1836/go-cachestore v0.3.9/go.mod h1:nKqw7vOaWmqdy/AThhRYZC+TRXqncoEeiaKocZxmH7A= +github.com/mrz1836/go-cachestore v0.3.10 h1:h9M4w9Vmzu7iKZJ+gmcGVwtKxZTYM9UZkd+am5q78nc= +github.com/mrz1836/go-cachestore v0.3.10/go.mod h1:c54HUBBvmrB9pq/xDhiiktDbuwA6i+Q3H6ov091IbHM= github.com/mrz1836/go-logger v0.3.3 h1:L/u+So5yrsYi7KhkFWlZ8v28cmoHt6aB7X8uVEIEHu8= github.com/mrz1836/go-logger v0.3.3/go.mod h1:hlP6K2fnTcisDbcYw9u3eV+1TW5jCsYUfoujA4+38NY= -github.com/mrz1836/go-sanitize v1.3.1 h1:bTxpzDXzGh9cp3XLTeVKgL2iLqEwCaLqqe+3BmpnCbo= -github.com/mrz1836/go-sanitize v1.3.1/go.mod h1:Js6Gq1uiarNReoOeOKxPXxNpKy1FRlbgDDZnJG4THdM= +github.com/mrz1836/go-sanitize v1.3.2 h1:sGhusPxP4L+7NAUVAUl/WrrBazNSNECsvYh3yumuJXQ= +github.com/mrz1836/go-sanitize v1.3.2/go.mod h1:wvRS2ALFDxOCK3ORQPwKUxl7HTIBUV8S3U34Hwn96r4= github.com/mrz1836/go-validate v0.2.1 h1:LvhFvnZgemmJnZ/Ch9vEgY9YzKy+1Ka1Hx7yzpJEB00= github.com/mrz1836/go-validate v0.2.1/go.mod h1:IoGAb4rTAL6KgAxOiWL4ICwLqxGbKCKT1GyaSuE/4bk= -github.com/newrelic/go-agent/v3 v3.32.0 h1:99Et9lXXzeQV1CfYldfeTXv+d9W9KatpMbb50kIscWo= -github.com/newrelic/go-agent/v3 v3.32.0/go.mod h1:SMdqPzE/ghkWdY0rYGSD7Clw2daK/XH6pUnVd4albg4= -github.com/newrelic/go-agent/v3/integrations/nrmongo v1.1.3 h1:Z85RJZKk+hghOQYJzsKUo3s4vP9W7/HUlB+CuLelqnc= -github.com/newrelic/go-agent/v3/integrations/nrmongo v1.1.3/go.mod h1:BzSK3ljUwW9PaTPdKstpKwQszKPnrU3xUaqidleearI= +github.com/newrelic/go-agent/v3 v3.33.0 h1:0Phrvp6KWOcJPsIxskL9ZrVddhrZDl1xokNtTjN4GpQ= +github.com/newrelic/go-agent/v3 v3.33.0/go.mod h1:SMdqPzE/ghkWdY0rYGSD7Clw2daK/XH6pUnVd4albg4= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -292,37 +253,33 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.27.5 h1:T/X6I0RNFw/kTqgfkZPcQ5KU6vCnWNBGdtrIx2dpGeQ= github.com/onsi/gomega v1.27.5/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= -github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= -github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= +github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= +github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= +github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= github.com/rafaeljusto/redigomock v2.4.0+incompatible h1:d7uo5MVINMxnRr20MxbgDkmZ8QRfevjOVgEa4n0OZyY= github.com/rafaeljusto/redigomock v2.4.0+incompatible/go.mod h1:JaY6n2sDr+z2WTsXkOmNRUfDy6FN0L6Nk7x06ndm4tY= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= -github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= -github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= @@ -331,14 +288,10 @@ github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= -github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= -github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= -github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= -github.com/sosodev/duration v1.2.0 h1:pqK/FLSjsAADWY74SyWDCjOcd5l7H8GSnnOGEB9A1Us= -github.com/sosodev/duration v1.2.0/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg= +github.com/sosodev/duration v1.3.1 h1:qtHBDMQ6lvMQsL15g4aopM4HEfOaYuhWBw3NPTtlqq4= +github.com/sosodev/duration v1.3.1/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= @@ -374,29 +327,17 @@ github.com/swaggo/gin-swagger v1.6.0 h1:y8sxvQ3E20/RCyrXeFfg60r6H0Z+SwpTjMYsMm+z github.com/swaggo/gin-swagger v1.6.0/go.mod h1:BG00cCEy294xtVpyIAHG6+e2Qzj/xKlRdOqDkvq0uzo= github.com/swaggo/swag v1.16.3 h1:PnCYjPCah8FK4I26l2F/KQ4yz3sILcVUN3cTlBFA9Pg= github.com/swaggo/swag v1.16.3/go.mod h1:DImHIuOFXKpMFAQjcC7FG4m3Dg4+QuUgUzJmKjI/gRk= -github.com/tetratelabs/wazero v1.5.0 h1:Yz3fZHivfDiZFUXnWMPUoiW7s8tC1sjdBtlJn08qYa0= -github.com/tetratelabs/wazero v1.5.0/go.mod h1:0U0G41+ochRKoPKCJlh0jMg1CHkyfK8kDqiirMmKY8A= -github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM= -github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= -github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= -github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= -github.com/tonicpow/go-minercraft/v2 v2.0.8 h1:gDjHOpmD0P5qRLpgRLUHDcDR39DdT5c/XhmOKPDfNjY= -github.com/tonicpow/go-minercraft/v2 v2.0.8/go.mod h1:mfr1fgOpnu2GkTmPDT4Sanoh4wOfV6kcwOrjVdo8vPk= -github.com/tryvium-travels/memongo v0.11.0 h1:VpFkeigK7bge9aXH+oVG+H3OI2ih12riTROk0CvERrk= -github.com/tryvium-travels/memongo v0.11.0/go.mod h1:riRUHKRQ5JbeX2ryzFfmr7P2EYXIkNwgloSQJPpBikA= +github.com/tonicpow/go-minercraft/v2 v2.1.0 h1:F9jDhZ+0o6xNiCbT0FzGRTdky6ZgZIi5EKqXJULTToI= +github.com/tonicpow/go-minercraft/v2 v2.1.0/go.mod h1:tyjPBBc3xejO5uNtxmiS3fz/7Oairj1jbBaeqhWjeeE= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= -github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/vektah/gqlparser/v2 v2.5.11 h1:JJxLtXIoN7+3x6MBdtIP59TP1RANnY7pXOaDnADQSf8= -github.com/vektah/gqlparser/v2 v2.5.11/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc= +github.com/vektah/gqlparser/v2 v2.5.12 h1:COMhVVnql6RoaF7+aTBWiTADdpLGyZWU3K/NwW0ph98= +github.com/vektah/gqlparser/v2 v2.5.12/go.mod h1:WQQjFc+I1YIzoPvZBhUQX7waZgg3pMLi0r8KymvAE2w= github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= @@ -414,8 +355,8 @@ github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gi github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= -github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4= +github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76 h1:tBiBTKHnIjovYoLX/TPkcf+OjqqKGQrPtGT3Foz+Pgo= +github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76/go.mod h1:SQliXeA7Dhkt//vS29v3zpbEwoa+zb2Cn5xj5uO4K5U= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -425,36 +366,30 @@ go.elastic.co/ecszerolog v0.2.0 h1:nbX4dQ08jb3+vsvACfmzAqGDoBh8F2HQDUgpqwAVTg0= go.elastic.co/ecszerolog v0.2.0/go.mod h1:wR5Mv0BVQJ17LopUX5Fd0LLKCC9iF++58iKY+lL09lc= go.mongodb.org/mongo-driver v1.11.7 h1:LIwYxASDLGUg/8wOhgOOZhX8tQa/9tgZPgzZoVqJvcs= go.mongodb.org/mongo-driver v1.11.7/go.mod h1:G9TgswdsWjX4tmDA5zfs2+6AEPpYJwqblyjsfuh8oXY= -go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= -go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= -go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= -go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.7.0 h1:pskyeJh/3AmoQ8CPE95vxHLqp1G1GfGNXTmcl9NEKTc= -golang.org/x/arch v0.7.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= +golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= -golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 h1:6R2FC06FonbXQ8pK11/PDFY6N6LWlf9KlzibaCapmqc= -golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= -golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -468,9 +403,9 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -478,8 +413,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -493,8 +428,6 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -503,14 +436,16 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -518,10 +453,9 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -532,16 +466,16 @@ golang.org/x/tools v0.0.0-20200530233709-52effbd89c51/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= -golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= +golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= +golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa h1:RBgMaUMP+6soRkik4VoN8ojR2nex2TqZwjSSogic+eo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e h1:Elxv5MwEkCI9f5SkoL6afed6NTdxaGoAo39eANBwHL8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -550,19 +484,15 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/src-d/go-errors.v1 v1.0.0 h1:cooGdZnCjYbeS1zb1s6pVAAimTdKceRrpn7aKOnNIfc= -gopkg.in/src-d/go-errors.v1 v1.0.0/go.mod h1:q1cBlomlw2FnDBDNGlnh6X0jPihy+QxZfMMNxPCbdYg= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -570,7 +500,6 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/mysql v1.4.3/go.mod h1:sSIebwZAVPiT+27jK9HIwvsqOGKx3YMPmrA3mBJR10c= @@ -582,10 +511,9 @@ gorm.io/driver/sqlite v1.5.5 h1:7MDMtUZhV065SilG62E0MquljeArQZNfJnjd9i9gx3E= gorm.io/driver/sqlite v1.5.5/go.mod h1:6NgQ7sQWAIFsPrJJl1lSNSu2TABh0ZZ/zm5fosATavE= gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.25.2/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= -gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= -gorm.io/gorm v1.25.9 h1:wct0gxZIELDk8+ZqF/MVnHLkA1rvYlBWUMv2EdsK1g8= -gorm.io/gorm v1.25.9/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= -gorm.io/plugin/dbresolver v1.5.0 h1:XVHLxh775eP0CqVh3vcfJtYqja3uFl5Wr3cKlY8jgDY= -gorm.io/plugin/dbresolver v1.5.0/go.mod h1:l4Cn87EHLEYuqUncpEeTC2tTJQkjngPSD+lo8hIvcT0= +gorm.io/gorm v1.25.10 h1:dQpO+33KalOA+aFYGlK+EfxcI5MbO7EP2yYygwh9h+s= +gorm.io/gorm v1.25.10/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= +gorm.io/plugin/dbresolver v1.5.1 h1:s9Dj9f7r+1rE3nx/Ywzc85nXptUEaeOO0pt27xdopM8= +gorm.io/plugin/dbresolver v1.5.1/go.mod h1:l4Cn87EHLEYuqUncpEeTC2tTJQkjngPSD+lo8hIvcT0= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/start.sh b/start.sh index 3bb6e5b3..17dad73c 100755 --- a/start.sh +++ b/start.sh @@ -284,7 +284,7 @@ while [[ $# -gt 0 ]]; do echo -e "" echo -e "<---------- SPV WALLET SECTION" echo -e " -sw, --spv-wallet\t\t Whether the spv-wallet should be run - true/false" - echo -e " -db, --database\t\t Define database - postgresql, mongodb, sqlite" + echo -e " -db, --database\t\t Define database - postgresql, sqlite" echo -e " -c, --cache\t\t\t Define cache storage - freecache(in-memory), redis" echo -e " --xpub\t\t\t Define admin xPub" echo "" @@ -347,13 +347,12 @@ fi # <---------- SPV WALLET SECTION if [ "$database" == "" ]; then - database_options=("postgresql" "mongodb" "sqlite") + database_options=("postgresql" "sqlite") ask_for_choice "Select your database:" "${database_options[@]}" case $choice in 1) database="postgresql";; - 2) database="mongodb";; - 3) database="sqlite";; + 2) database="sqlite";; esac print_debug "database: $database" fi @@ -515,9 +514,6 @@ case $database in save_value 'SPVWALLET_DB_SQL_USER' "postgres" save_value 'SPVWALLET_DB_SQL_PASSWORD' "postgres" ;; - mongodb) - save_value 'SPVWALLET_DB_MONGODB_URI' "mongodb://mongo:mongo@wallet-mongodb:27017/" - ;; esac if [ "$cache" == "redis" ]; then @@ -561,10 +557,6 @@ case $database in servicesToRun+=("wallet-postgresql") servicesToHideLogs+=("wallet-postgresql") ;; - mongodb) - servicesToRun+=("wallet-mongodb") - servicesToHideLogs+=("wallet-mongodb") - ;; esac if [ "$cache" == "redis" ]; then