From 081c9ff8b5db09e806aab7ebc40d3f495f894aa1 Mon Sep 17 00:00:00 2001 From: Aryan Mehrotra <44036979+aryanmehrotra@users.noreply.github.com> Date: Mon, 24 Jun 2024 12:04:09 +0530 Subject: [PATCH 01/17] Update workflow for deploying website (#746) --- .github/workflows/changes.sh | 37 ------------------- .../{website.yml => website_prod.yml} | 8 ++-- docs/quick-start/observability/page.md | 2 +- 3 files changed, 6 insertions(+), 41 deletions(-) delete mode 100755 .github/workflows/changes.sh rename .github/workflows/{website.yml => website_prod.yml} (95%) diff --git a/.github/workflows/changes.sh b/.github/workflows/changes.sh deleted file mode 100755 index 17f31c22c..000000000 --- a/.github/workflows/changes.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -filename="$1" - -# Create or clear the coveragetable.md file -touch build/coveragetable.md - -# Append total coverage information to coveragetable.md -echo -n "### Total coverage : " >> build/coveragetable.md -# Filter and assign files to trimmed_content based on conditions: -# - Files ending with ".go" are considered. -# - Files with status "A" or "M" are included. -# - Files with status "RXXX" are included, except for "R100". -go tool cover -func build/coverage.out | grep 'total' | awk '{print $3}' >> build/coveragetable.md - -# Extract changed file paths from the provided file -trimmed_content=$(grep -E '\.go$' "$filename" | awk '{ if ($1 ~ /^R/ && $1 !~ /^R100/) print $3; else if ($1 ~ /^[AM]/) print $2 }') - -if [[ -z "$trimmed_content" ]]; then - echo "### No Files Are Changed." >> build/coveragetable.md -else - echo "List of changed files" >> build/coveragetable.md - echo -e "\n" >> build/coveragetable.md - echo "| Path | Function | Coverage |" >> build/coveragetable.md - echo "|------|----------|----------|" >> build/coveragetable.md - - while IFS= read -r line; do - echo "$line" - if [[ $line == *.go ]]; then - # Extract coverage information for each changed file and append to coveragetable.md - go tool cover -func=build/coverage.out | grep "$line" | awk 'BEGIN{OFS=" | "} {print "|" $1, $2, $3 "|"}' >> build/coveragetable.md - fi - done <<< "$trimmed_content" -fi - -# Append the content of coveragetable.md to the GITHUB_STEP_SUMMARY file -cat build/coveragetable.md >> "$GITHUB_STEP_SUMMARY" diff --git a/.github/workflows/website.yml b/.github/workflows/website_prod.yml similarity index 95% rename from .github/workflows/website.yml rename to .github/workflows/website_prod.yml index 7c76c716a..df2104767 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website_prod.yml @@ -2,7 +2,10 @@ name: Build and Deploy on: push: tags: - - "v[0-9]+.[0-9]+.[0-9]" + - "v*.*.*" + branches: + - main + - development env: APP_NAME: gofr-website @@ -15,7 +18,6 @@ env: jobs: build: runs-on: ubuntu-latest - if: (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/main' || github.event_name == 'pull_request' ) outputs: image: ${{ steps.output-image.outputs.image }} name: 🔧Build @@ -50,7 +52,6 @@ jobs: dockerize: runs-on: ubuntu-latest - if: ${{ startsWith(github.ref, 'refs/tags/v')}} outputs: image: ${{ steps.output-image.outputs.image }} name: 🐳 Dockerize @@ -94,6 +95,7 @@ jobs: deployment: runs-on: ubuntu-latest name: 🚀 Deploy + if: ${{ startsWith(github.ref, 'refs/tags/v')}} needs: dockerize container: image: ghcr.io/zopsmart/gha-images:deployments-0.1.3 diff --git a/docs/quick-start/observability/page.md b/docs/quick-start/observability/page.md index b0f01bd62..912f922c2 100644 --- a/docs/quick-start/observability/page.md +++ b/docs/quick-start/observability/page.md @@ -225,7 +225,7 @@ TRACER_PORT=14317 ``` Open {% new-tab-link title="zipkin" href="http://localhost:16686/trace/" /%} and search by TraceID (correlationID) to see the trace. -{% figure src="/jaeger-tracing.png" alt="Jaeger traces" /%} +{% figure src="/jaeger-traces.png" alt="Jaeger traces" /%} #### 3. [GoFr Tracer](https://tracer.gofr.dev/) From e1da52e1f0c0cff9bff82801667431cfe7a61903 Mon Sep 17 00:00:00 2001 From: Aryan Mehrotra <44036979+aryanmehrotra@users.noreply.github.com> Date: Mon, 24 Jun 2024 12:18:14 +0530 Subject: [PATCH 02/17] Refactor deploy and dockerize only on tag release (#747) --- .github/workflows/website_prod.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/website_prod.yml b/.github/workflows/website_prod.yml index df2104767..a0850d865 100644 --- a/.github/workflows/website_prod.yml +++ b/.github/workflows/website_prod.yml @@ -18,8 +18,6 @@ env: jobs: build: runs-on: ubuntu-latest - outputs: - image: ${{ steps.output-image.outputs.image }} name: 🔧Build steps: - name: Checkout Code @@ -39,18 +37,15 @@ jobs: run: | docker pull ${{ env.WEBSITE_REGISTRY }}/gofr-dev/website:latest - - name: Build and Push Image Stage + - name: Build Image uses: docker/build-push-action@v4 with: push: false context: ./ file: ./docs/Dockerfile - tags: us-central1-docker.pkg.dev/${{ env.GAR_PROJECT }}/${{ env.GAR_REGISTRY }}/${{ env.APP_NAME }}:${{ github.sha }} - - - id: output-image - run: echo "image=`echo us-central1-docker.pkg.dev/${{ env.GAR_PROJECT }}/${{ env.GAR_REGISTRY }}/${{ env.APP_NAME }}:${{ github.sha }}`" >> "$GITHUB_OUTPUT" dockerize: + if: ${{ startsWith(github.ref, 'refs/tags/v')}} runs-on: ubuntu-latest outputs: image: ${{ steps.output-image.outputs.image }} @@ -95,7 +90,6 @@ jobs: deployment: runs-on: ubuntu-latest name: 🚀 Deploy - if: ${{ startsWith(github.ref, 'refs/tags/v')}} needs: dockerize container: image: ghcr.io/zopsmart/gha-images:deployments-0.1.3 From 9b47b947816b38b81b1ac1942dd78d1c9c871de9 Mon Sep 17 00:00:00 2001 From: Aryan Mehrotra <44036979+aryanmehrotra@users.noreply.github.com> Date: Mon, 24 Jun 2024 17:59:01 +0530 Subject: [PATCH 03/17] Refactor Migrations Implementation (#744) --- .github/workflows/go.yml | 47 +--- pkg/gofr/migration/datasource.go | 47 +--- pkg/gofr/migration/datasource_test.go | 29 ++ pkg/gofr/migration/interface.go | 42 +++ pkg/gofr/migration/migration.go | 39 ++- pkg/gofr/migration/migration_test.go | 21 -- pkg/gofr/migration/mock_datasource.go | 145 ---------- pkg/gofr/migration/mock_interface.go | 368 ++++++++++++++++++++++++++ pkg/gofr/migration/mock_redis.go | 103 ------- pkg/gofr/migration/pubsub.go | 24 -- pkg/gofr/migration/pubsub_test.go | 74 ------ pkg/gofr/migration/redis.go | 81 ++---- pkg/gofr/migration/redis_test.go | 39 ++- pkg/gofr/migration/sql.go | 86 ++---- pkg/gofr/migration/sql_test.go | 67 ++--- 15 files changed, 571 insertions(+), 641 deletions(-) create mode 100644 pkg/gofr/migration/datasource_test.go create mode 100644 pkg/gofr/migration/interface.go delete mode 100644 pkg/gofr/migration/mock_datasource.go create mode 100644 pkg/gofr/migration/mock_interface.go delete mode 100644 pkg/gofr/migration/mock_redis.go delete mode 100644 pkg/gofr/migration/pubsub.go delete mode 100644 pkg/gofr/migration/pubsub_test.go diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6fc300f50..58d6e8d95 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,43 +15,6 @@ on: - 'docs/**' jobs: - MIGRATION-Unit-Testing: - name: Migration Unit Testing (v${{ matrix.go-version }})🛠 - runs-on: ubuntu-latest - strategy: - matrix: - go-version: ['1.21', '1.20'] - - steps: - - name: Checkout code into go module directory - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v4 - with: - go-version: ${{ matrix.go-version }} - id: Go - - - name: Get dependencies - run: | - go mod download - - - name: Test - run: | - export APP_ENV=test - go test gofr.dev/pkg/gofr/migration... -v -short -coverprofile profile.cov -coverpkg=gofr.dev/pkg/gofr/migration... - - go tool cover -func profile.cov - - - name: Upload Test Coverage - if: ${{ matrix.go-version == '1.21'}} - uses: actions/upload-artifact@v3 - with: - name: MIGRATION-Coverage-Report - path: profile.cov - Example-Unit-Testing: name: Example Unit Testing (v${{ matrix.go-version }})🛠 runs-on: ubuntu-latest @@ -150,9 +113,8 @@ jobs: - name: Test run: | export APP_ENV=test - go test gofr.dev/pkg/... -tags migration -v -short -coverprofile packageWithMigration.cov -coverpkg=gofr.dev/pkg/... - grep -v 'gofr.dev/pkg/gofr/migration' packageWithMigration.cov > packageWithoutMigration.cov - grep -v 'gofr.dev/pkg/gofr/migration/mock_datasources.go' packageWithoutMigration.cov > packageWithoutMockMigrationDatasource.cov + go test gofr.dev/pkg/... -tags migration -v -short -coverprofile package.cov -coverpkg=gofr.dev/pkg/... + grep -v 'gofr.dev/pkg/gofr/migration/mock_datasources.go' package.cov > packageWithoutMockMigrationDatasource.cov grep -v 'gofr.dev/pkg/gofr/container/mock_datasources.go' packageWithoutMockMigrationDatasource.cov > packageWithoutMockDatasource.cov grep -v 'google/mock_interfaces\.go' packageWithoutMockDatasource.cov > profile.cov go tool cover -func profile.cov @@ -167,7 +129,7 @@ jobs: parse_coverage: name: Code Coverage runs-on: ubuntu-latest - needs: [ Example-Unit-Testing,PKG-Unit-Testing,MIGRATION-Unit-Testing ] + needs: [ Example-Unit-Testing,PKG-Unit-Testing] steps: - name: Check out code into the Go module directory uses: actions/checkout@v4 @@ -183,7 +145,6 @@ jobs: run: | awk '!/^mode: / && FNR==1{print "mode: set"} {print}' ./Example-Test-Report/profile.cov > merged_profile.cov tail -n +2 ./PKG-Coverage-Report/profile.cov >> merged_profile.cov - tail -n +2 ./MIGRATION-Coverage-Report/profile.cov >> merged_profile.cov - name: Parse code-coverage value working-directory: artifacts @@ -201,7 +162,7 @@ jobs: upload_coverage: name: Upload Coverage📊 runs-on: ubuntu-latest - needs: [Example-Unit-Testing,PKG-Unit-Testing,MIGRATION-Unit-Testing] + needs: [Example-Unit-Testing,PKG-Unit-Testing] if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development'}} steps: - name: Check out code into the Go module directory diff --git a/pkg/gofr/migration/datasource.go b/pkg/gofr/migration/datasource.go index 0cde1d65c..de160279e 100644 --- a/pkg/gofr/migration/datasource.go +++ b/pkg/gofr/migration/datasource.go @@ -1,35 +1,18 @@ package migration -import ( - "time" - - goRedis "github.com/redis/go-redis/v9" - - "gofr.dev/pkg/gofr/container" - gofrSql "gofr.dev/pkg/gofr/datasource/sql" -) +import "gofr.dev/pkg/gofr/container" type Datasource struct { + // TODO Logger should not be embedded rather it should be a field. + // Need to think it through as it will bring breaking changes. Logger - SQL db - Redis commands - PubSub client -} - -type Migrator interface { - checkAndCreateMigrationTable(c *container.Container) error - getLastMigration(c *container.Container) int64 - - beginTransaction(c *container.Container) migrationData - - commitMigration(c *container.Container, data migrationData) error - rollback(c *container.Container, data migrationData) + SQL SQL + Redis Redis + PubSub PubSub } -type Options interface { - apply(m Migrator) Migrator -} +// It is a base implementation for migration manger, on this other database drivers have been wrapped. func (d Datasource) checkAndCreateMigrationTable(*container.Container) error { return nil @@ -39,22 +22,14 @@ func (d Datasource) getLastMigration(*container.Container) int64 { return 0 } -func (d Datasource) beginTransaction(*container.Container) migrationData { - return migrationData{} +func (d Datasource) beginTransaction(*container.Container) transactionData { + return transactionData{} } -func (d Datasource) commitMigration(c *container.Container, data migrationData) error { +func (d Datasource) commitMigration(c *container.Container, data transactionData) error { c.Infof("Migration %v ran successfully", data.MigrationNumber) return nil } -func (d Datasource) rollback(*container.Container, migrationData) {} - -type migrationData struct { - StartTime time.Time - MigrationNumber int64 - - SQLTx *gofrSql.Tx - RedisTx goRedis.Pipeliner -} +func (d Datasource) rollback(*container.Container, transactionData) {} diff --git a/pkg/gofr/migration/datasource_test.go b/pkg/gofr/migration/datasource_test.go new file mode 100644 index 000000000..af58d3812 --- /dev/null +++ b/pkg/gofr/migration/datasource_test.go @@ -0,0 +1,29 @@ +package migration + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "gofr.dev/pkg/gofr/container" + "gofr.dev/pkg/gofr/testutil" +) + +func Test_getMigratorDatastoreNotInitialised(t *testing.T) { + logs := testutil.StdoutOutputForFunc(func() { + mockContainer, _ := container.NewMockContainer(t) + mockContainer.SQL = nil + mockContainer.Redis = nil + + mg := Datasource{} + + mg.rollback(mockContainer, transactionData{}) + + assert.Equal(t, int64(0), mg.getLastMigration(mockContainer), "TEST Failed \n Last Migration is not 0") + assert.Nil(t, mg.checkAndCreateMigrationTable(mockContainer), "TEST Failed") + assert.Equal(t, transactionData{}, mg.beginTransaction(mockContainer), "TEST Failed") + assert.Nil(t, mg.commitMigration(mockContainer, transactionData{}), "TEST Failed") + }) + + assert.Contains(t, logs, "Migration 0 ran successfully", "TEST Failed") +} diff --git a/pkg/gofr/migration/interface.go b/pkg/gofr/migration/interface.go new file mode 100644 index 000000000..26e0b5231 --- /dev/null +++ b/pkg/gofr/migration/interface.go @@ -0,0 +1,42 @@ +package migration + +import ( + "context" + "database/sql" + "time" + + goRedis "github.com/redis/go-redis/v9" + "gofr.dev/pkg/gofr/container" +) + +type Redis interface { + Get(ctx context.Context, key string) *goRedis.StringCmd + Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *goRedis.StatusCmd + Del(ctx context.Context, keys ...string) *goRedis.IntCmd + Rename(ctx context.Context, key, newKey string) *goRedis.StatusCmd +} + +type SQL interface { + Query(query string, args ...interface{}) (*sql.Rows, error) + QueryRow(query string, args ...interface{}) *sql.Row + QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row + Exec(query string, args ...interface{}) (sql.Result, error) + ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) +} + +type PubSub interface { + CreateTopic(context context.Context, name string) error + DeleteTopic(context context.Context, name string) error +} + +// keeping the migrator interface unexported as, right now it is not being implemented directly, by the externalDB drivers. +// keeping the implementations for externalDB at one place such that if any change in migration logic, we would change directly here. +type migrator interface { + checkAndCreateMigrationTable(c *container.Container) error + getLastMigration(c *container.Container) int64 + + beginTransaction(c *container.Container) transactionData + + commitMigration(c *container.Container, data transactionData) error + rollback(c *container.Container, data transactionData) +} diff --git a/pkg/gofr/migration/migration.go b/pkg/gofr/migration/migration.go index bcac7c5d1..20bdd62d3 100644 --- a/pkg/gofr/migration/migration.go +++ b/pkg/gofr/migration/migration.go @@ -5,8 +5,10 @@ import ( "time" "github.com/gogo/protobuf/sortkeys" + goRedis "github.com/redis/go-redis/v9" "gofr.dev/pkg/gofr/container" + gofrSql "gofr.dev/pkg/gofr/datasource/sql" ) type MigrateFunc func(d Datasource) error @@ -15,6 +17,14 @@ type Migrate struct { UP MigrateFunc } +type transactionData struct { + StartTime time.Time + MigrationNumber int64 + + SQLTx *gofrSql.Tx + RedisTx goRedis.Pipeliner +} + func Run(migrationsMap map[int64]Migrate, c *container.Container) { invalidKeys, keys := getKeys(migrationsMap) if len(invalidKeys) > 0 { @@ -53,27 +63,27 @@ func Run(migrationsMap map[int64]Migrate, c *container.Container) { c.Logger.Debugf("running migration %v", currentMigration) - transactionsObjects := mg.beginTransaction(c) + migrationInfo := mg.beginTransaction(c) - ds.SQL = newMysql(transactionsObjects.SQLTx) - ds.Redis = newRedis(transactionsObjects.RedisTx) - ds.PubSub = newPubSub(c.PubSub) + // Replacing the objects in datasource object only for those Datasources which support transactions. + ds.SQL = migrationInfo.SQLTx + ds.Redis = migrationInfo.RedisTx - transactionsObjects.StartTime = time.Now() - transactionsObjects.MigrationNumber = currentMigration + migrationInfo.StartTime = time.Now() + migrationInfo.MigrationNumber = currentMigration err = migrationsMap[currentMigration].UP(ds) if err != nil { - mg.rollback(c, transactionsObjects) + mg.rollback(c, migrationInfo) return } - err = mg.commitMigration(c, transactionsObjects) + err = mg.commitMigration(c, migrationInfo) if err != nil { c.Errorf("failed to commit migration, err: %v", err) - mg.rollback(c, transactionsObjects) + mg.rollback(c, migrationInfo) return } @@ -97,11 +107,11 @@ func getKeys(migrationsMap map[int64]Migrate) (invalidKey, keys []int64) { return invalidKey, keys } -func getMigrator(c *container.Container) (Datasource, Migrator, bool) { +func getMigrator(c *container.Container) (Datasource, migrator, bool) { var ( ok bool ds Datasource - mg Migrator = ds + mg migrator = ds ) if !isNil(c.SQL) { @@ -109,7 +119,8 @@ func getMigrator(c *container.Container) (Datasource, Migrator, bool) { ds.SQL = c.SQL - mg = sqlMigratorObject{ds.SQL}.apply(mg) + s := sqlDS{ds.SQL} + mg = s.apply(mg) c.Debug("initialized data source for SQL") } @@ -119,13 +130,15 @@ func getMigrator(c *container.Container) (Datasource, Migrator, bool) { ds.Redis = c.Redis - mg = redisMigratorObject{ds.Redis}.apply(mg) + mg = redisDS{ds.Redis}.apply(mg) c.Debug("initialized data source for redis") } if c.PubSub != nil { ok = true + + ds.PubSub = c.PubSub } return ds, mg, ok diff --git a/pkg/gofr/migration/migration_test.go b/pkg/gofr/migration/migration_test.go index 2131961f6..4cfa636c9 100644 --- a/pkg/gofr/migration/migration_test.go +++ b/pkg/gofr/migration/migration_test.go @@ -51,24 +51,3 @@ func Test_getMigratorDBInitialisation(t *testing.T) { assert.NotNil(t, datasource.Redis, "TEST Failed \nRedis not initialized, but should have been initialized") assert.Equal(t, true, isInitialised, "TEST Failed \nNo datastores are Initialized") } - -func Test_getMigratorDatastoreNotInitialised(t *testing.T) { - logs := testutil.StdoutOutputForFunc(func() { - container, _ := container.NewMockContainer(t) - container.SQL = nil - container.Redis = nil - - datasource, _, isInitialised := getMigrator(container) - - datasource.rollback(container, migrationData{}) - - assert.Equal(t, int64(0), datasource.getLastMigration(container), "TEST Failed \n Last Migration is not 0") - assert.Nil(t, datasource.checkAndCreateMigrationTable(container), "TEST Failed") - assert.Equal(t, migrationData{}, datasource.beginTransaction(container), "TEST Failed") - assert.Nil(t, datasource.commitMigration(container, migrationData{}), "TEST Failed") - - assert.Equal(t, false, isInitialised, "TEST Failed \nDatastores are Initialized") - }) - - assert.Contains(t, logs, "Migration 0 ran successfully", "TEST Failed") -} diff --git a/pkg/gofr/migration/mock_datasource.go b/pkg/gofr/migration/mock_datasource.go deleted file mode 100644 index 46988a8a5..000000000 --- a/pkg/gofr/migration/mock_datasource.go +++ /dev/null @@ -1,145 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: datasource.go -// -// Generated by this command: -// -// mockgen -source=datasource.go -destination=mock_datasource.go -package=migration -// - -// Package migration is a generated GoMock package. -package migration - -import ( - reflect "reflect" - - gomock "go.uber.org/mock/gomock" - container "gofr.dev/pkg/gofr/container" -) - -// MockMigrator is a mock of Migrator interface. -type MockMigrator struct { - ctrl *gomock.Controller - recorder *MockMigratorMockRecorder -} - -// MockMigratorMockRecorder is the mock recorder for MockMigrator. -type MockMigratorMockRecorder struct { - mock *MockMigrator -} - -// NewMockMigrator creates a new mock instance. -func NewMockMigrator(ctrl *gomock.Controller) *MockMigrator { - mock := &MockMigrator{ctrl: ctrl} - mock.recorder = &MockMigratorMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockMigrator) EXPECT() *MockMigratorMockRecorder { - return m.recorder -} - -// beginTransaction mocks base method. -func (m *MockMigrator) beginTransaction(c *container.Container) migrationData { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "beginTransaction", c) - ret0, _ := ret[0].(migrationData) - return ret0 -} - -// beginTransaction indicates an expected call of beginTransaction. -func (mr *MockMigratorMockRecorder) beginTransaction(c any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "beginTransaction", reflect.TypeOf((*MockMigrator)(nil).beginTransaction), c) -} - -// checkAndCreateMigrationTable mocks base method. -func (m *MockMigrator) checkAndCreateMigrationTable(c *container.Container) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "checkAndCreateMigrationTable", c) - ret0, _ := ret[0].(error) - return ret0 -} - -// checkAndCreateMigrationTable indicates an expected call of checkAndCreateMigrationTable. -func (mr *MockMigratorMockRecorder) checkAndCreateMigrationTable(c any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "checkAndCreateMigrationTable", reflect.TypeOf((*MockMigrator)(nil).checkAndCreateMigrationTable), c) -} - -// commitMigration mocks base method. -func (m *MockMigrator) commitMigration(c *container.Container, data migrationData) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "commitMigration", c, data) - ret0, _ := ret[0].(error) - return ret0 -} - -// commitMigration indicates an expected call of commitMigration. -func (mr *MockMigratorMockRecorder) commitMigration(c, data any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "commitMigration", reflect.TypeOf((*MockMigrator)(nil).commitMigration), c, data) -} - -// getLastMigration mocks base method. -func (m *MockMigrator) getLastMigration(c *container.Container) int64 { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "getLastMigration", c) - ret0, _ := ret[0].(int64) - return ret0 -} - -// getLastMigration indicates an expected call of getLastMigration. -func (mr *MockMigratorMockRecorder) getLastMigration(c any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getLastMigration", reflect.TypeOf((*MockMigrator)(nil).getLastMigration), c) -} - -// rollback mocks base method. -func (m *MockMigrator) rollback(c *container.Container, data migrationData) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "rollback", c, data) -} - -// rollback indicates an expected call of rollback. -func (mr *MockMigratorMockRecorder) rollback(c, data any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "rollback", reflect.TypeOf((*MockMigrator)(nil).rollback), c, data) -} - -// MockOptions is a mock of Options interface. -type MockOptions struct { - ctrl *gomock.Controller - recorder *MockOptionsMockRecorder -} - -// MockOptionsMockRecorder is the mock recorder for MockOptions. -type MockOptionsMockRecorder struct { - mock *MockOptions -} - -// NewMockOptions creates a new mock instance. -func NewMockOptions(ctrl *gomock.Controller) *MockOptions { - mock := &MockOptions{ctrl: ctrl} - mock.recorder = &MockOptionsMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockOptions) EXPECT() *MockOptionsMockRecorder { - return m.recorder -} - -// apply mocks base method. -func (m_2 *MockOptions) apply(m Migrator) Migrator { - m_2.ctrl.T.Helper() - ret := m_2.ctrl.Call(m_2, "apply", m) - ret0, _ := ret[0].(Migrator) - return ret0 -} - -// apply indicates an expected call of apply. -func (mr *MockOptionsMockRecorder) apply(m any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "apply", reflect.TypeOf((*MockOptions)(nil).apply), m) -} diff --git a/pkg/gofr/migration/mock_interface.go b/pkg/gofr/migration/mock_interface.go new file mode 100644 index 000000000..92af905cc --- /dev/null +++ b/pkg/gofr/migration/mock_interface.go @@ -0,0 +1,368 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: interface.go +// +// Generated by this command: +// +// mockgen -source=interface.go -destination=mock_interface.go -package=migration +// + +// Package migration is a generated GoMock package. +package migration + +import ( + context "context" + sql "database/sql" + reflect "reflect" + time "time" + + redis "github.com/redis/go-redis/v9" + gomock "go.uber.org/mock/gomock" + container "gofr.dev/pkg/gofr/container" +) + +// MockRedis is a mock of Redis interface. +type MockRedis struct { + ctrl *gomock.Controller + recorder *MockRedisMockRecorder +} + +// MockRedisMockRecorder is the mock recorder for MockRedis. +type MockRedisMockRecorder struct { + mock *MockRedis +} + +// NewMockRedis creates a new mock instance. +func NewMockRedis(ctrl *gomock.Controller) *MockRedis { + mock := &MockRedis{ctrl: ctrl} + mock.recorder = &MockRedisMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRedis) EXPECT() *MockRedisMockRecorder { + return m.recorder +} + +// Del mocks base method. +func (m *MockRedis) Del(ctx context.Context, keys ...string) *redis.IntCmd { + m.ctrl.T.Helper() + varargs := []any{ctx} + for _, a := range keys { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Del", varargs...) + ret0, _ := ret[0].(*redis.IntCmd) + return ret0 +} + +// Del indicates an expected call of Del. +func (mr *MockRedisMockRecorder) Del(ctx any, keys ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx}, keys...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Del", reflect.TypeOf((*MockRedis)(nil).Del), varargs...) +} + +// Get mocks base method. +func (m *MockRedis) Get(ctx context.Context, key string) *redis.StringCmd { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Get", ctx, key) + ret0, _ := ret[0].(*redis.StringCmd) + return ret0 +} + +// Get indicates an expected call of Get. +func (mr *MockRedisMockRecorder) Get(ctx, key any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockRedis)(nil).Get), ctx, key) +} + +// Rename mocks base method. +func (m *MockRedis) Rename(ctx context.Context, key, newKey string) *redis.StatusCmd { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Rename", ctx, key, newKey) + ret0, _ := ret[0].(*redis.StatusCmd) + return ret0 +} + +// Rename indicates an expected call of Rename. +func (mr *MockRedisMockRecorder) Rename(ctx, key, newKey any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Rename", reflect.TypeOf((*MockRedis)(nil).Rename), ctx, key, newKey) +} + +// Set mocks base method. +func (m *MockRedis) Set(ctx context.Context, key string, value any, expiration time.Duration) *redis.StatusCmd { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Set", ctx, key, value, expiration) + ret0, _ := ret[0].(*redis.StatusCmd) + return ret0 +} + +// Set indicates an expected call of Set. +func (mr *MockRedisMockRecorder) Set(ctx, key, value, expiration any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*MockRedis)(nil).Set), ctx, key, value, expiration) +} + +// MockSQL is a mock of SQL interface. +type MockSQL struct { + ctrl *gomock.Controller + recorder *MockSQLMockRecorder +} + +// MockSQLMockRecorder is the mock recorder for MockSQL. +type MockSQLMockRecorder struct { + mock *MockSQL +} + +// NewMockSQL creates a new mock instance. +func NewMockSQL(ctrl *gomock.Controller) *MockSQL { + mock := &MockSQL{ctrl: ctrl} + mock.recorder = &MockSQLMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSQL) EXPECT() *MockSQLMockRecorder { + return m.recorder +} + +// Exec mocks base method. +func (m *MockSQL) Exec(query string, args ...any) (sql.Result, error) { + m.ctrl.T.Helper() + varargs := []any{query} + for _, a := range args { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Exec", varargs...) + ret0, _ := ret[0].(sql.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Exec indicates an expected call of Exec. +func (mr *MockSQLMockRecorder) Exec(query any, args ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{query}, args...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockSQL)(nil).Exec), varargs...) +} + +// ExecContext mocks base method. +func (m *MockSQL) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, query} + for _, a := range args { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ExecContext", varargs...) + ret0, _ := ret[0].(sql.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ExecContext indicates an expected call of ExecContext. +func (mr *MockSQLMockRecorder) ExecContext(ctx, query any, args ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, query}, args...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecContext", reflect.TypeOf((*MockSQL)(nil).ExecContext), varargs...) +} + +// Query mocks base method. +func (m *MockSQL) Query(query string, args ...any) (*sql.Rows, error) { + m.ctrl.T.Helper() + varargs := []any{query} + for _, a := range args { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Query", varargs...) + ret0, _ := ret[0].(*sql.Rows) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Query indicates an expected call of Query. +func (mr *MockSQLMockRecorder) Query(query any, args ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{query}, args...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Query", reflect.TypeOf((*MockSQL)(nil).Query), varargs...) +} + +// QueryRow mocks base method. +func (m *MockSQL) QueryRow(query string, args ...any) *sql.Row { + m.ctrl.T.Helper() + varargs := []any{query} + for _, a := range args { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "QueryRow", varargs...) + ret0, _ := ret[0].(*sql.Row) + return ret0 +} + +// QueryRow indicates an expected call of QueryRow. +func (mr *MockSQLMockRecorder) QueryRow(query any, args ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{query}, args...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryRow", reflect.TypeOf((*MockSQL)(nil).QueryRow), varargs...) +} + +// QueryRowContext mocks base method. +func (m *MockSQL) QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row { + m.ctrl.T.Helper() + varargs := []any{ctx, query} + for _, a := range args { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "QueryRowContext", varargs...) + ret0, _ := ret[0].(*sql.Row) + return ret0 +} + +// QueryRowContext indicates an expected call of QueryRowContext. +func (mr *MockSQLMockRecorder) QueryRowContext(ctx, query any, args ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, query}, args...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryRowContext", reflect.TypeOf((*MockSQL)(nil).QueryRowContext), varargs...) +} + +// MockPubSub is a mock of PubSub interface. +type MockPubSub struct { + ctrl *gomock.Controller + recorder *MockPubSubMockRecorder +} + +// MockPubSubMockRecorder is the mock recorder for MockPubSub. +type MockPubSubMockRecorder struct { + mock *MockPubSub +} + +// NewMockPubSub creates a new mock instance. +func NewMockPubSub(ctrl *gomock.Controller) *MockPubSub { + mock := &MockPubSub{ctrl: ctrl} + mock.recorder = &MockPubSubMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPubSub) EXPECT() *MockPubSubMockRecorder { + return m.recorder +} + +// CreateTopic mocks base method. +func (m *MockPubSub) CreateTopic(context context.Context, name string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateTopic", context, name) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateTopic indicates an expected call of CreateTopic. +func (mr *MockPubSubMockRecorder) CreateTopic(context, name any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateTopic", reflect.TypeOf((*MockPubSub)(nil).CreateTopic), context, name) +} + +// DeleteTopic mocks base method. +func (m *MockPubSub) DeleteTopic(context context.Context, name string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteTopic", context, name) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteTopic indicates an expected call of DeleteTopic. +func (mr *MockPubSubMockRecorder) DeleteTopic(context, name any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteTopic", reflect.TypeOf((*MockPubSub)(nil).DeleteTopic), context, name) +} + +// Mockmigrator is a mock of migrator interface. +type Mockmigrator struct { + ctrl *gomock.Controller + recorder *MockmigratorMockRecorder +} + +// MockmigratorMockRecorder is the mock recorder for Mockmigrator. +type MockmigratorMockRecorder struct { + mock *Mockmigrator +} + +// NewMockmigrator creates a new mock instance. +func NewMockmigrator(ctrl *gomock.Controller) *Mockmigrator { + mock := &Mockmigrator{ctrl: ctrl} + mock.recorder = &MockmigratorMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *Mockmigrator) EXPECT() *MockmigratorMockRecorder { + return m.recorder +} + +// beginTransaction mocks base method. +func (m *Mockmigrator) beginTransaction(c *container.Container) transactionData { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "beginTransaction", c) + ret0, _ := ret[0].(transactionData) + return ret0 +} + +// beginTransaction indicates an expected call of beginTransaction. +func (mr *MockmigratorMockRecorder) beginTransaction(c any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "beginTransaction", reflect.TypeOf((*Mockmigrator)(nil).beginTransaction), c) +} + +// checkAndCreateMigrationTable mocks base method. +func (m *Mockmigrator) checkAndCreateMigrationTable(c *container.Container) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "checkAndCreateMigrationTable", c) + ret0, _ := ret[0].(error) + return ret0 +} + +// checkAndCreateMigrationTable indicates an expected call of checkAndCreateMigrationTable. +func (mr *MockmigratorMockRecorder) checkAndCreateMigrationTable(c any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "checkAndCreateMigrationTable", reflect.TypeOf((*Mockmigrator)(nil).checkAndCreateMigrationTable), c) +} + +// commitMigration mocks base method. +func (m *Mockmigrator) commitMigration(c *container.Container, data transactionData) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "commitMigration", c, data) + ret0, _ := ret[0].(error) + return ret0 +} + +// commitMigration indicates an expected call of commitMigration. +func (mr *MockmigratorMockRecorder) commitMigration(c, data any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "commitMigration", reflect.TypeOf((*Mockmigrator)(nil).commitMigration), c, data) +} + +// getLastMigration mocks base method. +func (m *Mockmigrator) getLastMigration(c *container.Container) int64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "getLastMigration", c) + ret0, _ := ret[0].(int64) + return ret0 +} + +// getLastMigration indicates an expected call of getLastMigration. +func (mr *MockmigratorMockRecorder) getLastMigration(c any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getLastMigration", reflect.TypeOf((*Mockmigrator)(nil).getLastMigration), c) +} + +// rollback mocks base method. +func (m *Mockmigrator) rollback(c *container.Container, data transactionData) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "rollback", c, data) +} + +// rollback indicates an expected call of rollback. +func (mr *MockmigratorMockRecorder) rollback(c, data any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "rollback", reflect.TypeOf((*Mockmigrator)(nil).rollback), c, data) +} diff --git a/pkg/gofr/migration/mock_redis.go b/pkg/gofr/migration/mock_redis.go deleted file mode 100644 index 546999811..000000000 --- a/pkg/gofr/migration/mock_redis.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: redis.go -// -// Generated by this command: -// -// mockgen -source=redis.go -destination=mock_redis.go -package=migration -// - -// Package migration is a generated GoMock package. -package migration - -import ( - context "context" - reflect "reflect" - time "time" - - red "github.com/redis/go-redis/v9" - gomock "go.uber.org/mock/gomock" -) - -// Mockcommands is a mock of commands interface. -type Mockcommands struct { - ctrl *gomock.Controller - recorder *MockcommandsMockRecorder -} - -// MockcommandsMockRecorder is the mock recorder for Mockcommands. -type MockcommandsMockRecorder struct { - mock *Mockcommands -} - -// NewMockcommands creates a new mock instance. -func NewMockcommands(ctrl *gomock.Controller) *Mockcommands { - mock := &Mockcommands{ctrl: ctrl} - mock.recorder = &MockcommandsMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *Mockcommands) EXPECT() *MockcommandsMockRecorder { - return m.recorder -} - -// Del mocks base method. -func (m *Mockcommands) Del(ctx context.Context, keys ...string) *red.IntCmd { - m.ctrl.T.Helper() - varargs := []any{ctx} - for _, a := range keys { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "Del", varargs...) - ret0, _ := ret[0].(*red.IntCmd) - return ret0 -} - -// Del indicates an expected call of Del. -func (mr *MockcommandsMockRecorder) Del(ctx any, keys ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{ctx}, keys...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Del", reflect.TypeOf((*Mockcommands)(nil).Del), varargs...) -} - -// Get mocks base method. -func (m *Mockcommands) Get(ctx context.Context, key string) *red.StringCmd { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", ctx, key) - ret0, _ := ret[0].(*red.StringCmd) - return ret0 -} - -// Get indicates an expected call of Get. -func (mr *MockcommandsMockRecorder) Get(ctx, key any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*Mockcommands)(nil).Get), ctx, key) -} - -// Rename mocks base method. -func (m *Mockcommands) Rename(ctx context.Context, key, newKey string) *red.StatusCmd { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Rename", ctx, key, newKey) - ret0, _ := ret[0].(*red.StatusCmd) - return ret0 -} - -// Rename indicates an expected call of Rename. -func (mr *MockcommandsMockRecorder) Rename(ctx, key, newKey any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Rename", reflect.TypeOf((*Mockcommands)(nil).Rename), ctx, key, newKey) -} - -// Set mocks base method. -func (m *Mockcommands) Set(ctx context.Context, key string, value any, expiration time.Duration) *red.StatusCmd { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Set", ctx, key, value, expiration) - ret0, _ := ret[0].(*red.StatusCmd) - return ret0 -} - -// Set indicates an expected call of Set. -func (mr *MockcommandsMockRecorder) Set(ctx, key, value, expiration any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*Mockcommands)(nil).Set), ctx, key, value, expiration) -} diff --git a/pkg/gofr/migration/pubsub.go b/pkg/gofr/migration/pubsub.go deleted file mode 100644 index da6f8a8c5..000000000 --- a/pkg/gofr/migration/pubsub.go +++ /dev/null @@ -1,24 +0,0 @@ -package migration - -import "context" - -type client interface { - CreateTopic(context context.Context, name string) error - DeleteTopic(context context.Context, name string) error -} - -type pubsub struct { - client -} - -func newPubSub(p client) *pubsub { - return &pubsub{client: p} -} - -func (s *pubsub) CreateTopic(ctx context.Context, name string) error { - return s.client.CreateTopic(ctx, name) -} - -func (s *pubsub) DeleteTopic(ctx context.Context, name string) error { - return s.client.DeleteTopic(ctx, name) -} diff --git a/pkg/gofr/migration/pubsub_test.go b/pkg/gofr/migration/pubsub_test.go deleted file mode 100644 index 129f36332..000000000 --- a/pkg/gofr/migration/pubsub_test.go +++ /dev/null @@ -1,74 +0,0 @@ -package migration - -import ( - "context" - "testing" - - "github.com/stretchr/testify/assert" - "gofr.dev/pkg/gofr/testutil" -) - -func TestPubSub_CreateTopic(t *testing.T) { - ps := newPubSub(&mockPubsub{}) - - ctx := context.Background() - topicName := "testTopic" - - err := ps.CreateTopic(ctx, topicName) - - assert.Nil(t, err) -} - -func TestPubSub_DeleteTopic(t *testing.T) { - ps := newPubSub(&mockPubsub{}) - - ctx := context.Background() - topicName := "testTopic" - - err := ps.DeleteTopic(ctx, topicName) - - assert.Nil(t, err) -} - -func TestPubSub_CreateTopicFailed(t *testing.T) { - ps := newPubSub(&mockPubsub{}) - - ctx := context.Background() - topicName := "failure" - - err := ps.CreateTopic(ctx, topicName) - - assert.NotNil(t, err) -} - -func TestPubSub_DeleteTopicFailed(t *testing.T) { - ps := newPubSub(&mockPubsub{}) - - ctx := context.Background() - topicName := "failure" - - err := ps.DeleteTopic(ctx, topicName) - - assert.NotNil(t, err) -} - -type mockPubsub struct { -} - -// CreateTopic mocks the CreateTopic method. -func (m *mockPubsub) CreateTopic(_ context.Context, topic string) error { - if topic == "testTopic" { - return nil - } - - return testutil.CustomError{ErrorMessage: "topic creation failed"} -} - -// DeleteTopic mocks the DeleteTopic method. -func (m *mockPubsub) DeleteTopic(_ context.Context, topic string) error { - if topic == "testTopic" { - return nil - } - - return testutil.CustomError{ErrorMessage: "topic deletion failed"} -} diff --git a/pkg/gofr/migration/redis.go b/pkg/gofr/migration/redis.go index 0985536dc..3e1960242 100644 --- a/pkg/gofr/migration/redis.go +++ b/pkg/gofr/migration/redis.go @@ -6,68 +6,33 @@ import ( "strconv" "time" - goRedis "github.com/redis/go-redis/v9" - "gofr.dev/pkg/gofr/container" ) -type migration struct { - Method string `json:"method"` - StartTime time.Time `json:"startTime"` - Duration int64 `json:"duration"` -} - -type redis struct { - commands +type redisDS struct { + Redis } -func newRedis(c commands) redis { - return redis{ - commands: c, +func (r redisDS) apply(m migrator) migrator { + return redisMigrator{ + Redis: r.Redis, + migrator: m, } } -type commands interface { - Get(ctx context.Context, key string) *goRedis.StringCmd - Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *goRedis.StatusCmd - Del(ctx context.Context, keys ...string) *goRedis.IntCmd - Rename(ctx context.Context, key, newKey string) *goRedis.StatusCmd -} - -func (r redis) Get(ctx context.Context, key string) *goRedis.StringCmd { - return r.commands.Get(ctx, key) -} - -func (r redis) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *goRedis.StatusCmd { - return r.commands.Set(ctx, key, value, expiration) -} - -func (r redis) Del(ctx context.Context, keys ...string) *goRedis.IntCmd { - return r.commands.Del(ctx, keys...) -} - -func (r redis) Rename(ctx context.Context, key, newKey string) *goRedis.StatusCmd { - return r.commands.Rename(ctx, key, newKey) -} - -type redisMigratorObject struct { - commands -} - type redisMigrator struct { - commands + Redis - Migrator + migrator } -func (s redisMigratorObject) apply(m Migrator) Migrator { - return redisMigrator{ - commands: s.commands, - Migrator: m, - } +type redisData struct { + Method string `json:"method"` + StartTime time.Time `json:"startTime"` + Duration int64 `json:"duration"` } -func (d redisMigrator) getLastMigration(c *container.Container) int64 { +func (m redisMigrator) getLastMigration(c *container.Container) int64 { var lastMigration int64 table, err := c.Redis.HGetAll(context.Background(), "gofr_migrations").Result() @@ -77,7 +42,7 @@ func (d redisMigrator) getLastMigration(c *container.Container) int64 { return -1 } - val := make(map[int64]migration) + val := make(map[int64]redisData) for key, value := range table { integerValue, _ := strconv.ParseInt(key, 10, 64) @@ -88,7 +53,7 @@ func (d redisMigrator) getLastMigration(c *container.Container) int64 { d := []byte(value) - var data migration + var data redisData err = json.Unmarshal(d, &data) if err != nil { @@ -102,7 +67,7 @@ func (d redisMigrator) getLastMigration(c *container.Container) int64 { c.Debugf("Redis last migration fetched value is: %v", lastMigration) - last := d.Migrator.getLastMigration(c) + last := m.migrator.getLastMigration(c) if last > lastMigration { return last } @@ -110,10 +75,10 @@ func (d redisMigrator) getLastMigration(c *container.Container) int64 { return lastMigration } -func (d redisMigrator) beginTransaction(c *container.Container) migrationData { +func (m redisMigrator) beginTransaction(c *container.Container) transactionData { redisTx := c.Redis.TxPipeline() - cmt := d.Migrator.beginTransaction(c) + cmt := m.migrator.beginTransaction(c) cmt.RedisTx = redisTx @@ -122,10 +87,10 @@ func (d redisMigrator) beginTransaction(c *container.Container) migrationData { return cmt } -func (d redisMigrator) commitMigration(c *container.Container, data migrationData) error { +func (m redisMigrator) commitMigration(c *container.Container, data transactionData) error { migrationVersion := strconv.FormatInt(data.MigrationNumber, 10) - jsonData, err := json.Marshal(migration{ + jsonData, err := json.Marshal(redisData{ Method: "UP", StartTime: data.StartTime, Duration: time.Since(data.StartTime).Milliseconds(), @@ -150,12 +115,12 @@ func (d redisMigrator) commitMigration(c *container.Container, data migrationDat return err } - return d.Migrator.commitMigration(c, data) + return m.migrator.commitMigration(c, data) } -func (d redisMigrator) rollback(c *container.Container, data migrationData) { +func (m redisMigrator) rollback(c *container.Container, data transactionData) { data.RedisTx.Discard() c.Errorf("Migration %v for Redis failed and rolled back", data.MigrationNumber) - d.Migrator.rollback(c, data) + m.migrator.rollback(c, data) } diff --git a/pkg/gofr/migration/redis_test.go b/pkg/gofr/migration/redis_test.go index 8f0d1b6c1..5a0124f4b 100644 --- a/pkg/gofr/migration/redis_test.go +++ b/pkg/gofr/migration/redis_test.go @@ -12,23 +12,14 @@ import ( "gofr.dev/pkg/gofr/container" ) -func TestNewRedis(t *testing.T) { - mockCmd := &Mockcommands{} - - r := newRedis(mockCmd) - if r.commands != mockCmd { - t.Errorf("Expected newRedis to set commands, but got %v", r.commands) - } -} - func TestRedis_Get(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - mockCmd := NewMockcommands(ctrl) + mockCmd := NewMockRedis(ctrl) mockCmd.EXPECT().Get(context.Background(), "test_key").Return(&goRedis.StringCmd{}) - r := redis{mockCmd} + r := redisDS{mockCmd} _, err := r.Get(context.Background(), "test_key").Result() assert.NoError(t, err, "TEST Failed.\n") @@ -38,10 +29,10 @@ func TestRedis_Set(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - mockCmd := NewMockcommands(ctrl) + mockCmd := NewMockRedis(ctrl) mockCmd.EXPECT().Set(context.Background(), "test_key", "test_value", time.Duration(0)).Return(&goRedis.StatusCmd{}) - r := redis{mockCmd} + r := redisDS{mockCmd} _, err := r.Set(context.Background(), "test_key", "test_value", 0).Result() assert.NoError(t, err, "TEST Failed.\n") @@ -51,10 +42,10 @@ func TestRedis_Del(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - mockCmd := NewMockcommands(ctrl) + mockCmd := NewMockRedis(ctrl) mockCmd.EXPECT().Del(context.Background(), "test_key").Return(&goRedis.IntCmd{}) - r := redis{mockCmd} + r := redisDS{mockCmd} _, err := r.Del(context.Background(), "test_key").Result() assert.NoError(t, err, "TEST Failed.\n") @@ -64,10 +55,10 @@ func TestRedis_Rename(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - mockCmd := NewMockcommands(ctrl) + mockCmd := NewMockRedis(ctrl) mockCmd.EXPECT().Rename(context.Background(), "test_key", "test_new_key").Return(&goRedis.StatusCmd{}) - r := redis{mockCmd} + r := redisDS{mockCmd} _, err := r.Rename(context.Background(), "test_key", "test_new_key").Result() assert.NoError(t, err, "TEST Failed.\n") @@ -78,11 +69,11 @@ func TestRedisMigrator_GetLastMigration(t *testing.T) { defer ctrl.Finish() c, mocks := container.NewMockContainer(t) - mockMigrator := NewMockMigrator(ctrl) + mockMigrator := NewMockmigrator(ctrl) m := redisMigrator{ - commands: mocks.Redis, - Migrator: mockMigrator, + Redis: mocks.Redis, + migrator: mockMigrator, } tests := []struct { @@ -143,11 +134,11 @@ func TestRedisMigrator_beginTransaction(t *testing.T) { defer ctrl.Finish() c, mocks := container.NewMockContainer(t) - mockMigrator := NewMockMigrator(ctrl) + mockMigrator := NewMockmigrator(ctrl) m := redisMigrator{ - commands: mocks.Redis, - Migrator: mockMigrator, + Redis: mocks.Redis, + migrator: mockMigrator, } mocks.Redis.EXPECT().TxPipeline() @@ -155,5 +146,5 @@ func TestRedisMigrator_beginTransaction(t *testing.T) { data := m.beginTransaction(c) - assert.Equal(t, migrationData{}, data, "TEST Failed.\n") + assert.Equal(t, transactionData{}, data, "TEST Failed.\n") } diff --git a/pkg/gofr/migration/sql.go b/pkg/gofr/migration/sql.go index b5598146c..a711cbf2b 100644 --- a/pkg/gofr/migration/sql.go +++ b/pkg/gofr/migration/sql.go @@ -2,7 +2,6 @@ package migration import ( "context" - "database/sql" "time" "gofr.dev/pkg/gofr/container" @@ -25,63 +24,22 @@ const ( insertGoFrMigrationRowPostgres = `INSERT INTO gofr_migrations (version, method, start_time,duration) VALUES ($1, $2, $3, $4);` ) -type db interface { - Query(query string, args ...interface{}) (*sql.Rows, error) - QueryRow(query string, args ...interface{}) *sql.Row - QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row - Exec(query string, args ...interface{}) (sql.Result, error) - ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) +// database/sql is the package imported so named it sqlDS. +type sqlDS struct { + SQL } -type sqlDB struct { - db -} - -func newMysql(d db) *sqlDB { - return &sqlDB{db: d} -} - -func (s *sqlDB) Query(query string, args ...interface{}) (*sql.Rows, error) { - return s.db.Query(query, args...) -} - -func (s *sqlDB) QueryRow(query string, args ...interface{}) *sql.Row { - return s.db.QueryRow(query, args...) -} - -func (s *sqlDB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row { - return s.db.QueryRowContext(ctx, query, args...) -} - -func (s *sqlDB) Exec(query string, args ...interface{}) (sql.Result, error) { - return s.db.Exec(query, args...) -} - -func (s *sqlDB) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) { - return s.db.ExecContext(ctx, query, args...) -} - -func insertMigrationRecord(tx *gofrSql.Tx, query string, version int64, startTime time.Time) error { - _, err := tx.Exec(query, version, "UP", startTime, time.Since(startTime).Milliseconds()) - - return err -} - -type sqlMigratorObject struct { - db +func (s *sqlDS) apply(m migrator) migrator { + return sqlMigrator{ + SQL: s.SQL, + migrator: m, + } } type sqlMigrator struct { - db - - Migrator -} + SQL -func (s sqlMigratorObject) apply(m Migrator) Migrator { - return sqlMigrator{ - db: s.db, - Migrator: m, - } + migrator } func (d sqlMigrator) checkAndCreateMigrationTable(c *container.Container) error { @@ -89,7 +47,7 @@ func (d sqlMigrator) checkAndCreateMigrationTable(c *container.Container) error return err } - return d.Migrator.checkAndCreateMigrationTable(c) + return d.migrator.checkAndCreateMigrationTable(c) } func (d sqlMigrator) getLastMigration(c *container.Container) int64 { @@ -102,7 +60,7 @@ func (d sqlMigrator) getLastMigration(c *container.Container) int64 { c.Debugf("SQL last migration fetched value is: %v", lastMigration) - lm2 := d.Migrator.getLastMigration(c) + lm2 := d.migrator.getLastMigration(c) if lm2 > lastMigration { return lm2 @@ -111,7 +69,7 @@ func (d sqlMigrator) getLastMigration(c *container.Container) int64 { return lastMigration } -func (d sqlMigrator) commitMigration(c *container.Container, data migrationData) error { +func (d sqlMigrator) commitMigration(c *container.Container, data transactionData) error { switch c.SQL.Dialect() { case "mysql", "sqlite": err := insertMigrationRecord(data.SQLTx, insertGoFrMigrationRowMySQL, data.MigrationNumber, data.StartTime) @@ -135,18 +93,24 @@ func (d sqlMigrator) commitMigration(c *container.Container, data migrationData) return err } - return d.Migrator.commitMigration(c, data) + return d.migrator.commitMigration(c, data) +} + +func insertMigrationRecord(tx *gofrSql.Tx, query string, version int64, startTime time.Time) error { + _, err := tx.Exec(query, version, "UP", startTime, time.Since(startTime).Milliseconds()) + + return err } -func (d sqlMigrator) beginTransaction(c *container.Container) migrationData { +func (d sqlMigrator) beginTransaction(c *container.Container) transactionData { sqlTx, err := c.SQL.Begin() if err != nil { c.Errorf("unable to begin transaction: %v", err) - return migrationData{} + return transactionData{} } - cmt := d.Migrator.beginTransaction(c) + cmt := d.migrator.beginTransaction(c) cmt.SQLTx = sqlTx @@ -155,7 +119,7 @@ func (d sqlMigrator) beginTransaction(c *container.Container) migrationData { return cmt } -func (d sqlMigrator) rollback(c *container.Container, data migrationData) { +func (d sqlMigrator) rollback(c *container.Container, data transactionData) { if data.SQLTx == nil { return } @@ -166,5 +130,5 @@ func (d sqlMigrator) rollback(c *container.Container, data migrationData) { c.Errorf("Migration %v failed and rolled back", data.MigrationNumber) - d.Migrator.rollback(c, data) + d.migrator.rollback(c, data) } diff --git a/pkg/gofr/migration/sql_test.go b/pkg/gofr/migration/sql_test.go index df0112de3..5255477df 100644 --- a/pkg/gofr/migration/sql_test.go +++ b/pkg/gofr/migration/sql_test.go @@ -13,17 +13,6 @@ import ( "gofr.dev/pkg/gofr/container" ) -func TestNewMysql(t *testing.T) { - ctrl := gomock.NewController(t) - mockDB := container.NewMockDB(ctrl) - - sqlDB := newMysql(mockDB) - - if sqlDB.db != mockDB { - t.Errorf("newMysql should wrap the provided db, got: %v", sqlDB.db) - } -} - func TestQuery(t *testing.T) { t.Run("successful query", func(t *testing.T) { ctrl := gomock.NewController(t) @@ -31,9 +20,9 @@ func TestQuery(t *testing.T) { expectedRows := &sql.Rows{} mockDB.EXPECT().Query("SELECT * FROM users", []interface{}{}).Return(expectedRows, nil) - sqlDB := newMysql(mockDB) + sqlMockDB := mockDB - rows, err := sqlDB.Query("SELECT * FROM users", []interface{}{}) + rows, err := sqlMockDB.Query("SELECT * FROM users", []interface{}{}) if rows.Err() != nil { t.Errorf("unexpected row error: %v", rows.Err()) } @@ -53,9 +42,9 @@ func TestQuery(t *testing.T) { expectedErr := sql.ErrNoRows mockDB.EXPECT().Query("SELECT * FROM unknown_table", []interface{}{}).Return(nil, expectedErr) - sqlDB := newMysql(mockDB) + sqlMockDB := mockDB - rows, err := sqlDB.Query("SELECT * FROM unknown_table", []interface{}{}) + rows, err := sqlMockDB.Query("SELECT * FROM unknown_table", []interface{}{}) if rows != nil { t.Errorf("unexpected rows error: %v", rows.Err()) } @@ -77,9 +66,9 @@ func TestQueryRow(t *testing.T) { expectedRow := &sql.Row{} mockDB.EXPECT().QueryRow("SELECT * FROM users WHERE id = ?", 1).Return(expectedRow) - sqlDB := newMysql(mockDB) + sqlMockDB := mockDB - row := sqlDB.QueryRow("SELECT * FROM users WHERE id = ?", 1) + row := sqlMockDB.QueryRow("SELECT * FROM users WHERE id = ?", 1) if row != expectedRow { t.Errorf("QueryRow should return the expected row, got: %v", row) @@ -95,9 +84,9 @@ func TestQueryRowContext(t *testing.T) { mockDB := container.NewMockDB(ctrl) expectedRow := &sql.Row{} mockDB.EXPECT().QueryRowContext(ctx, "SELECT * FROM users WHERE id = ?", 1).Return(expectedRow) - sqlDB := newMysql(mockDB) + sqlMockDB := mockDB - row := sqlDB.QueryRowContext(ctx, "SELECT * FROM users WHERE id = ?", 1) + row := sqlMockDB.QueryRowContext(ctx, "SELECT * FROM users WHERE id = ?", 1) if row != expectedRow { t.Errorf("QueryRowContext should return the expected row, got: %v", row) @@ -112,7 +101,7 @@ func TestExec(t *testing.T) { expectedResult := sqlmock.NewResult(10, 1) mockDB.EXPECT().Exec("DELETE FROM users WHERE id = ?", 1).Return(expectedResult, nil) - sqlDB := newMysql(mockDB) + sqlDB := mockDB result, err := sqlDB.Exec("DELETE FROM users WHERE id = ?", 1) @@ -131,9 +120,9 @@ func TestExec(t *testing.T) { expectedErr := sql.ErrNoRows mockDB.EXPECT().Exec("UPDATE unknown_table SET name = ?", "John").Return(nil, expectedErr) - sqlDB := newMysql(mockDB) + sqlMockDB := mockDB - _, err := sqlDB.Exec("UPDATE unknown_table SET name = ?", "John") + _, err := sqlMockDB.Exec("UPDATE unknown_table SET name = ?", "John") if err == nil { t.Errorf("Exec should return an error") @@ -154,9 +143,9 @@ func TestExecContext(t *testing.T) { expectedResult := sqlmock.NewResult(10, 1) mockDB.EXPECT().ExecContext(ctx, "DELETE FROM users WHERE id = ?", 1).Return(expectedResult, nil) - sqlDB := newMysql(mockDB) + sqlMockDB := mockDB - result, err := sqlDB.ExecContext(ctx, "DELETE FROM users WHERE id = ?", 1) + result, err := sqlMockDB.ExecContext(ctx, "DELETE FROM users WHERE id = ?", 1) if err != nil { t.Errorf("ExecContext should return no error, got: %v", err) @@ -171,15 +160,15 @@ func TestExecContext(t *testing.T) { func TestCheckAndCreateMigrationTableSuccess(t *testing.T) { ctrl := gomock.NewController(t) mockDB := container.NewMockDB(ctrl) - mockMigrator := NewMockMigrator(ctrl) + mockMigrator := NewMockmigrator(ctrl) mockContainer, mocks := container.NewMockContainer(t) mockMigrator.EXPECT().checkAndCreateMigrationTable(mockContainer) mocks.SQL.EXPECT().Exec(createSQLGoFrMigrationsTable).Return(nil, nil) migrator := sqlMigrator{ - db: mockDB, - Migrator: mockMigrator, + SQL: mockDB, + migrator: mockMigrator, } err := migrator.checkAndCreateMigrationTable(mockContainer) @@ -192,15 +181,15 @@ func TestCheckAndCreateMigrationTableSuccess(t *testing.T) { func TestCheckAndCreateMigrationTableExecError(t *testing.T) { ctrl := gomock.NewController(t) mockDB := container.NewMockDB(ctrl) - mockMigrator := NewMockMigrator(ctrl) + mockMigrator := NewMockmigrator(ctrl) mockContainer, mocks := container.NewMockContainer(t) expectedErr := sql.ErrNoRows mocks.SQL.EXPECT().Exec(createSQLGoFrMigrationsTable).Return(nil, expectedErr) migrator := sqlMigrator{ - db: mockDB, - Migrator: mockMigrator, + SQL: mockDB, + migrator: mockMigrator, } err := migrator.checkAndCreateMigrationTable(mockContainer) @@ -217,21 +206,21 @@ func TestCheckAndCreateMigrationTableExecError(t *testing.T) { func TestBeginTransactionSuccess(t *testing.T) { ctrl := gomock.NewController(t) mockDB := container.NewMockDB(ctrl) - mockMigrator := NewMockMigrator(ctrl) + mockMigrator := NewMockmigrator(ctrl) mockContainer, mocks := container.NewMockContainer(t) - expectedMigrationData := migrationData{} + expectedMigrationData := transactionData{} mocks.SQL.EXPECT().Begin() mockMigrator.EXPECT().beginTransaction(mockContainer) migrator := sqlMigrator{ - db: mockDB, - Migrator: mockMigrator, + SQL: mockDB, + migrator: mockMigrator, } data := migrator.beginTransaction(mockContainer) if data != expectedMigrationData { - t.Errorf("beginTransaction should return data from Migrator, got: %v", data) + t.Errorf("beginTransaction should return data from migrator, got: %v", data) } } @@ -242,14 +231,14 @@ var ( func TestBeginTransactionDBError(t *testing.T) { ctrl := gomock.NewController(t) mockDB := container.NewMockDB(ctrl) - mockMigrator := NewMockMigrator(ctrl) + mockMigrator := NewMockmigrator(ctrl) mockContainer, mocks := container.NewMockContainer(t) mocks.SQL.EXPECT().Begin().Return(nil, errBeginTx) migrator := sqlMigrator{ - db: mockDB, - Migrator: mockMigrator, + SQL: mockDB, + migrator: mockMigrator, } data := migrator.beginTransaction(mockContainer) @@ -262,5 +251,5 @@ func TestRollbackNoTransaction(t *testing.T) { mockContainer, _ := container.NewMockContainer(t) migrator := sqlMigrator{} - migrator.rollback(mockContainer, migrationData{}) + migrator.rollback(mockContainer, transactionData{}) } From f2c125a6c2315c7d9d1b8f690b22152d6ba29d03 Mon Sep 17 00:00:00 2001 From: "jonny.oh" Date: Tue, 25 Jun 2024 12:47:40 +0900 Subject: [PATCH 04/17] fix: typo --- docs/quick-start/observability/page.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quick-start/observability/page.md b/docs/quick-start/observability/page.md index 912f922c2..c99a2d14f 100644 --- a/docs/quick-start/observability/page.md +++ b/docs/quick-start/observability/page.md @@ -201,7 +201,7 @@ LOG_LEVEL=DEBUG Open {% new-tab-link title="zipkin" href="http://localhost:2005/zipkin/" /%} and search by TraceID (correlationID) to see the trace. {% figure src="/quick-start-trace.png" alt="Zipkin traces" /%} -#### 2. [Jeager](https://www.jaegertracing.io/): +#### 2. [Jaeger](https://www.jaegertracing.io/): To see the traces install jaeger image using the following docker command: From 1a7794f6a562250b8bd009f3819e0d329d07b6b3 Mon Sep 17 00:00:00 2001 From: srijan-27 Date: Tue, 25 Jun 2024 11:41:06 +0530 Subject: [PATCH 05/17] fix typos in docs --- docs/advanced-guide/gofr-errors/page.md | 4 ++++ docs/advanced-guide/handling-file/page.md | 4 ++-- docs/advanced-guide/overriding-default/page.md | 4 ++-- docs/advanced-guide/swagger-documentation/page.md | 2 +- docs/quick-start/configuration/page.md | 4 ++-- docs/quick-start/connecting-mysql/page.md | 2 +- docs/quick-start/observability/page.md | 8 ++++---- docs/references/configs/page.md | 3 +-- docs/references/context/page.md | 2 +- 9 files changed, 18 insertions(+), 15 deletions(-) diff --git a/docs/advanced-guide/gofr-errors/page.md b/docs/advanced-guide/gofr-errors/page.md index 4927e655f..0c9ee4544 100644 --- a/docs/advanced-guide/gofr-errors/page.md +++ b/docs/advanced-guide/gofr-errors/page.md @@ -12,6 +12,10 @@ automatically handle HTTP status code selection. These include: - `ErrorInvalidParam`: Represents an error due to an invalid parameter. - `ErrorMissingParam`: Represents an error due to a missing parameter. - `ErrorEntityNotFound`: Represents an error due to a not found entity. +- `ErrorEntityAlreadyExist`: Represents an error due to creation of duplicate entity. +- `ErrorInvalidRoute`: Represents an error for invalid route. +- `ErrorRequestTimeout`: Represents an error for request which timed out. +- `ErrorPanicRecovery`: Represents an error for request which panicked. #### Usage: To use the predefined http errors,users can simply call them using GoFr's http package: diff --git a/docs/advanced-guide/handling-file/page.md b/docs/advanced-guide/handling-file/page.md index 3999d0070..689106d91 100644 --- a/docs/advanced-guide/handling-file/page.md +++ b/docs/advanced-guide/handling-file/page.md @@ -1,6 +1,6 @@ # Handling File -Gofr simplifies the complexity of working with different filestores by offering a uniform API. This allows developers to interact with different storage systems using the same set of methods, without needing to understand the underlying implementation details of each filestore. +GoFr simplifies the complexity of working with different file stores by offering a uniform API. This allows developers to interact with different storage systems using the same set of methods, without needing to understand the underlying implementation details of each file store. ## USAGE @@ -82,4 +82,4 @@ err := c.File.RemoveAll("my_dir/my_text") ``` -> Errors have been skipped in the example to focus on the core logic, it is recommended to handle all the errors. \ No newline at end of file +> Errors have been skipped in the example to focus on the core logic, it is recommended to handle all the errors. diff --git a/docs/advanced-guide/overriding-default/page.md b/docs/advanced-guide/overriding-default/page.md index 5c14194c6..9ede5d258 100644 --- a/docs/advanced-guide/overriding-default/page.md +++ b/docs/advanced-guide/overriding-default/page.md @@ -74,7 +74,7 @@ Response example: ## Favicon.ico -By default GoFr load its own `favicon.ico` present in root directory for an application. To override `favicon.ico` user +By default, GoFr load its own `favicon.ico` present in root directory for an application. To override `favicon.ico` user can place its custom icon in the **static** directory of its application. -> NOTE: The custom favicon should also be named as `favicon.ico` in the static directory of application. \ No newline at end of file +> NOTE: The custom favicon should also be named as `favicon.ico` in the static directory of application. diff --git a/docs/advanced-guide/swagger-documentation/page.md b/docs/advanced-guide/swagger-documentation/page.md index 2d47d330d..d6bd04b0b 100644 --- a/docs/advanced-guide/swagger-documentation/page.md +++ b/docs/advanced-guide/swagger-documentation/page.md @@ -23,7 +23,7 @@ GoFr will automatically render the Swagger documentation at the `/.well-known/sw Here are the steps: - Create an `openapi.json` file that describes your API according to the OpenAPI specification. -- Place the `openapi.json` file inside the static directory in your project. +- Place the `openapi.json` file inside the `static` directory in your project. - Start your GoFr server. - Navigate to `/.well-known/swagger` on your server’s URL. diff --git a/docs/quick-start/configuration/page.md b/docs/quick-start/configuration/page.md index a4ac7c53e..5369cbe87 100644 --- a/docs/quick-start/configuration/page.md +++ b/docs/quick-start/configuration/page.md @@ -2,7 +2,7 @@ GoFr simplifies configuration management by reading configuration via environment variables. Application code is decoupled from how configuration is managed as per the {%new-tab-link title="12-factor" href="https://12factor.net/config" %}. -Configs in GoFr can be used to initialise datasources, tracing , setting log levels, changing default HTTP or metrics port. +Configs in GoFr can be used to initialise datasources, tracing, setting log levels, changing default HTTP or metrics port. This abstraction provides a user-friendly interface for configuring user's application without modifying the code itself. To set configs create a `configs` directory in the project's root and add `.env` file. @@ -44,4 +44,4 @@ APP_ENV=dev go run main.go ``` -This approach ensures that the correct configurations are used for each environment, providing flexibility and control over the application's behavior in different contexts. \ No newline at end of file +This approach ensures that the correct configurations are used for each environment, providing flexibility and control over the application's behavior in different contexts. diff --git a/docs/quick-start/connecting-mysql/page.md b/docs/quick-start/connecting-mysql/page.md index 990184cfa..b6043eb5c 100644 --- a/docs/quick-start/connecting-mysql/page.md +++ b/docs/quick-start/connecting-mysql/page.md @@ -4,7 +4,7 @@ Just like Redis GoFr also supports connection to SQL(MySQL and Postgres) databas ## Setup -Users can run MySQL and create a database locally using the following docker command: +Users can run MySQL and create a database locally using the following Docker command: ```bash docker run --name gofr-mysql -e MYSQL_ROOT_PASSWORD=root123 -e MYSQL_DATABASE=test_db -p 3306:3306 -d mysql:8.0.30 diff --git a/docs/quick-start/observability/page.md b/docs/quick-start/observability/page.md index 912f922c2..0d1c83613 100644 --- a/docs/quick-start/observability/page.md +++ b/docs/quick-start/observability/page.md @@ -166,7 +166,7 @@ a request as it travels through your distributed system by simply looking at the GoFr has support for following trace-exporters: #### 1. [Zipkin](https://zipkin.io/): -To see the traces install zipkin image using the following docker command: +To see the traces install zipkin image using the following Docker command: ```bash docker run --name gofr-zipkin -p 2005:9411 -d openzipkin/zipkin:latest @@ -188,7 +188,7 @@ DB_NAME=test_db DB_PORT=3306 # tracing configs -TRACE_EXPORTER=zipkin +TRACE_EXPORTER=zipkin TRACER_HOST=localhost TRACER_PORT=2005 @@ -203,7 +203,7 @@ Open {% new-tab-link title="zipkin" href="http://localhost:2005/zipkin/" /%} and #### 2. [Jeager](https://www.jaegertracing.io/): -To see the traces install jaeger image using the following docker command: +To see the traces install jaeger image using the following Docker command: ```bash docker run -d --name jaeger \ @@ -227,7 +227,7 @@ TRACER_PORT=14317 Open {% new-tab-link title="zipkin" href="http://localhost:16686/trace/" /%} and search by TraceID (correlationID) to see the trace. {% figure src="/jaeger-traces.png" alt="Jaeger traces" /%} -#### 3. [GoFr Tracer](https://tracer.gofr.dev/) +#### 3. [GoFr Tracer](https://tracer.gofr.dev/): GoFr tracer is GoFr's own custom trace exporter as well as collector. You can search a trace by its TraceID (correlationID) in GoFr's own tracer service available anywhere, anytime. diff --git a/docs/references/configs/page.md b/docs/references/configs/page.md index 8ad35d4f1..4f0f12175 100644 --- a/docs/references/configs/page.md +++ b/docs/references/configs/page.md @@ -1,6 +1,6 @@ # GoFr Configuration Options -This document lists all the configuration options supported by the Gofr framework. The configurations are grouped by category for better organization. +This document lists all the configuration options supported by the GoFr framework. The configurations are grouped by category for better organization. ## App @@ -301,4 +301,3 @@ This document lists all the configuration options supported by the Gofr framewor - Quality of Service Level {% /table %} - diff --git a/docs/references/context/page.md b/docs/references/context/page.md index 30dbf2268..aff1923e1 100644 --- a/docs/references/context/page.md +++ b/docs/references/context/page.md @@ -3,7 +3,7 @@ GoFr context is an object injected by the GoFr handler. It contains all the requ request-response cycle a new context is created. The request can be either an HTTP request, GRPC call or a message from Pub-Sub. GoFr Context also embeds the **_container_** which maintains all the dependencies like databases, logger, HTTP service clients, -, metrics manager, etc. This reduces the complexity of the application as users don't have to maintain and keep track of +metrics manager, etc. This reduces the complexity of the application as users don't have to maintain and keep track of all the dependencies by themselves. GoFr context is an extension of the go context, providing a wrapper around the request and response providing From f0c5ab877e9e863cabdc4ad0b8466b4f4c781a74 Mon Sep 17 00:00:00 2001 From: Aryan Mehrotra <44036979+aryanmehrotra@users.noreply.github.com> Date: Wed, 26 Jun 2024 12:36:34 +0530 Subject: [PATCH 06/17] Refactor and Add mocks for external datasources (#749) --- pkg/gofr/container/container.go | 7 +- pkg/gofr/container/datasources.go | 145 +++++ pkg/gofr/container/mock_container.go | 24 +- pkg/gofr/container/mock_datasources.go | 857 +++++++++++++++++++++++++ pkg/gofr/datasource/cassandra.go | 75 --- pkg/gofr/datasource/clickhouse.go | 22 - pkg/gofr/datasource/mongo.go | 67 -- pkg/gofr/externalDB.go | 12 +- 8 files changed, 1033 insertions(+), 176 deletions(-) delete mode 100644 pkg/gofr/datasource/cassandra.go delete mode 100644 pkg/gofr/datasource/clickhouse.go delete mode 100644 pkg/gofr/datasource/mongo.go diff --git a/pkg/gofr/container/container.go b/pkg/gofr/container/container.go index ea20fab54..0fa27c2a3 100644 --- a/pkg/gofr/container/container.go +++ b/pkg/gofr/container/container.go @@ -37,10 +37,9 @@ type Container struct { Redis Redis SQL DB - // TODO : Move interfaces in container as it is being used by container and not datasources. - Cassandra datasource.Cassandra - Clickhouse datasource.Clickhouse - Mongo datasource.Mongo + Cassandra Cassandra + Clickhouse Clickhouse + Mongo Mongo File datasource.FileSystem } diff --git a/pkg/gofr/container/datasources.go b/pkg/gofr/container/datasources.go index bfa0e16d9..5338f4ecd 100644 --- a/pkg/gofr/container/datasources.go +++ b/pkg/gofr/container/datasources.go @@ -29,3 +29,148 @@ type Redis interface { redis.HashCmdable HealthCheck() datasource.Health } + +type Cassandra interface { + // Query executes the query and binds the result into dest parameter. + // Returns error if any error occurs while binding the result. + // Can be used to single as well as multiple rows. + // Accepts pointer to struct or slice as dest parameter for single and multiple rows retrieval respectively. + // + // Example: + // + // // Get multiple rows with only one column + // ids := make([]int, 0) + // err := c.Query(&ids, "SELECT id FROM users") + // + // // Get a single object from database + // type user struct { + // ID int + // Name string + // } + // u := user{} + // err := c.Query(&u, "SELECT * FROM users WHERE id=?", 1) + // + // // Get array of objects from multiple rows + // type user struct { + // ID int + // Name string `db:"name"` + // } + // users := []user{} + // err := c.Query(&users, "SELECT * FROM users") + Query(dest interface{}, stmt string, values ...interface{}) error + + // Exec executes the query without returning any rows. + // Return error if any error occurs while executing the query. + // Can be used to execute UPDATE or INSERT. + // + // Example: + // + // // Without values + // err := c.Exec("INSERT INTO users VALUES(1, 'John Doe')") + // + // // With Values + // id := 1 + // name := "John Doe" + // err := c.Exec("INSERT INTO users VALUES(?, ?)", id, name) + Exec(stmt string, values ...interface{}) error + + // ExecCAS executes a lightweight transaction (i.e. an UPDATE or INSERT statement containing an IF clause). + // If the transaction fails because the existing values did not match, the previous values will be stored in dest. + // Returns true if the query is applied otherwise false. + // Returns false and error if any error occur while executing the query. + // Accepts only pointer to struct and built-in types as the dest parameter. + // + // Example: + // + // type user struct { + // ID int + // Name string + // } + // u := user{} + // applied, err := c.ExecCAS(&ids, "INSERT INTO users VALUES(1, 'John Doe') IF NOT EXISTS") + ExecCAS(dest interface{}, stmt string, values ...interface{}) (bool, error) +} + +type CassandraProvider interface { + Cassandra + + provider +} + +type Clickhouse interface { + Exec(ctx context.Context, query string, args ...any) error + Select(ctx context.Context, dest any, query string, args ...any) error + AsyncInsert(ctx context.Context, query string, wait bool, args ...any) error +} + +type ClickhouseProvider interface { + Clickhouse + + provider +} + +// Mongo is an interface representing a MongoDB database client with common CRUD operations. +type Mongo interface { + // Find executes a query to find documents in a collection based on a filter and stores the results + // into the provided results interface. + Find(ctx context.Context, collection string, filter interface{}, results interface{}) error + + // FindOne executes a query to find a single document in a collection based on a filter and stores the result + // into the provided result interface. + FindOne(ctx context.Context, collection string, filter interface{}, result interface{}) error + + // InsertOne inserts a single document into a collection. + // It returns the identifier of the inserted document and an error, if any. + InsertOne(ctx context.Context, collection string, document interface{}) (interface{}, error) + + // InsertMany inserts multiple documents into a collection. + // It returns the identifiers of the inserted documents and an error, if any. + InsertMany(ctx context.Context, collection string, documents []interface{}) ([]interface{}, error) + + // DeleteOne deletes a single document from a collection based on a filter. + // It returns the number of documents deleted and an error, if any. + DeleteOne(ctx context.Context, collection string, filter interface{}) (int64, error) + + // DeleteMany deletes multiple documents from a collection based on a filter. + // It returns the number of documents deleted and an error, if any. + DeleteMany(ctx context.Context, collection string, filter interface{}) (int64, error) + + // UpdateByID updates a document in a collection by its ID. + // It returns the number of documents updated and an error if any. + UpdateByID(ctx context.Context, collection string, id interface{}, update interface{}) (int64, error) + + // UpdateOne updates a single document in a collection based on a filter. + // It returns an error if any. + UpdateOne(ctx context.Context, collection string, filter interface{}, update interface{}) error + + // UpdateMany updates multiple documents in a collection based on a filter. + // It returns the number of documents updated and an error if any. + UpdateMany(ctx context.Context, collection string, filter interface{}, update interface{}) (int64, error) + + // CountDocuments counts the number of documents in a collection based on a filter. + // It returns the count and an error if any. + CountDocuments(ctx context.Context, collection string, filter interface{}) (int64, error) + + // Drop an entire collection from the database. + // It returns an error if any. + Drop(ctx context.Context, collection string) error +} + +// MongoProvider is an interface that extends Mongo with additional methods for logging, metrics, and connection management. +// Which is used for initializing datasource. +type MongoProvider interface { + Mongo + + provider +} + +type provider interface { + // UseLogger sets the logger for the Cassandra client. + UseLogger(logger interface{}) + + // UseMetrics sets the metrics for the Cassandra client. + UseMetrics(metrics interface{}) + + // Connect establishes a connection to Cassandra and registers metrics using the provided configuration when the client was Created. + Connect() +} diff --git a/pkg/gofr/container/mock_container.go b/pkg/gofr/container/mock_container.go index 2719b98ff..5a6ada69a 100644 --- a/pkg/gofr/container/mock_container.go +++ b/pkg/gofr/container/mock_container.go @@ -14,8 +14,11 @@ import ( ) type Mocks struct { - Redis *MockRedis - SQL *MockDB + Redis *MockRedis + SQL *MockDB + Clickhouse *MockClickhouse + Cassandra *MockCassandra + Mongo *MockMongo } func NewMockContainer(t *testing.T) (*Container, Mocks) { @@ -30,7 +33,22 @@ func NewMockContainer(t *testing.T) (*Container, Mocks) { redisMock := NewMockRedis(ctrl) container.Redis = redisMock - mocks := Mocks{Redis: redisMock, SQL: sqlMock} + cassandraMock := NewMockCassandra(ctrl) + container.Cassandra = cassandraMock + + clickhouseMock := NewMockClickhouse(ctrl) + container.Clickhouse = clickhouseMock + + mongoMock := NewMockMongo(ctrl) + container.Mongo = mongoMock + + mocks := Mocks{ + Redis: redisMock, + SQL: sqlMock, + Clickhouse: clickhouseMock, + Cassandra: cassandraMock, + Mongo: mongoMock, + } mockMetrics := NewMockMetrics(ctrl) container.metricsManager = mockMetrics diff --git a/pkg/gofr/container/mock_datasources.go b/pkg/gofr/container/mock_datasources.go index 5d9b1fdb5..bcdd509e2 100644 --- a/pkg/gofr/container/mock_datasources.go +++ b/pkg/gofr/container/mock_datasources.go @@ -7264,3 +7264,860 @@ func (mr *MockRedisMockRecorder) ZUnionWithScores(ctx, store any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ZUnionWithScores", reflect.TypeOf((*MockRedis)(nil).ZUnionWithScores), ctx, store) } + +// MockCassandra is a mock of Cassandra interface. +type MockCassandra struct { + ctrl *gomock.Controller + recorder *MockCassandraMockRecorder +} + +// MockCassandraMockRecorder is the mock recorder for MockCassandra. +type MockCassandraMockRecorder struct { + mock *MockCassandra +} + +// NewMockCassandra creates a new mock instance. +func NewMockCassandra(ctrl *gomock.Controller) *MockCassandra { + mock := &MockCassandra{ctrl: ctrl} + mock.recorder = &MockCassandraMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockCassandra) EXPECT() *MockCassandraMockRecorder { + return m.recorder +} + +// Exec mocks base method. +func (m *MockCassandra) Exec(stmt string, values ...any) error { + m.ctrl.T.Helper() + varargs := []any{stmt} + for _, a := range values { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Exec", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// Exec indicates an expected call of Exec. +func (mr *MockCassandraMockRecorder) Exec(stmt any, values ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{stmt}, values...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockCassandra)(nil).Exec), varargs...) +} + +// ExecCAS mocks base method. +func (m *MockCassandra) ExecCAS(dest any, stmt string, values ...any) (bool, error) { + m.ctrl.T.Helper() + varargs := []any{dest, stmt} + for _, a := range values { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ExecCAS", varargs...) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ExecCAS indicates an expected call of ExecCAS. +func (mr *MockCassandraMockRecorder) ExecCAS(dest, stmt any, values ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{dest, stmt}, values...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecCAS", reflect.TypeOf((*MockCassandra)(nil).ExecCAS), varargs...) +} + +// Query mocks base method. +func (m *MockCassandra) Query(dest any, stmt string, values ...any) error { + m.ctrl.T.Helper() + varargs := []any{dest, stmt} + for _, a := range values { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Query", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// Query indicates an expected call of Query. +func (mr *MockCassandraMockRecorder) Query(dest, stmt any, values ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{dest, stmt}, values...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Query", reflect.TypeOf((*MockCassandra)(nil).Query), varargs...) +} + +// MockClickhouse is a mock of Clickhouse interface. +type MockClickhouse struct { + ctrl *gomock.Controller + recorder *MockClickhouseMockRecorder +} + +// MockClickhouseMockRecorder is the mock recorder for MockClickhouse. +type MockClickhouseMockRecorder struct { + mock *MockClickhouse +} + +// NewMockClickhouse creates a new mock instance. +func NewMockClickhouse(ctrl *gomock.Controller) *MockClickhouse { + mock := &MockClickhouse{ctrl: ctrl} + mock.recorder = &MockClickhouseMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockClickhouse) EXPECT() *MockClickhouseMockRecorder { + return m.recorder +} + +// AsyncInsert mocks base method. +func (m *MockClickhouse) AsyncInsert(ctx context.Context, query string, wait bool, args ...any) error { + m.ctrl.T.Helper() + varargs := []any{ctx, query, wait} + for _, a := range args { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AsyncInsert", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// AsyncInsert indicates an expected call of AsyncInsert. +func (mr *MockClickhouseMockRecorder) AsyncInsert(ctx, query, wait any, args ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, query, wait}, args...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AsyncInsert", reflect.TypeOf((*MockClickhouse)(nil).AsyncInsert), varargs...) +} + +// Exec mocks base method. +func (m *MockClickhouse) Exec(ctx context.Context, query string, args ...any) error { + m.ctrl.T.Helper() + varargs := []any{ctx, query} + for _, a := range args { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Exec", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// Exec indicates an expected call of Exec. +func (mr *MockClickhouseMockRecorder) Exec(ctx, query any, args ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, query}, args...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockClickhouse)(nil).Exec), varargs...) +} + +// Select mocks base method. +func (m *MockClickhouse) Select(ctx context.Context, dest any, query string, args ...any) error { + m.ctrl.T.Helper() + varargs := []any{ctx, dest, query} + for _, a := range args { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Select", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// Select indicates an expected call of Select. +func (mr *MockClickhouseMockRecorder) Select(ctx, dest, query any, args ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, dest, query}, args...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Select", reflect.TypeOf((*MockClickhouse)(nil).Select), varargs...) +} + +// MockClickhouseProvider is a mock of ClickhouseProvider interface. +type MockClickhouseProvider struct { + ctrl *gomock.Controller + recorder *MockClickhouseProviderMockRecorder +} + +// MockClickhouseProviderMockRecorder is the mock recorder for MockClickhouseProvider. +type MockClickhouseProviderMockRecorder struct { + mock *MockClickhouseProvider +} + +// NewMockClickhouseProvider creates a new mock instance. +func NewMockClickhouseProvider(ctrl *gomock.Controller) *MockClickhouseProvider { + mock := &MockClickhouseProvider{ctrl: ctrl} + mock.recorder = &MockClickhouseProviderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockClickhouseProvider) EXPECT() *MockClickhouseProviderMockRecorder { + return m.recorder +} + +// AsyncInsert mocks base method. +func (m *MockClickhouseProvider) AsyncInsert(ctx context.Context, query string, wait bool, args ...any) error { + m.ctrl.T.Helper() + varargs := []any{ctx, query, wait} + for _, a := range args { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AsyncInsert", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// AsyncInsert indicates an expected call of AsyncInsert. +func (mr *MockClickhouseProviderMockRecorder) AsyncInsert(ctx, query, wait any, args ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, query, wait}, args...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AsyncInsert", reflect.TypeOf((*MockClickhouseProvider)(nil).AsyncInsert), varargs...) +} + +// Connect mocks base method. +func (m *MockClickhouseProvider) Connect() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Connect") +} + +// Connect indicates an expected call of Connect. +func (mr *MockClickhouseProviderMockRecorder) Connect() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connect", reflect.TypeOf((*MockClickhouseProvider)(nil).Connect)) +} + +// Exec mocks base method. +func (m *MockClickhouseProvider) Exec(ctx context.Context, query string, args ...any) error { + m.ctrl.T.Helper() + varargs := []any{ctx, query} + for _, a := range args { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Exec", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// Exec indicates an expected call of Exec. +func (mr *MockClickhouseProviderMockRecorder) Exec(ctx, query any, args ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, query}, args...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockClickhouseProvider)(nil).Exec), varargs...) +} + +// Select mocks base method. +func (m *MockClickhouseProvider) Select(ctx context.Context, dest any, query string, args ...any) error { + m.ctrl.T.Helper() + varargs := []any{ctx, dest, query} + for _, a := range args { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Select", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// Select indicates an expected call of Select. +func (mr *MockClickhouseProviderMockRecorder) Select(ctx, dest, query any, args ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, dest, query}, args...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Select", reflect.TypeOf((*MockClickhouseProvider)(nil).Select), varargs...) +} + +// UseLogger mocks base method. +func (m *MockClickhouseProvider) UseLogger(logger any) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "UseLogger", logger) +} + +// UseLogger indicates an expected call of UseLogger. +func (mr *MockClickhouseProviderMockRecorder) UseLogger(logger any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UseLogger", reflect.TypeOf((*MockClickhouseProvider)(nil).UseLogger), logger) +} + +// UseMetrics mocks base method. +func (m *MockClickhouseProvider) UseMetrics(metrics any) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "UseMetrics", metrics) +} + +// UseMetrics indicates an expected call of UseMetrics. +func (mr *MockClickhouseProviderMockRecorder) UseMetrics(metrics any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UseMetrics", reflect.TypeOf((*MockClickhouseProvider)(nil).UseMetrics), metrics) +} + +// MockCassandraProvider is a mock of CassandraProvider interface. +type MockCassandraProvider struct { + ctrl *gomock.Controller + recorder *MockCassandraProviderMockRecorder +} + +// MockCassandraProviderMockRecorder is the mock recorder for MockCassandraProvider. +type MockCassandraProviderMockRecorder struct { + mock *MockCassandraProvider +} + +// NewMockCassandraProvider creates a new mock instance. +func NewMockCassandraProvider(ctrl *gomock.Controller) *MockCassandraProvider { + mock := &MockCassandraProvider{ctrl: ctrl} + mock.recorder = &MockCassandraProviderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockCassandraProvider) EXPECT() *MockCassandraProviderMockRecorder { + return m.recorder +} + +// Connect mocks base method. +func (m *MockCassandraProvider) Connect() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Connect") +} + +// Connect indicates an expected call of Connect. +func (mr *MockCassandraProviderMockRecorder) Connect() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connect", reflect.TypeOf((*MockCassandraProvider)(nil).Connect)) +} + +// Exec mocks base method. +func (m *MockCassandraProvider) Exec(stmt string, values ...any) error { + m.ctrl.T.Helper() + varargs := []any{stmt} + for _, a := range values { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Exec", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// Exec indicates an expected call of Exec. +func (mr *MockCassandraProviderMockRecorder) Exec(stmt any, values ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{stmt}, values...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockCassandraProvider)(nil).Exec), varargs...) +} + +// ExecCAS mocks base method. +func (m *MockCassandraProvider) ExecCAS(dest any, stmt string, values ...any) (bool, error) { + m.ctrl.T.Helper() + varargs := []any{dest, stmt} + for _, a := range values { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ExecCAS", varargs...) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ExecCAS indicates an expected call of ExecCAS. +func (mr *MockCassandraProviderMockRecorder) ExecCAS(dest, stmt any, values ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{dest, stmt}, values...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecCAS", reflect.TypeOf((*MockCassandraProvider)(nil).ExecCAS), varargs...) +} + +// Query mocks base method. +func (m *MockCassandraProvider) Query(dest any, stmt string, values ...any) error { + m.ctrl.T.Helper() + varargs := []any{dest, stmt} + for _, a := range values { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Query", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// Query indicates an expected call of Query. +func (mr *MockCassandraProviderMockRecorder) Query(dest, stmt any, values ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{dest, stmt}, values...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Query", reflect.TypeOf((*MockCassandraProvider)(nil).Query), varargs...) +} + +// UseLogger mocks base method. +func (m *MockCassandraProvider) UseLogger(logger any) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "UseLogger", logger) +} + +// UseLogger indicates an expected call of UseLogger. +func (mr *MockCassandraProviderMockRecorder) UseLogger(logger any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UseLogger", reflect.TypeOf((*MockCassandraProvider)(nil).UseLogger), logger) +} + +// UseMetrics mocks base method. +func (m *MockCassandraProvider) UseMetrics(metrics any) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "UseMetrics", metrics) +} + +// UseMetrics indicates an expected call of UseMetrics. +func (mr *MockCassandraProviderMockRecorder) UseMetrics(metrics any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UseMetrics", reflect.TypeOf((*MockCassandraProvider)(nil).UseMetrics), metrics) +} + +// MockMongo is a mock of Mongo interface. +type MockMongo struct { + ctrl *gomock.Controller + recorder *MockMongoMockRecorder +} + +// MockMongoMockRecorder is the mock recorder for MockMongo. +type MockMongoMockRecorder struct { + mock *MockMongo +} + +// NewMockMongo creates a new mock instance. +func NewMockMongo(ctrl *gomock.Controller) *MockMongo { + mock := &MockMongo{ctrl: ctrl} + mock.recorder = &MockMongoMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMongo) EXPECT() *MockMongoMockRecorder { + return m.recorder +} + +// CountDocuments mocks base method. +func (m *MockMongo) CountDocuments(ctx context.Context, collection string, filter any) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CountDocuments", ctx, collection, filter) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CountDocuments indicates an expected call of CountDocuments. +func (mr *MockMongoMockRecorder) CountDocuments(ctx, collection, filter any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CountDocuments", reflect.TypeOf((*MockMongo)(nil).CountDocuments), ctx, collection, filter) +} + +// DeleteMany mocks base method. +func (m *MockMongo) DeleteMany(ctx context.Context, collection string, filter any) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteMany", ctx, collection, filter) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteMany indicates an expected call of DeleteMany. +func (mr *MockMongoMockRecorder) DeleteMany(ctx, collection, filter any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteMany", reflect.TypeOf((*MockMongo)(nil).DeleteMany), ctx, collection, filter) +} + +// DeleteOne mocks base method. +func (m *MockMongo) DeleteOne(ctx context.Context, collection string, filter any) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteOne", ctx, collection, filter) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteOne indicates an expected call of DeleteOne. +func (mr *MockMongoMockRecorder) DeleteOne(ctx, collection, filter any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteOne", reflect.TypeOf((*MockMongo)(nil).DeleteOne), ctx, collection, filter) +} + +// Drop mocks base method. +func (m *MockMongo) Drop(ctx context.Context, collection string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Drop", ctx, collection) + ret0, _ := ret[0].(error) + return ret0 +} + +// Drop indicates an expected call of Drop. +func (mr *MockMongoMockRecorder) Drop(ctx, collection any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Drop", reflect.TypeOf((*MockMongo)(nil).Drop), ctx, collection) +} + +// Find mocks base method. +func (m *MockMongo) Find(ctx context.Context, collection string, filter, results any) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Find", ctx, collection, filter, results) + ret0, _ := ret[0].(error) + return ret0 +} + +// Find indicates an expected call of Find. +func (mr *MockMongoMockRecorder) Find(ctx, collection, filter, results any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockMongo)(nil).Find), ctx, collection, filter, results) +} + +// FindOne mocks base method. +func (m *MockMongo) FindOne(ctx context.Context, collection string, filter, result any) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FindOne", ctx, collection, filter, result) + ret0, _ := ret[0].(error) + return ret0 +} + +// FindOne indicates an expected call of FindOne. +func (mr *MockMongoMockRecorder) FindOne(ctx, collection, filter, result any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindOne", reflect.TypeOf((*MockMongo)(nil).FindOne), ctx, collection, filter, result) +} + +// InsertMany mocks base method. +func (m *MockMongo) InsertMany(ctx context.Context, collection string, documents []any) ([]any, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InsertMany", ctx, collection, documents) + ret0, _ := ret[0].([]any) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InsertMany indicates an expected call of InsertMany. +func (mr *MockMongoMockRecorder) InsertMany(ctx, collection, documents any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertMany", reflect.TypeOf((*MockMongo)(nil).InsertMany), ctx, collection, documents) +} + +// InsertOne mocks base method. +func (m *MockMongo) InsertOne(ctx context.Context, collection string, document any) (any, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InsertOne", ctx, collection, document) + ret0, _ := ret[0].(any) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InsertOne indicates an expected call of InsertOne. +func (mr *MockMongoMockRecorder) InsertOne(ctx, collection, document any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertOne", reflect.TypeOf((*MockMongo)(nil).InsertOne), ctx, collection, document) +} + +// UpdateByID mocks base method. +func (m *MockMongo) UpdateByID(ctx context.Context, collection string, id, update any) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateByID", ctx, collection, id, update) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateByID indicates an expected call of UpdateByID. +func (mr *MockMongoMockRecorder) UpdateByID(ctx, collection, id, update any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateByID", reflect.TypeOf((*MockMongo)(nil).UpdateByID), ctx, collection, id, update) +} + +// UpdateMany mocks base method. +func (m *MockMongo) UpdateMany(ctx context.Context, collection string, filter, update any) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateMany", ctx, collection, filter, update) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateMany indicates an expected call of UpdateMany. +func (mr *MockMongoMockRecorder) UpdateMany(ctx, collection, filter, update any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMany", reflect.TypeOf((*MockMongo)(nil).UpdateMany), ctx, collection, filter, update) +} + +// UpdateOne mocks base method. +func (m *MockMongo) UpdateOne(ctx context.Context, collection string, filter, update any) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateOne", ctx, collection, filter, update) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateOne indicates an expected call of UpdateOne. +func (mr *MockMongoMockRecorder) UpdateOne(ctx, collection, filter, update any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateOne", reflect.TypeOf((*MockMongo)(nil).UpdateOne), ctx, collection, filter, update) +} + +// MockMongoProvider is a mock of MongoProvider interface. +type MockMongoProvider struct { + ctrl *gomock.Controller + recorder *MockMongoProviderMockRecorder +} + +// MockMongoProviderMockRecorder is the mock recorder for MockMongoProvider. +type MockMongoProviderMockRecorder struct { + mock *MockMongoProvider +} + +// NewMockMongoProvider creates a new mock instance. +func NewMockMongoProvider(ctrl *gomock.Controller) *MockMongoProvider { + mock := &MockMongoProvider{ctrl: ctrl} + mock.recorder = &MockMongoProviderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMongoProvider) EXPECT() *MockMongoProviderMockRecorder { + return m.recorder +} + +// Connect mocks base method. +func (m *MockMongoProvider) Connect() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Connect") +} + +// Connect indicates an expected call of Connect. +func (mr *MockMongoProviderMockRecorder) Connect() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connect", reflect.TypeOf((*MockMongoProvider)(nil).Connect)) +} + +// CountDocuments mocks base method. +func (m *MockMongoProvider) CountDocuments(ctx context.Context, collection string, filter any) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CountDocuments", ctx, collection, filter) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CountDocuments indicates an expected call of CountDocuments. +func (mr *MockMongoProviderMockRecorder) CountDocuments(ctx, collection, filter any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CountDocuments", reflect.TypeOf((*MockMongoProvider)(nil).CountDocuments), ctx, collection, filter) +} + +// DeleteMany mocks base method. +func (m *MockMongoProvider) DeleteMany(ctx context.Context, collection string, filter any) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteMany", ctx, collection, filter) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteMany indicates an expected call of DeleteMany. +func (mr *MockMongoProviderMockRecorder) DeleteMany(ctx, collection, filter any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteMany", reflect.TypeOf((*MockMongoProvider)(nil).DeleteMany), ctx, collection, filter) +} + +// DeleteOne mocks base method. +func (m *MockMongoProvider) DeleteOne(ctx context.Context, collection string, filter any) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteOne", ctx, collection, filter) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteOne indicates an expected call of DeleteOne. +func (mr *MockMongoProviderMockRecorder) DeleteOne(ctx, collection, filter any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteOne", reflect.TypeOf((*MockMongoProvider)(nil).DeleteOne), ctx, collection, filter) +} + +// Drop mocks base method. +func (m *MockMongoProvider) Drop(ctx context.Context, collection string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Drop", ctx, collection) + ret0, _ := ret[0].(error) + return ret0 +} + +// Drop indicates an expected call of Drop. +func (mr *MockMongoProviderMockRecorder) Drop(ctx, collection any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Drop", reflect.TypeOf((*MockMongoProvider)(nil).Drop), ctx, collection) +} + +// Find mocks base method. +func (m *MockMongoProvider) Find(ctx context.Context, collection string, filter, results any) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Find", ctx, collection, filter, results) + ret0, _ := ret[0].(error) + return ret0 +} + +// Find indicates an expected call of Find. +func (mr *MockMongoProviderMockRecorder) Find(ctx, collection, filter, results any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockMongoProvider)(nil).Find), ctx, collection, filter, results) +} + +// FindOne mocks base method. +func (m *MockMongoProvider) FindOne(ctx context.Context, collection string, filter, result any) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FindOne", ctx, collection, filter, result) + ret0, _ := ret[0].(error) + return ret0 +} + +// FindOne indicates an expected call of FindOne. +func (mr *MockMongoProviderMockRecorder) FindOne(ctx, collection, filter, result any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindOne", reflect.TypeOf((*MockMongoProvider)(nil).FindOne), ctx, collection, filter, result) +} + +// InsertMany mocks base method. +func (m *MockMongoProvider) InsertMany(ctx context.Context, collection string, documents []any) ([]any, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InsertMany", ctx, collection, documents) + ret0, _ := ret[0].([]any) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InsertMany indicates an expected call of InsertMany. +func (mr *MockMongoProviderMockRecorder) InsertMany(ctx, collection, documents any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertMany", reflect.TypeOf((*MockMongoProvider)(nil).InsertMany), ctx, collection, documents) +} + +// InsertOne mocks base method. +func (m *MockMongoProvider) InsertOne(ctx context.Context, collection string, document any) (any, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InsertOne", ctx, collection, document) + ret0, _ := ret[0].(any) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InsertOne indicates an expected call of InsertOne. +func (mr *MockMongoProviderMockRecorder) InsertOne(ctx, collection, document any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertOne", reflect.TypeOf((*MockMongoProvider)(nil).InsertOne), ctx, collection, document) +} + +// UpdateByID mocks base method. +func (m *MockMongoProvider) UpdateByID(ctx context.Context, collection string, id, update any) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateByID", ctx, collection, id, update) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateByID indicates an expected call of UpdateByID. +func (mr *MockMongoProviderMockRecorder) UpdateByID(ctx, collection, id, update any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateByID", reflect.TypeOf((*MockMongoProvider)(nil).UpdateByID), ctx, collection, id, update) +} + +// UpdateMany mocks base method. +func (m *MockMongoProvider) UpdateMany(ctx context.Context, collection string, filter, update any) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateMany", ctx, collection, filter, update) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateMany indicates an expected call of UpdateMany. +func (mr *MockMongoProviderMockRecorder) UpdateMany(ctx, collection, filter, update any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMany", reflect.TypeOf((*MockMongoProvider)(nil).UpdateMany), ctx, collection, filter, update) +} + +// UpdateOne mocks base method. +func (m *MockMongoProvider) UpdateOne(ctx context.Context, collection string, filter, update any) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateOne", ctx, collection, filter, update) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateOne indicates an expected call of UpdateOne. +func (mr *MockMongoProviderMockRecorder) UpdateOne(ctx, collection, filter, update any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateOne", reflect.TypeOf((*MockMongoProvider)(nil).UpdateOne), ctx, collection, filter, update) +} + +// UseLogger mocks base method. +func (m *MockMongoProvider) UseLogger(logger any) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "UseLogger", logger) +} + +// UseLogger indicates an expected call of UseLogger. +func (mr *MockMongoProviderMockRecorder) UseLogger(logger any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UseLogger", reflect.TypeOf((*MockMongoProvider)(nil).UseLogger), logger) +} + +// UseMetrics mocks base method. +func (m *MockMongoProvider) UseMetrics(metrics any) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "UseMetrics", metrics) +} + +// UseMetrics indicates an expected call of UseMetrics. +func (mr *MockMongoProviderMockRecorder) UseMetrics(metrics any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UseMetrics", reflect.TypeOf((*MockMongoProvider)(nil).UseMetrics), metrics) +} + +// Mockprovider is a mock of provider interface. +type Mockprovider struct { + ctrl *gomock.Controller + recorder *MockproviderMockRecorder +} + +// MockproviderMockRecorder is the mock recorder for Mockprovider. +type MockproviderMockRecorder struct { + mock *Mockprovider +} + +// NewMockprovider creates a new mock instance. +func NewMockprovider(ctrl *gomock.Controller) *Mockprovider { + mock := &Mockprovider{ctrl: ctrl} + mock.recorder = &MockproviderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *Mockprovider) EXPECT() *MockproviderMockRecorder { + return m.recorder +} + +// Connect mocks base method. +func (m *Mockprovider) Connect() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Connect") +} + +// Connect indicates an expected call of Connect. +func (mr *MockproviderMockRecorder) Connect() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connect", reflect.TypeOf((*Mockprovider)(nil).Connect)) +} + +// UseLogger mocks base method. +func (m *Mockprovider) UseLogger(logger any) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "UseLogger", logger) +} + +// UseLogger indicates an expected call of UseLogger. +func (mr *MockproviderMockRecorder) UseLogger(logger any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UseLogger", reflect.TypeOf((*Mockprovider)(nil).UseLogger), logger) +} + +// UseMetrics mocks base method. +func (m *Mockprovider) UseMetrics(metrics any) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "UseMetrics", metrics) +} + +// UseMetrics indicates an expected call of UseMetrics. +func (mr *MockproviderMockRecorder) UseMetrics(metrics any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UseMetrics", reflect.TypeOf((*Mockprovider)(nil).UseMetrics), metrics) +} diff --git a/pkg/gofr/datasource/cassandra.go b/pkg/gofr/datasource/cassandra.go deleted file mode 100644 index cbca9aa23..000000000 --- a/pkg/gofr/datasource/cassandra.go +++ /dev/null @@ -1,75 +0,0 @@ -package datasource - -type Cassandra interface { - // Query executes the query and binds the result into dest parameter. - // Returns error if any error occurs while binding the result. - // Can be used to single as well as multiple rows. - // Accepts pointer to struct or slice as dest parameter for single and multiple rows retrieval respectively. - // - // Example: - // - // // Get multiple rows with only one column - // ids := make([]int, 0) - // err := c.Query(&ids, "SELECT id FROM users") - // - // // Get a single object from database - // type user struct { - // ID int - // Name string - // } - // u := user{} - // err := c.Query(&u, "SELECT * FROM users WHERE id=?", 1) - // - // // Get array of objects from multiple rows - // type user struct { - // ID int - // Name string `db:"name"` - // } - // users := []user{} - // err := c.Query(&users, "SELECT * FROM users") - Query(dest interface{}, stmt string, values ...interface{}) error - - // Exec executes the query without returning any rows. - // Return error if any error occurs while executing the query. - // Can be used to execute UPDATE or INSERT. - // - // Example: - // - // // Without values - // err := c.Exec("INSERT INTO users VALUES(1, 'John Doe')") - // - // // With Values - // id := 1 - // name := "John Doe" - // err := c.Exec("INSERT INTO users VALUES(?, ?)", id, name) - Exec(stmt string, values ...interface{}) error - - // ExecCAS executes a lightweight transaction (i.e. an UPDATE or INSERT statement containing an IF clause). - // If the transaction fails because the existing values did not match, the previous values will be stored in dest. - // Returns true if the query is applied otherwise false. - // Returns false and error if any error occur while executing the query. - // Accepts only pointer to struct and built-in types as the dest parameter. - // - // Example: - // - // type user struct { - // ID int - // Name string - // } - // u := user{} - // applied, err := c.ExecCAS(&ids, "INSERT INTO users VALUES(1, 'John Doe') IF NOT EXISTS") - ExecCAS(dest interface{}, stmt string, values ...interface{}) (bool, error) -} - -type CassandraProvider interface { - Cassandra - - // UseLogger sets the logger for the Cassandra client. - UseLogger(logger interface{}) - - // UseMetrics sets the metrics for the Cassandra client. - UseMetrics(metrics interface{}) - - // Connect establishes a connection to Cassandra and registers metrics using the provided configuration when the client was Created. - Connect() -} diff --git a/pkg/gofr/datasource/clickhouse.go b/pkg/gofr/datasource/clickhouse.go deleted file mode 100644 index 51e6d8c02..000000000 --- a/pkg/gofr/datasource/clickhouse.go +++ /dev/null @@ -1,22 +0,0 @@ -package datasource - -import "context" - -type Clickhouse interface { - Exec(ctx context.Context, query string, args ...any) error - Select(ctx context.Context, dest any, query string, args ...any) error - AsyncInsert(ctx context.Context, query string, wait bool, args ...any) error -} - -type ClickhouseProvider interface { - Clickhouse - - // UseLogger sets the logger for the Clickhouse client. - UseLogger(logger interface{}) - - // UseMetrics sets the metrics for the Clickhouse client. - UseMetrics(metrics interface{}) - - // Connect establishes a connection to Clickhouse and registers metrics using the provided configuration when the client was Created. - Connect() -} diff --git a/pkg/gofr/datasource/mongo.go b/pkg/gofr/datasource/mongo.go deleted file mode 100644 index 7948a05f8..000000000 --- a/pkg/gofr/datasource/mongo.go +++ /dev/null @@ -1,67 +0,0 @@ -package datasource - -import ( - "context" -) - -// Mongo is an interface representing a MongoDB database client with common CRUD operations. -type Mongo interface { - // Find executes a query to find documents in a collection based on a filter and stores the results - // into the provided results interface. - Find(ctx context.Context, collection string, filter interface{}, results interface{}) error - - // FindOne executes a query to find a single document in a collection based on a filter and stores the result - // into the provided result interface. - FindOne(ctx context.Context, collection string, filter interface{}, result interface{}) error - - // InsertOne inserts a single document into a collection. - // It returns the identifier of the inserted document and an error, if any. - InsertOne(ctx context.Context, collection string, document interface{}) (interface{}, error) - - // InsertMany inserts multiple documents into a collection. - // It returns the identifiers of the inserted documents and an error, if any. - InsertMany(ctx context.Context, collection string, documents []interface{}) ([]interface{}, error) - - // DeleteOne deletes a single document from a collection based on a filter. - // It returns the number of documents deleted and an error, if any. - DeleteOne(ctx context.Context, collection string, filter interface{}) (int64, error) - - // DeleteMany deletes multiple documents from a collection based on a filter. - // It returns the number of documents deleted and an error, if any. - DeleteMany(ctx context.Context, collection string, filter interface{}) (int64, error) - - // UpdateByID updates a document in a collection by its ID. - // It returns the number of documents updated and an error if any. - UpdateByID(ctx context.Context, collection string, id interface{}, update interface{}) (int64, error) - - // UpdateOne updates a single document in a collection based on a filter. - // It returns an error if any. - UpdateOne(ctx context.Context, collection string, filter interface{}, update interface{}) error - - // UpdateMany updates multiple documents in a collection based on a filter. - // It returns the number of documents updated and an error if any. - UpdateMany(ctx context.Context, collection string, filter interface{}, update interface{}) (int64, error) - - // CountDocuments counts the number of documents in a collection based on a filter. - // It returns the count and an error if any. - CountDocuments(ctx context.Context, collection string, filter interface{}) (int64, error) - - // Drop an entire collection from the database. - // It returns an error if any. - Drop(ctx context.Context, collection string) error -} - -// MongoProvider is an interface that extends Mongo with additional methods for logging, metrics, and connection management. -// Which is used for initializing datasource. -type MongoProvider interface { - Mongo - - // UseLogger sets the logger for the MongoDB client. - UseLogger(logger interface{}) - - // UseMetrics sets the metrics for the MongoDB client. - UseMetrics(metrics interface{}) - - // Connect establishes a connection to MongoDB and registers metrics using the provided configuration when the client was Created. - Connect() -} diff --git a/pkg/gofr/externalDB.go b/pkg/gofr/externalDB.go index 3fb91d4b1..e12b78c80 100644 --- a/pkg/gofr/externalDB.go +++ b/pkg/gofr/externalDB.go @@ -1,8 +1,10 @@ package gofr -import "gofr.dev/pkg/gofr/datasource" +import ( + "gofr.dev/pkg/gofr/container" +) -func (a *App) AddMongo(db datasource.MongoProvider) { +func (a *App) AddMongo(db container.MongoProvider) { db.UseLogger(a.Logger()) db.UseMetrics(a.Metrics()) @@ -13,7 +15,7 @@ func (a *App) AddMongo(db datasource.MongoProvider) { // AddClickhouse initializes the clickhouse client. // Official implementation is available in the package : gofr.dev/pkg/gofr/datasource/clickhouse . -func (a *App) AddClickhouse(db datasource.ClickhouseProvider) { +func (a *App) AddClickhouse(db container.ClickhouseProvider) { db.UseLogger(a.Logger()) db.UseMetrics(a.Metrics()) @@ -24,12 +26,12 @@ func (a *App) AddClickhouse(db datasource.ClickhouseProvider) { // UseMongo sets the Mongo datasource in the app's container. // Deprecated: Use the NewMongo function AddMongo instead. -func (a *App) UseMongo(db datasource.Mongo) { +func (a *App) UseMongo(db container.Mongo) { a.container.Mongo = db } // AddCassandra sets the Cassandra datasource in the app's container. -func (a *App) AddCassandra(db datasource.CassandraProvider) { +func (a *App) AddCassandra(db container.CassandraProvider) { db.UseLogger(a.Logger()) db.UseMetrics(a.Metrics()) From e740b8d2ed32e0a882e23f9b5d2999f9d11bbb48 Mon Sep 17 00:00:00 2001 From: Vipul Rawat Date: Wed, 26 Jun 2024 12:40:30 +0530 Subject: [PATCH 07/17] add check for updating metrics for error case in service calls (#761) Co-authored-by: Srijan Rastogi <44723623+srijan-27@users.noreply.github.com> --- .../remotelogger/dynamicLevelLogger_test.go | 41 ++++++++++++++++++- pkg/gofr/service/new.go | 16 ++++---- 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/pkg/gofr/logging/remotelogger/dynamicLevelLogger_test.go b/pkg/gofr/logging/remotelogger/dynamicLevelLogger_test.go index 65e71a10c..e0ab84456 100644 --- a/pkg/gofr/logging/remotelogger/dynamicLevelLogger_test.go +++ b/pkg/gofr/logging/remotelogger/dynamicLevelLogger_test.go @@ -16,6 +16,43 @@ import ( "gofr.dev/pkg/gofr/testutil" ) +func TestRemoteLogger_UpdateLevel(t *testing.T) { + mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "application/json") + + body := `{"data":[{"serviceName":"test-service","logLevel":{"LOG_LEVEL":"DEBUG"}}]}` + _, _ = w.Write([]byte(body)) + })) + + rl := remoteLogger{ + remoteURL: mockServer.URL, + levelFetchInterval: 1, + currentLevel: 2, + Logger: logging.NewMockLogger(logging.INFO), + } + + go rl.UpdateLogLevel() + + time.Sleep(2 * time.Second) + + assert.Equal(t, logging.DEBUG, rl.currentLevel) +} + +func TestRemoteLogger_UpdateLevelError(t *testing.T) { + rl := remoteLogger{ + remoteURL: "invalid url", + levelFetchInterval: 1, + currentLevel: 2, + Logger: logging.NewMockLogger(logging.INFO), + } + + go rl.UpdateLogLevel() + + time.Sleep(2 * time.Second) + + assert.Equal(t, logging.INFO, rl.currentLevel) +} + func Test_fetchAndUpdateLogLevel_ErrorCases(t *testing.T) { logger := logging.NewMockLogger(logging.INFO) @@ -76,13 +113,13 @@ func TestDynamicLoggerSuccess(t *testing.T) { log := testutil.StdoutOutputForFunc(func() { // Create a new remote logger with the mock server URL - remoteLogger := New(logging.INFO, mockServer.URL, "1") + rl := New(logging.INFO, mockServer.URL, "1") // Wait for the remote logger to update the log level time.Sleep(2 * time.Second) // Check if the log level has been updated - remoteLogger.Debug("Debug log after log level change") + rl.Debug("Debug log after log level change") }) if !strings.Contains(log, "LOG_LEVEL updated from INFO to DEBUG") { diff --git a/pkg/gofr/service/new.go b/pkg/gofr/service/new.go index df5013b2d..a9ada5bb5 100644 --- a/pkg/gofr/service/new.go +++ b/pkg/gofr/service/new.go @@ -170,23 +170,18 @@ func (h *httpService) createAndSendRequest(ctx context.Context, method string, p respTime := time.Since(requestStart) - if h.Metrics != nil && resp != nil { - h.RecordHistogram(ctx, "app_http_service_response", respTime.Seconds(), "path", h.url, "method", method, - "status", fmt.Sprintf("%v", resp.StatusCode)) - } - log.ResponseTime = respTime.Milliseconds() if err != nil { log.ResponseCode = http.StatusInternalServerError h.Log(&ErrorLog{Log: log, ErrorMessage: err.Error()}) - h.RecordHistogram(ctx, "app_http_service_response", respTime.Seconds(), "path", h.url, "method", method, - "status", fmt.Sprintf("%v", http.StatusInternalServerError)) + h.updateMetrics(ctx, method, respTime.Seconds(), http.StatusInternalServerError) return resp, err } + h.updateMetrics(ctx, method, respTime.Seconds(), resp.StatusCode) log.ResponseCode = resp.StatusCode h.Log(log) @@ -194,6 +189,13 @@ func (h *httpService) createAndSendRequest(ctx context.Context, method string, p return resp, nil } +func (h *httpService) updateMetrics(ctx context.Context, method string, timeTaken float64, statusCode int) { + if h.Metrics != nil { + h.RecordHistogram(ctx, "app_http_service_response", timeTaken, "path", h.url, "method", method, + "status", fmt.Sprintf("%v", statusCode)) + } +} + func encodeQueryParameters(req *http.Request, queryParams map[string]interface{}) { q := req.URL.Query() From 09e218d24e079ef5c24dafac1167f6e046929872 Mon Sep 17 00:00:00 2001 From: Aryan Mehrotra <44036979+aryanmehrotra@users.noreply.github.com> Date: Wed, 26 Jun 2024 15:36:29 +0530 Subject: [PATCH 08/17] Update workflow to consolidate commands (#762) --- .github/workflows/go.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 58d6e8d95..0febf9a12 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -113,10 +113,8 @@ jobs: - name: Test run: | export APP_ENV=test - go test gofr.dev/pkg/... -tags migration -v -short -coverprofile package.cov -coverpkg=gofr.dev/pkg/... - grep -v 'gofr.dev/pkg/gofr/migration/mock_datasources.go' package.cov > packageWithoutMockMigrationDatasource.cov - grep -v 'gofr.dev/pkg/gofr/container/mock_datasources.go' packageWithoutMockMigrationDatasource.cov > packageWithoutMockDatasource.cov - grep -v 'google/mock_interfaces\.go' packageWithoutMockDatasource.cov > profile.cov + go test gofr.dev/pkg/... -v -short -coverprofile package.cov -coverpkg=gofr.dev/pkg/... + grep -v '/mock_' package.cov > profile.cov go tool cover -func profile.cov - name: Upload Test Coverage From 627d354835478dbb5c3b7d0b1bd57727381d4843 Mon Sep 17 00:00:00 2001 From: Srijan Rastogi <44723623+srijan-27@users.noreply.github.com> Date: Wed, 26 Jun 2024 17:16:04 +0530 Subject: [PATCH 09/17] Update go version to v1.22 (#741) --- .github/workflows/go.yml | 8 +- Dockerfile | 4 +- docs/quick-start/introduction/page.md | 2 +- examples/http-server-using-redis/Dockerfile | 4 +- examples/http-server/Dockerfile | 4 +- examples/using-add-rest-handlers/Dockerfile | 2 +- examples/using-cron-jobs/go.mod | 104 ++++- examples/using-cron-jobs/go.sum | 449 +++++++++++++++++++- examples/using-custom-metrics/Dockerfile | 4 +- examples/using-file-bind/Dockerfile | 4 +- examples/using-http-service/Dockerfile | 4 +- examples/using-migrations/Dockerfile | 4 +- examples/using-publisher/Dockerfile | 4 +- examples/using-subscriber/Dockerfile | 4 +- examples/using-web-socket/go.mod | 74 ++-- examples/using-web-socket/go.sum | 75 ++-- go.mod | 79 ++-- go.sum | 175 ++++---- pkg/gofr/datasource/cassandra/go.mod | 7 +- pkg/gofr/datasource/cassandra/go.sum | 10 +- pkg/gofr/datasource/clickhouse/go.mod | 8 +- pkg/gofr/datasource/clickhouse/go.sum | 12 +- pkg/gofr/datasource/mongo/go.mod | 4 +- pkg/gofr/datasource/mongo/go.sum | 4 +- 24 files changed, 805 insertions(+), 244 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0febf9a12..704a95c5a 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: ['1.21', '1.20'] + go-version: ['1.22', '1.21'] services: kafka: @@ -81,7 +81,7 @@ jobs: go tool cover -func profile.cov - name: Upload Test Coverage - if: ${{ matrix.go-version == '1.21'}} + if: ${{ matrix.go-version == '1.22'}} uses: actions/upload-artifact@v3 with: name: Example-Test-Report @@ -92,7 +92,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: ['1.21', '1.20'] + go-version: ['1.22', '1.21'] steps: - name: Checkout code into go module directory @@ -118,7 +118,7 @@ jobs: go tool cover -func profile.cov - name: Upload Test Coverage - if: ${{ matrix.go-version == '1.21'}} + if: ${{ matrix.go-version == '1.22'}} uses: actions/upload-artifact@v3 with: name: PKG-Coverage-Report diff --git a/Dockerfile b/Dockerfile index dae41c460..a905f055b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21 +FROM golang:1.22 RUN mkdir -p /go/src/gofr.dev WORKDIR /go/src/gofr.dev @@ -10,4 +10,4 @@ FROM alpine:latest RUN apk add --no-cache tzdata ca-certificates COPY --from=0 /go/src/gofr.dev/main /main EXPOSE 8000 -CMD ["/main"] \ No newline at end of file +CMD ["/main"] diff --git a/docs/quick-start/introduction/page.md b/docs/quick-start/introduction/page.md index 52e9aa807..af874704e 100644 --- a/docs/quick-start/introduction/page.md +++ b/docs/quick-start/introduction/page.md @@ -1,6 +1,6 @@ # Prerequisite -- Go 1.20 or above. +- Go 1.21 or above. To check Go version use the following command `go version`. - Prior familiarity with Golang syntax is essential. {% new-tab-link title="Golang Tour" href="https://tour.golang.org/" /%} is highly recommended as it has an excellent guided tour. diff --git a/examples/http-server-using-redis/Dockerfile b/examples/http-server-using-redis/Dockerfile index abf460942..b7fb63d33 100644 --- a/examples/http-server-using-redis/Dockerfile +++ b/examples/http-server-using-redis/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21 +FROM golang:1.22 RUN mkdir /src/ WORKDIR /src/ @@ -12,4 +12,4 @@ COPY --from=0 /src/main /main COPY --from=0 /src/configs /configs EXPOSE 8000 -CMD ["/main"] \ No newline at end of file +CMD ["/main"] diff --git a/examples/http-server/Dockerfile b/examples/http-server/Dockerfile index d9fcc6999..7bf8597bb 100644 --- a/examples/http-server/Dockerfile +++ b/examples/http-server/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21 +FROM golang:1.22 RUN mkdir /src/ WORKDIR /src/ @@ -12,4 +12,4 @@ COPY --from=0 /src/main /main COPY --from=0 /src/configs /configs EXPOSE 9000 -CMD ["/main"] \ No newline at end of file +CMD ["/main"] diff --git a/examples/using-add-rest-handlers/Dockerfile b/examples/using-add-rest-handlers/Dockerfile index 102767b84..9d6083214 100644 --- a/examples/using-add-rest-handlers/Dockerfile +++ b/examples/using-add-rest-handlers/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21 +FROM golang:1.22 RUN mkdir /src/ WORKDIR /src/ diff --git a/examples/using-cron-jobs/go.mod b/examples/using-cron-jobs/go.mod index 2e9028d51..5578b2e70 100644 --- a/examples/using-cron-jobs/go.mod +++ b/examples/using-cron-jobs/go.mod @@ -1,9 +1,105 @@ module github.com/gofr-dev/gofr/examples/using-cron-jobs -go 1.21 +go 1.22 -replace ( - gofr.dev v1.5.0 => ../../../gofr +replace gofr.dev v1.5.0 => ../../../gofr + +require ( + github.com/stretchr/testify v1.9.0 + gofr.dev v1.5.0 ) -require gofr.dev v1.5.0 // indirect +require ( + cloud.google.com/go v0.115.0 // indirect + cloud.google.com/go/auth v0.5.1 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // indirect + cloud.google.com/go/iam v1.1.8 // indirect + cloud.google.com/go/pubsub v1.39.0 // indirect + filippo.io/edwards25519 v1.1.0 // indirect + github.com/DATA-DOG/go-sqlmock v1.5.2 // indirect + github.com/XSAM/otelsql v0.31.0 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/eclipse/paho.mqtt.golang v1.4.3 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-sql-driver/mysql v1.8.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/s2a-go v0.1.7 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect + github.com/googleapis/gax-go/v2 v2.12.4 // indirect + github.com/gorilla/mux v1.8.1 // indirect + github.com/gorilla/websocket v1.5.3 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect + github.com/joho/godotenv v1.5.1 // indirect + github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect + github.com/klauspost/compress v1.17.8 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/openzipkin/zipkin-go v0.4.3 // indirect + github.com/pierrec/lz4/v4 v4.1.21 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.19.1 // 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/redis/go-redis/extra/rediscmd/v9 v9.5.3 // indirect + github.com/redis/go-redis/extra/redisotel/v9 v9.5.3 // indirect + github.com/redis/go-redis/v9 v9.5.3 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + github.com/segmentio/kafka-go v0.4.47 // indirect + go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.52.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect + go.opentelemetry.io/otel v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect + go.opentelemetry.io/otel/exporters/zipkin v1.27.0 // indirect + go.opentelemetry.io/otel/metric v1.27.0 // indirect + go.opentelemetry.io/otel/sdk v1.27.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.27.0 // indirect + go.opentelemetry.io/otel/trace v1.27.0 // indirect + go.opentelemetry.io/proto/otlp v1.2.0 // indirect + go.uber.org/mock v0.4.0 // indirect + golang.org/x/crypto v0.24.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/term v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + golang.org/x/time v0.5.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect + google.golang.org/api v0.185.0 // indirect + google.golang.org/genproto v0.0.0-20240617180043-68d350f18fd4 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // indirect + google.golang.org/grpc v1.64.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + lukechampine.com/uint128 v1.2.0 // indirect + modernc.org/cc/v3 v3.41.0 // indirect + modernc.org/ccgo/v3 v3.17.0 // indirect + modernc.org/libc v1.52.1 // indirect + modernc.org/mathutil v1.6.0 // indirect + modernc.org/memory v1.8.0 // indirect + modernc.org/opt v0.1.3 // indirect + modernc.org/sqlite v1.30.1 // indirect + modernc.org/strutil v1.2.0 // indirect + modernc.org/token v1.1.0 // indirect +) diff --git a/examples/using-cron-jobs/go.sum b/examples/using-cron-jobs/go.sum index 02241df7a..c25a2dcf3 100644 --- a/examples/using-cron-jobs/go.sum +++ b/examples/using-cron-jobs/go.sum @@ -1,2 +1,447 @@ -gofr.dev v1.5.0 h1:8p/XsoReK9vQ+Isfx7Rt861ypfQf8D1MxLW3ZSGh5SA= -gofr.dev v1.5.0/go.mod h1:Z+6G0zBPt0dmiODnM+D/VJBPpPsPHQZOBIvwpgK23tw= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.114.0 h1:OIPFAdfrFDFO2ve2U7r/H5SwSbBzEdrBdE7xkgwc+kY= +cloud.google.com/go v0.114.0/go.mod h1:ZV9La5YYxctro1HTPug5lXH/GefROyW8PPD4T8n9J8E= +cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= +cloud.google.com/go/auth v0.5.1 h1:0QNO7VThG54LUzKiQxv8C6x1YX7lUrzlAa1nVLF8CIw= +cloud.google.com/go/auth v0.5.1/go.mod h1:vbZT8GjzDf3AVqCcQmqeeM32U9HBFc32vVVAbwDsa6s= +cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= +cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/iam v1.1.8 h1:r7umDwhj+BQyz0ScZMp4QrGXjSTI3ZINnpgU2nlB/K0= +cloud.google.com/go/iam v1.1.8/go.mod h1:GvE6lyMmfxXauzNq8NbgJbeVQNspG+tcdL/W8QO1+zE= +cloud.google.com/go/kms v1.17.1 h1:5k0wXqkxL+YcXd4viQzTqCgzzVKKxzgrK+rCZJytEQs= +cloud.google.com/go/kms v1.17.1/go.mod h1:DCMnCF/apA6fZk5Cj4XsD979OyHAqFasPuA5Sd0kGlQ= +cloud.google.com/go/longrunning v0.5.7 h1:WLbHekDbjK1fVFD3ibpFFVoyizlLRl73I7YKuAKilhU= +cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodEMwEAztp38Xng= +cloud.google.com/go/pubsub v1.38.0 h1:J1OT7h51ifATIedjqk/uBNPh+1hkvUaH4VKbz4UuAsc= +cloud.google.com/go/pubsub v1.38.0/go.mod h1:IPMJSWSus/cu57UyR01Jqa/bNOQA+XnPF6Z4dKW4fAA= +cloud.google.com/go/pubsub v1.39.0/go.mod h1:FrEnrSGU6L0Kh3iBaAbIUM8KMR7LqyEkMboVxGXCT+s= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +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/XSAM/otelsql v0.29.0 h1:pEw9YXXs8ZrGRYfDc0cmArIz9lci5b42gmP5+tA1Huc= +github.com/XSAM/otelsql v0.29.0/go.mod h1:d3/0xGIGC5RVEE+Ld7KotwaLy6zDeaF3fLJHOPpdN2w= +github.com/XSAM/otelsql v0.31.0/go.mod h1:iCkLyB/me+QC4yjymXjLimJiX0oklymiKeGxeGDTW24= +github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= +github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= +github.com/alicebob/miniredis/v2 v2.33.0 h1:uvTF0EDeu9RLnUEG27Db5I68ESoIxTiXbNUiji6lZrA= +github.com/alicebob/miniredis/v2 v2.33.0/go.mod h1:MhP4a3EU7aENRi9aO+tHfTBZicLqQevyi/DJpoj6mi0= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bsm/ginkgo/v2 v2.7.0/go.mod h1:AiKlXPm7ItEHNc/2+OkrNG4E0ITzojb9/xWzvQ9XZ9w= +github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= +github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= +github.com/bsm/gomega v1.26.0/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= +github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +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/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +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/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/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/eclipse/paho.mqtt.golang v1.4.3 h1:2kwcUGn8seMUfWndX0hGbvH8r7crgcJguQNCyp70xik= +github.com/eclipse/paho.mqtt.golang v1.4.3/go.mod h1:CSYvoAlsMkhYOXh/oKyxa8EcBci6dVkLCbo5tTC1RIE= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= +github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +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= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= +github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= +github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= +github.com/googleapis/gax-go/v2 v2.12.4 h1:9gWcmF85Wvq4ryPFvGFaOgPIs1AQX0d0bcbGw4Z96qg= +github.com/googleapis/gax-go/v2 v2.12.4/go.mod h1:KYEYLorsnIGDi/rPC8b5TdlB9kbKoFubselGIoBMCwI= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kisielk/sqlstruct v0.0.0-20201105191214-5f3e10d3ab46/go.mod h1:yyMNCyc/Ib3bDTKd379tNMpB/7/H5TjM2Y9QJ5THLbE= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= +github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +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/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +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.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= +github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin/zipkin-go v0.4.2 h1:zjqfqHjUpPmB3c1GlCvvgsM1G4LkvqQbBDueDOCg/jA= +github.com/openzipkin/zipkin-go v0.4.2/go.mod h1:ZeVkFjuuBiSy13y8vpSDCjMi9GoI3hPpCJSBx/EYFhY= +github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.17 h1:kV4Ip+/hUBC+8T6+2EgburRtkE9ef4nbY3f4dFhGjMc= +github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pkg/errors v0.8.1/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.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= +github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +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/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= +github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 h1:EaDatTxkdHG+U3Bk4EUr+DZ7fOGwTfezUiUJMaIcaho= +github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5/go.mod h1:fyalQWdtzDBECAQFBJuQe5bzQ02jGd5Qcbgb97Flm7U= +github.com/redis/go-redis/extra/rediscmd/v9 v9.5.3/go.mod h1:3dZmcLn3Qw6FLlWASn1g4y+YO9ycEFUOM+bhBmzLVKQ= +github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 h1:EfpWLLCyXw8PSM2/XNJLjI3Pb27yVE+gIAfeqp8LUCc= +github.com/redis/go-redis/extra/redisotel/v9 v9.0.5/go.mod h1:WZjPDy7VNzn77AAfnAfVjZNvfJTYfPetfZk5yoSTLaQ= +github.com/redis/go-redis/extra/redisotel/v9 v9.5.3/go.mod h1:7f/FMrf5RRRVHXgfk7CzSVzXHiWeuOQUu2bsVqWoa+g= +github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= +github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= +github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/redis/go-redis/v9 v9.5.3/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/segmentio/kafka-go v0.4.47 h1:IqziR4pA3vrZq7YdRxaT3w1/5fvIH5qpCwstUanQQB0= +github.com/segmentio/kafka-go v0.4.47/go.mod h1:HjF6XbOKh0Pjlkr5GVZxt6CsjjwnmhVOfURM5KMd8qg= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +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= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +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/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= +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= +github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= +github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= +go.einride.tech/aip v0.67.1 h1:d/4TW92OxXBngkSOwWS2CH5rez869KpKMaN44mdxkFI= +go.einride.tech/aip v0.67.1/go.mod h1:ZGX4/zKw8dcgzdLsrvpOOGxfxI2QSk12SlP7d6c0/XI= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.49.0 h1:RtcvQ4iw3w9NBB5yRwgA4sSa82rfId7n4atVpvKx3bY= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.49.0/go.mod h1:f/PbKbRd4cdUICWell6DmzvVJ7QrmBgFrRHjXmAXbK4= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.52.0/go.mod h1:l/UzmhdRx9YP37NI/nSr7l1bgG0dZnGfZf6C7TiV4jI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0/go.mod h1:XLZfZboOJWHNKUv7eH0inh0E9VV6eWDFB/9yJyTLPp0= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0/go.mod h1:OQFyQVrDlbe+R7xrEyDr/2Wr67Ol0hRUgsfA+V5A95s= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= +go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ= +go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs= +go.opentelemetry.io/otel/exporters/prometheus v0.49.0/go.mod h1:KfQ1wpjf3zsHjzP149P4LyAwWRupc6c7t1ZJ9eXpKQM= +go.opentelemetry.io/otel/exporters/zipkin v1.24.0 h1:3evrL5poBuh1KF51D9gO/S+N/1msnm4DaBqs/rpXUqY= +go.opentelemetry.io/otel/exporters/zipkin v1.24.0/go.mod h1:0EHgD8R0+8yRhUYJOGR8Hfg2dpiJQxDOszd5smVO9wM= +go.opentelemetry.io/otel/exporters/zipkin v1.27.0/go.mod h1:+WMURoi4KmVB7ypbFPx3xtZTWen2Ca3lRK9u6DVTO5M= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= +go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= +go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= +go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= +go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8= +go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0= +go.opentelemetry.io/otel/sdk/metric v1.27.0/go.mod h1:we7jJVrYN2kh3mVBlswtPU22K0SA+769l93J6bsyvqw= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= +go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= +go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= +go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +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-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +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.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-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +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= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +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.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/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= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/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= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/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-20211025201205-69cdffdb9359/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.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +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.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +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.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.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +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= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/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.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/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/api v0.184.0 h1:dmEdk6ZkJNXy1JcDhn/ou0ZUq7n9zropG2/tR4z+RDg= +google.golang.org/api v0.184.0/go.mod h1:CeDTtUEiYENAf8PPG5VZW2yNp2VM3VWbCeTioAZBTBA= +google.golang.org/api v0.185.0/go.mod h1:HNfvIkJGlgrIlrbYkAm9W9IdkmKZjOTVh33YltygGbg= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20240604185151-ef581f913117 h1:HCZ6DlkKtCDAtD8ForECsY3tKuaR+p4R3grlK80uCCc= +google.golang.org/genproto v0.0.0-20240604185151-ef581f913117/go.mod h1:lesfX/+9iA+3OdqeCpoDddJaNxVB1AB6tD7EfqMmprc= +google.golang.org/genproto v0.0.0-20240617180043-68d350f18fd4/go.mod h1:EvuUDCulqGgV80RvP1BHuom+smhX4qtlhnNatHuroGQ= +google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw= +google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU= +google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3/go.mod h1:kdrSS/OiLkPrNUpzD4aHgCq2rVuC/YRxok32HXZ4vRE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +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= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +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/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +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= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= +modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= +modernc.org/cc/v3 v3.41.0/go.mod h1:Ni4zjJYJ04CDOhG7dn640WGfwBzfE0ecX8TyMB0Fv0Y= +modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= +modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= +modernc.org/ccgo/v3 v3.17.0/go.mod h1:Sg3fwVpmLvCUTaqEUjiBDAvshIaKDB0RXaf+zgqFu8I= +modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v1.22.5 h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE= +modernc.org/libc v1.22.5/go.mod h1:jj+Z7dTNX8fBScMVNRAYZ/jF91K8fdT2hYMThc3YjBY= +modernc.org/libc v1.52.1/go.mod h1:HR4nVzFDSDizP620zcMCgjb1/8xk2lg5p/8yjfGv1IQ= +modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= +modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= +modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.22.1 h1:P2+Dhp5FR1RlVRkQ3dDfCiv3Ok8XPxqpe70IjYVA9oE= +modernc.org/sqlite v1.22.1/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk= +modernc.org/sqlite v1.30.1/go.mod h1:DUmsiWQDaAvU4abhc/N+djlom/L2o8f7gZ95RCvyoLU= +modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= +modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= +modernc.org/tcl v1.15.2/go.mod h1:3+k/ZaEbKrC8ePv8zJWPtBSW0V7Gg9g8rkmhI1Kfs3c= +modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= +modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= +modernc.org/z v1.7.3/go.mod h1:Ipv4tsdxZRbQyLq9Q1M6gdbkxYzdlrciF2Hi/lS7nWE= diff --git a/examples/using-custom-metrics/Dockerfile b/examples/using-custom-metrics/Dockerfile index 3f359a90a..1b91bef0e 100644 --- a/examples/using-custom-metrics/Dockerfile +++ b/examples/using-custom-metrics/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21 +FROM golang:1.22 RUN mkdir /src/ WORKDIR /src/ @@ -12,4 +12,4 @@ COPY --from=0 /src/main /main COPY --from=0 /src/configs /configs EXPOSE 9011 -CMD ["/main"] \ No newline at end of file +CMD ["/main"] diff --git a/examples/using-file-bind/Dockerfile b/examples/using-file-bind/Dockerfile index 9bdc5e342..41ae2e17b 100644 --- a/examples/using-file-bind/Dockerfile +++ b/examples/using-file-bind/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21 +FROM golang:1.22 RUN mkdir /src/ WORKDIR /src/ @@ -12,4 +12,4 @@ COPY --from=0 /src/main /main COPY --from=0 /src/configs /configs EXPOSE 8300 -CMD ["/main"] \ No newline at end of file +CMD ["/main"] diff --git a/examples/using-http-service/Dockerfile b/examples/using-http-service/Dockerfile index eb1e6925a..f3f670a5b 100644 --- a/examples/using-http-service/Dockerfile +++ b/examples/using-http-service/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21 +FROM golang:1.22 RUN mkdir /src/ WORKDIR /src/ @@ -12,4 +12,4 @@ COPY --from=0 /src/main /main COPY --from=0 /src/configs /configs EXPOSE 9001 -CMD ["/main"] \ No newline at end of file +CMD ["/main"] diff --git a/examples/using-migrations/Dockerfile b/examples/using-migrations/Dockerfile index 6f3a01751..0c5fb83b9 100644 --- a/examples/using-migrations/Dockerfile +++ b/examples/using-migrations/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21 +FROM golang:1.22 RUN mkdir /src/ WORKDIR /src/ @@ -12,4 +12,4 @@ COPY --from=0 /src/main /main COPY --from=0 /src/configs /configs EXPOSE 9100 -CMD ["/main"] \ No newline at end of file +CMD ["/main"] diff --git a/examples/using-publisher/Dockerfile b/examples/using-publisher/Dockerfile index 750720e64..4e564035b 100644 --- a/examples/using-publisher/Dockerfile +++ b/examples/using-publisher/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21 +FROM golang:1.22 RUN mkdir /src/ WORKDIR /src/ @@ -12,4 +12,4 @@ COPY --from=0 /src/main /main COPY --from=0 /src/configs /configs EXPOSE 8100 -CMD ["/main"] \ No newline at end of file +CMD ["/main"] diff --git a/examples/using-subscriber/Dockerfile b/examples/using-subscriber/Dockerfile index 0b4b58223..80c931dfd 100644 --- a/examples/using-subscriber/Dockerfile +++ b/examples/using-subscriber/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21 +FROM golang:1.22 RUN mkdir /src/ WORKDIR /src/ @@ -12,4 +12,4 @@ COPY --from=0 /src/main /main COPY --from=0 /src/configs /configs EXPOSE 8200 -CMD ["/main"] \ No newline at end of file +CMD ["/main"] diff --git a/examples/using-web-socket/go.mod b/examples/using-web-socket/go.mod index 61ba3eeed..1fa657d0e 100644 --- a/examples/using-web-socket/go.mod +++ b/examples/using-web-socket/go.mod @@ -1,6 +1,6 @@ module github.com/gofr-dev/gofr/examples/using-web-socket -go 1.22.3 +go 1.22 require ( github.com/gorilla/websocket v1.5.3 @@ -11,15 +11,15 @@ require ( replace gofr.dev v1.8.1 => ../../../gofr require ( - cloud.google.com/go v0.114.0 // indirect + cloud.google.com/go v0.115.0 // indirect cloud.google.com/go/auth v0.5.1 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect cloud.google.com/go/compute/metadata v0.3.0 // indirect cloud.google.com/go/iam v1.1.8 // indirect - cloud.google.com/go/pubsub v1.38.0 // indirect + cloud.google.com/go/pubsub v1.39.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/DATA-DOG/go-sqlmock v1.5.2 // indirect - github.com/XSAM/otelsql v0.29.0 // indirect + github.com/XSAM/otelsql v0.31.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -41,39 +41,39 @@ require ( github.com/googleapis/gax-go/v2 v2.12.4 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect github.com/joho/godotenv v1.5.1 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/klauspost/compress v1.17.8 // indirect github.com/lib/pq v1.10.9 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/openzipkin/zipkin-go v0.4.2 // indirect - github.com/pierrec/lz4/v4 v4.1.17 // indirect + github.com/openzipkin/zipkin-go v0.4.3 // indirect + github.com/pierrec/lz4/v4 v4.1.21 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.48.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect - github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 // indirect - github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 // indirect - github.com/redis/go-redis/v9 v9.5.1 // 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/redis/go-redis/extra/rediscmd/v9 v9.5.3 // indirect + github.com/redis/go-redis/extra/redisotel/v9 v9.5.3 // indirect + github.com/redis/go-redis/v9 v9.5.3 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/segmentio/kafka-go v0.4.47 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.49.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect - go.opentelemetry.io/otel v1.24.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect - go.opentelemetry.io/otel/exporters/zipkin v1.24.0 // indirect - go.opentelemetry.io/otel/metric v1.24.0 // indirect - go.opentelemetry.io/otel/sdk v1.24.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect - go.opentelemetry.io/otel/trace v1.24.0 // indirect - go.opentelemetry.io/proto/otlp v1.1.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.52.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect + go.opentelemetry.io/otel v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect + go.opentelemetry.io/otel/exporters/zipkin v1.27.0 // indirect + go.opentelemetry.io/otel/metric v1.27.0 // indirect + go.opentelemetry.io/otel/sdk v1.27.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.27.0 // indirect + go.opentelemetry.io/otel/trace v1.27.0 // indirect + go.opentelemetry.io/proto/otlp v1.2.0 // indirect go.uber.org/mock v0.4.0 // indirect golang.org/x/crypto v0.24.0 // indirect golang.org/x/mod v0.17.0 // indirect @@ -85,21 +85,21 @@ require ( golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - google.golang.org/api v0.184.0 // indirect - google.golang.org/genproto v0.0.0-20240604185151-ef581f913117 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/api v0.185.0 // indirect + google.golang.org/genproto v0.0.0-20240617180043-68d350f18fd4 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // indirect google.golang.org/grpc v1.64.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/uint128 v1.2.0 // indirect - modernc.org/cc/v3 v3.40.0 // indirect - modernc.org/ccgo/v3 v3.16.13 // indirect - modernc.org/libc v1.22.5 // indirect - modernc.org/mathutil v1.5.0 // indirect - modernc.org/memory v1.5.0 // indirect + modernc.org/cc/v3 v3.41.0 // indirect + modernc.org/ccgo/v3 v3.17.0 // indirect + modernc.org/libc v1.52.1 // indirect + modernc.org/mathutil v1.6.0 // indirect + modernc.org/memory v1.8.0 // indirect modernc.org/opt v0.1.3 // indirect - modernc.org/sqlite v1.22.1 // indirect - modernc.org/strutil v1.1.3 // indirect - modernc.org/token v1.0.1 // indirect + modernc.org/sqlite v1.30.1 // indirect + modernc.org/strutil v1.2.0 // indirect + modernc.org/token v1.1.0 // indirect ) diff --git a/examples/using-web-socket/go.sum b/examples/using-web-socket/go.sum index b8cd3923f..c25a2dcf3 100644 --- a/examples/using-web-socket/go.sum +++ b/examples/using-web-socket/go.sum @@ -1,6 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.114.0 h1:OIPFAdfrFDFO2ve2U7r/H5SwSbBzEdrBdE7xkgwc+kY= cloud.google.com/go v0.114.0/go.mod h1:ZV9La5YYxctro1HTPug5lXH/GefROyW8PPD4T8n9J8E= +cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= cloud.google.com/go/auth v0.5.1 h1:0QNO7VThG54LUzKiQxv8C6x1YX7lUrzlAa1nVLF8CIw= cloud.google.com/go/auth v0.5.1/go.mod h1:vbZT8GjzDf3AVqCcQmqeeM32U9HBFc32vVVAbwDsa6s= cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= @@ -15,6 +16,7 @@ cloud.google.com/go/longrunning v0.5.7 h1:WLbHekDbjK1fVFD3ibpFFVoyizlLRl73I7YKuA cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodEMwEAztp38Xng= cloud.google.com/go/pubsub v1.38.0 h1:J1OT7h51ifATIedjqk/uBNPh+1hkvUaH4VKbz4UuAsc= cloud.google.com/go/pubsub v1.38.0/go.mod h1:IPMJSWSus/cu57UyR01Jqa/bNOQA+XnPF6Z4dKW4fAA= +cloud.google.com/go/pubsub v1.39.0/go.mod h1:FrEnrSGU6L0Kh3iBaAbIUM8KMR7LqyEkMboVxGXCT+s= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -22,6 +24,7 @@ github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7Oputl github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/XSAM/otelsql v0.29.0 h1:pEw9YXXs8ZrGRYfDc0cmArIz9lci5b42gmP5+tA1Huc= github.com/XSAM/otelsql v0.29.0/go.mod h1:d3/0xGIGC5RVEE+Ld7KotwaLy6zDeaF3fLJHOPpdN2w= +github.com/XSAM/otelsql v0.31.0/go.mod h1:iCkLyB/me+QC4yjymXjLimJiX0oklymiKeGxeGDTW24= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.33.0 h1:uvTF0EDeu9RLnUEG27Db5I68ESoIxTiXbNUiji6lZrA= @@ -110,13 +113,13 @@ github.com/googleapis/gax-go/v2 v2.12.4 h1:9gWcmF85Wvq4ryPFvGFaOgPIs1AQX0d0bcbGw github.com/googleapis/gax-go/v2 v2.12.4/go.mod h1:KYEYLorsnIGDi/rPC8b5TdlB9kbKoFubselGIoBMCwI= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= @@ -144,9 +147,11 @@ github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/openzipkin/zipkin-go v0.4.2 h1:zjqfqHjUpPmB3c1GlCvvgsM1G4LkvqQbBDueDOCg/jA= github.com/openzipkin/zipkin-go v0.4.2/go.mod h1:ZeVkFjuuBiSy13y8vpSDCjMi9GoI3hPpCJSBx/EYFhY= +github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pierrec/lz4/v4 v4.1.17 h1:kV4Ip+/hUBC+8T6+2EgburRtkE9ef4nbY3f4dFhGjMc= github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.8.1/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= @@ -157,17 +162,23 @@ github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJL github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= 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/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 h1:EaDatTxkdHG+U3Bk4EUr+DZ7fOGwTfezUiUJMaIcaho= github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5/go.mod h1:fyalQWdtzDBECAQFBJuQe5bzQ02jGd5Qcbgb97Flm7U= +github.com/redis/go-redis/extra/rediscmd/v9 v9.5.3/go.mod h1:3dZmcLn3Qw6FLlWASn1g4y+YO9ycEFUOM+bhBmzLVKQ= github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 h1:EfpWLLCyXw8PSM2/XNJLjI3Pb27yVE+gIAfeqp8LUCc= github.com/redis/go-redis/extra/redisotel/v9 v9.0.5/go.mod h1:WZjPDy7VNzn77AAfnAfVjZNvfJTYfPetfZk5yoSTLaQ= +github.com/redis/go-redis/extra/redisotel/v9 v9.5.3/go.mod h1:7f/FMrf5RRRVHXgfk7CzSVzXHiWeuOQUu2bsVqWoa+g= github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/redis/go-redis/v9 v9.5.3/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= @@ -210,28 +221,40 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.4 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.49.0 h1:RtcvQ4iw3w9NBB5yRwgA4sSa82rfId7n4atVpvKx3bY= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.49.0/go.mod h1:f/PbKbRd4cdUICWell6DmzvVJ7QrmBgFrRHjXmAXbK4= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.52.0/go.mod h1:l/UzmhdRx9YP37NI/nSr7l1bgG0dZnGfZf6C7TiV4jI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0/go.mod h1:XLZfZboOJWHNKUv7eH0inh0E9VV6eWDFB/9yJyTLPp0= go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0/go.mod h1:OQFyQVrDlbe+R7xrEyDr/2Wr67Ol0hRUgsfA+V5A95s= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ= go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs= +go.opentelemetry.io/otel/exporters/prometheus v0.49.0/go.mod h1:KfQ1wpjf3zsHjzP149P4LyAwWRupc6c7t1ZJ9eXpKQM= go.opentelemetry.io/otel/exporters/zipkin v1.24.0 h1:3evrL5poBuh1KF51D9gO/S+N/1msnm4DaBqs/rpXUqY= go.opentelemetry.io/otel/exporters/zipkin v1.24.0/go.mod h1:0EHgD8R0+8yRhUYJOGR8Hfg2dpiJQxDOszd5smVO9wM= +go.opentelemetry.io/otel/exporters/zipkin v1.27.0/go.mod h1:+WMURoi4KmVB7ypbFPx3xtZTWen2Ca3lRK9u6DVTO5M= go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= +go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8= go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0= +go.opentelemetry.io/otel/sdk/metric v1.27.0/go.mod h1:we7jJVrYN2kh3mVBlswtPU22K0SA+769l93J6bsyvqw= go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= +go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -245,8 +268,7 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -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/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -257,8 +279,7 @@ 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.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +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-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -274,8 +295,7 @@ 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.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -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/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= @@ -303,16 +323,14 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= 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= @@ -321,8 +339,7 @@ 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.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= 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= @@ -337,31 +354,30 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/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.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= -golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/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/api v0.183.0 h1:PNMeRDwo1pJdgNcFQ9GstuLe/noWKIc89pRWRLMvLwE= -google.golang.org/api v0.183.0/go.mod h1:q43adC5/pHoSZTx5h2mSmdF7NcyfW9JuDyIOJAgS9ZQ= +google.golang.org/api v0.184.0 h1:dmEdk6ZkJNXy1JcDhn/ou0ZUq7n9zropG2/tR4z+RDg= google.golang.org/api v0.184.0/go.mod h1:CeDTtUEiYENAf8PPG5VZW2yNp2VM3VWbCeTioAZBTBA= +google.golang.org/api v0.185.0/go.mod h1:HNfvIkJGlgrIlrbYkAm9W9IdkmKZjOTVh33YltygGbg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20240528184218-531527333157 h1:u7WMYrIrVvs0TF5yaKwKNbcJyySYf+HAIFXxWltJOXE= -google.golang.org/genproto v0.0.0-20240528184218-531527333157/go.mod h1:ubQlAQnzejB8uZzszhrTCU2Fyp6Vi7ZE5nn0c3W8+qQ= +google.golang.org/genproto v0.0.0-20240604185151-ef581f913117 h1:HCZ6DlkKtCDAtD8ForECsY3tKuaR+p4R3grlK80uCCc= google.golang.org/genproto v0.0.0-20240604185151-ef581f913117/go.mod h1:lesfX/+9iA+3OdqeCpoDddJaNxVB1AB6tD7EfqMmprc= -google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e h1:SkdGTrROJl2jRGT/Fxv5QUf9jtdKCQh4KQJXbXVLAi0= -google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e/go.mod h1:LweJcLbyVij6rCex8YunD8DYR5VDonap/jYl3ZRxcIU= +google.golang.org/genproto v0.0.0-20240617180043-68d350f18fd4/go.mod h1:EvuUDCulqGgV80RvP1BHuom+smhX4qtlhnNatHuroGQ= +google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw= google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3/go.mod h1:kdrSS/OiLkPrNUpzD4aHgCq2rVuC/YRxok32HXZ4vRE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -379,8 +395,7 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= 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= @@ -398,27 +413,35 @@ lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= +modernc.org/cc/v3 v3.41.0/go.mod h1:Ni4zjJYJ04CDOhG7dn640WGfwBzfE0ecX8TyMB0Fv0Y= modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= +modernc.org/ccgo/v3 v3.17.0/go.mod h1:Sg3fwVpmLvCUTaqEUjiBDAvshIaKDB0RXaf+zgqFu8I= modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= modernc.org/libc v1.22.5 h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE= modernc.org/libc v1.22.5/go.mod h1:jj+Z7dTNX8fBScMVNRAYZ/jF91K8fdT2hYMThc3YjBY= +modernc.org/libc v1.52.1/go.mod h1:HR4nVzFDSDizP620zcMCgjb1/8xk2lg5p/8yjfGv1IQ= modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/sqlite v1.22.1 h1:P2+Dhp5FR1RlVRkQ3dDfCiv3Ok8XPxqpe70IjYVA9oE= modernc.org/sqlite v1.22.1/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk= +modernc.org/sqlite v1.30.1/go.mod h1:DUmsiWQDaAvU4abhc/N+djlom/L2o8f7gZ95RCvyoLU= modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= modernc.org/tcl v1.15.2/go.mod h1:3+k/ZaEbKrC8ePv8zJWPtBSW0V7Gg9g8rkmhI1Kfs3c= modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= modernc.org/z v1.7.3/go.mod h1:Ipv4tsdxZRbQyLq9Q1M6gdbkxYzdlrciF2Hi/lS7nWE= diff --git a/go.mod b/go.mod index 74776677f..de007ad2f 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,11 @@ module gofr.dev -go 1.21 +go 1.22 require ( - cloud.google.com/go/pubsub v1.38.0 + cloud.google.com/go/pubsub v1.39.0 github.com/DATA-DOG/go-sqlmock v1.5.2 - github.com/XSAM/otelsql v0.29.0 + github.com/XSAM/otelsql v0.31.0 github.com/alicebob/miniredis/v2 v2.33.0 github.com/eclipse/paho.mqtt.golang v1.4.3 github.com/go-redis/redismock/v9 v9.2.0 @@ -24,29 +24,29 @@ require ( github.com/redis/go-redis/v9 v9.5.1 github.com/segmentio/kafka-go v0.4.47 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.49.0 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 - go.opentelemetry.io/otel v1.24.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 - go.opentelemetry.io/otel/exporters/prometheus v0.46.0 - go.opentelemetry.io/otel/exporters/zipkin v1.24.0 - go.opentelemetry.io/otel/metric v1.24.0 - go.opentelemetry.io/otel/sdk v1.24.0 - go.opentelemetry.io/otel/sdk/metric v1.24.0 - go.opentelemetry.io/otel/trace v1.24.0 + go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.52.0 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 + go.opentelemetry.io/otel v1.27.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 + go.opentelemetry.io/otel/exporters/prometheus v0.49.0 + go.opentelemetry.io/otel/exporters/zipkin v1.27.0 + go.opentelemetry.io/otel/metric v1.27.0 + go.opentelemetry.io/otel/sdk v1.27.0 + go.opentelemetry.io/otel/sdk/metric v1.27.0 + go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/mock v0.4.0 golang.org/x/oauth2 v0.21.0 golang.org/x/term v0.21.0 golang.org/x/text v0.16.0 - google.golang.org/api v0.184.0 + google.golang.org/api v0.186.0 google.golang.org/grpc v1.64.0 google.golang.org/protobuf v1.34.2 - modernc.org/sqlite v1.22.1 + modernc.org/sqlite v1.30.1 ) require ( - cloud.google.com/go v0.114.0 // indirect - cloud.google.com/go/auth v0.5.1 // indirect + cloud.google.com/go v0.115.0 // indirect + cloud.google.com/go/auth v0.6.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect cloud.google.com/go/compute/metadata v0.3.0 // indirect cloud.google.com/go/iam v1.1.8 // indirect @@ -66,45 +66,40 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.4 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect - github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect + github.com/googleapis/gax-go/v2 v2.12.5 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/klauspost/compress v1.17.8 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/openzipkin/zipkin-go v0.4.2 // indirect - github.com/pierrec/lz4/v4 v4.1.17 // indirect + github.com/ncruces/go-strftime v0.1.9 // indirect + github.com/openzipkin/zipkin-go v0.4.3 // indirect + github.com/pierrec/lz4/v4 v4.1.21 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.6.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/redis/go-redis/extra/rediscmd/v9 v9.0.5 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/yuin/gopher-lua v1.1.1 // indirect go.einride.tech/aip v0.67.1 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect - go.opentelemetry.io/proto/otlp v1.1.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect + go.opentelemetry.io/proto/otlp v1.2.0 // indirect golang.org/x/crypto v0.24.0 // indirect - golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.26.0 // indirect golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.21.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - google.golang.org/genproto v0.0.0-20240604185151-ef581f913117 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/genproto v0.0.0-20240617180043-68d350f18fd4 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - lukechampine.com/uint128 v1.2.0 // indirect - modernc.org/cc/v3 v3.40.0 // indirect - modernc.org/ccgo/v3 v3.16.13 // indirect - modernc.org/libc v1.22.5 // indirect - modernc.org/mathutil v1.5.0 // indirect - modernc.org/memory v1.5.0 // indirect - modernc.org/opt v0.1.3 // indirect - modernc.org/strutil v1.1.3 // indirect - modernc.org/token v1.0.1 // indirect + modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect + modernc.org/libc v1.52.1 // indirect + modernc.org/mathutil v1.6.0 // indirect + modernc.org/memory v1.8.0 // indirect + modernc.org/strutil v1.2.0 // indirect + modernc.org/token v1.1.0 // indirect ) diff --git a/go.sum b/go.sum index 66208bb56..548f2db53 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.114.0 h1:OIPFAdfrFDFO2ve2U7r/H5SwSbBzEdrBdE7xkgwc+kY= -cloud.google.com/go v0.114.0/go.mod h1:ZV9La5YYxctro1HTPug5lXH/GefROyW8PPD4T8n9J8E= -cloud.google.com/go/auth v0.5.1 h1:0QNO7VThG54LUzKiQxv8C6x1YX7lUrzlAa1nVLF8CIw= -cloud.google.com/go/auth v0.5.1/go.mod h1:vbZT8GjzDf3AVqCcQmqeeM32U9HBFc32vVVAbwDsa6s= +cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= +cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= +cloud.google.com/go/auth v0.6.0 h1:5x+d6b5zdezZ7gmLWD1m/xNjnaQ2YDhmIz/HH3doy1g= +cloud.google.com/go/auth v0.6.0/go.mod h1:b4acV+jLQDyjwm4OXHYjNvRi4jvGBzHWJRtJcy+2P4g= cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q= cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= @@ -13,15 +13,15 @@ cloud.google.com/go/kms v1.17.1 h1:5k0wXqkxL+YcXd4viQzTqCgzzVKKxzgrK+rCZJytEQs= cloud.google.com/go/kms v1.17.1/go.mod h1:DCMnCF/apA6fZk5Cj4XsD979OyHAqFasPuA5Sd0kGlQ= cloud.google.com/go/longrunning v0.5.7 h1:WLbHekDbjK1fVFD3ibpFFVoyizlLRl73I7YKuAKilhU= cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodEMwEAztp38Xng= -cloud.google.com/go/pubsub v1.38.0 h1:J1OT7h51ifATIedjqk/uBNPh+1hkvUaH4VKbz4UuAsc= -cloud.google.com/go/pubsub v1.38.0/go.mod h1:IPMJSWSus/cu57UyR01Jqa/bNOQA+XnPF6Z4dKW4fAA= +cloud.google.com/go/pubsub v1.39.0 h1:qt1+S6H+wwW8Q/YvDwM8lJnq+iIFgFEgaD/7h3lMsAI= +cloud.google.com/go/pubsub v1.39.0/go.mod h1:FrEnrSGU6L0Kh3iBaAbIUM8KMR7LqyEkMboVxGXCT+s= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 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/XSAM/otelsql v0.29.0 h1:pEw9YXXs8ZrGRYfDc0cmArIz9lci5b42gmP5+tA1Huc= -github.com/XSAM/otelsql v0.29.0/go.mod h1:d3/0xGIGC5RVEE+Ld7KotwaLy6zDeaF3fLJHOPpdN2w= +github.com/XSAM/otelsql v0.31.0 h1:AcWI+/BW4ANKyAybZmU9g9kjjSIcDEOFw96ybyM4cDo= +github.com/XSAM/otelsql v0.31.0/go.mod h1:iCkLyB/me+QC4yjymXjLimJiX0oklymiKeGxeGDTW24= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.33.0 h1:uvTF0EDeu9RLnUEG27Db5I68ESoIxTiXbNUiji6lZrA= @@ -101,8 +101,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= -github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= +github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd h1:gbpYu9NMq8jhDVbvlGkMFWCjLFlqqEZjEmObmhUy6Vo= +github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -110,20 +110,20 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= -github.com/googleapis/gax-go/v2 v2.12.4 h1:9gWcmF85Wvq4ryPFvGFaOgPIs1AQX0d0bcbGw4Z96qg= -github.com/googleapis/gax-go/v2 v2.12.4/go.mod h1:KYEYLorsnIGDi/rPC8b5TdlB9kbKoFubselGIoBMCwI= +github.com/googleapis/gax-go/v2 v2.12.5 h1:8gw9KZK8TiVKB6q3zHY3SBzLnrGp6HQjyfYBYGmXdxA= +github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kisielk/sqlstruct v0.0.0-20201105191214-5f3e10d3ab46/go.mod h1:yyMNCyc/Ib3bDTKd379tNMpB/7/H5TjM2Y9QJ5THLbE= @@ -142,8 +142,8 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= 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.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= +github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -151,11 +151,11 @@ github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042 github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin/zipkin-go v0.4.2 h1:zjqfqHjUpPmB3c1GlCvvgsM1G4LkvqQbBDueDOCg/jA= -github.com/openzipkin/zipkin-go v0.4.2/go.mod h1:ZeVkFjuuBiSy13y8vpSDCjMi9GoI3hPpCJSBx/EYFhY= +github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7sjsSdg= +github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pierrec/lz4/v4 v4.1.17 h1:kV4Ip+/hUBC+8T6+2EgburRtkE9ef4nbY3f4dFhGjMc= -github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= +github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.8.1/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= @@ -164,12 +164,12 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN 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.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= -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_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/redis/go-redis/extra/rediscmd/v9 v9.0.5 h1:EaDatTxkdHG+U3Bk4EUr+DZ7fOGwTfezUiUJMaIcaho= github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5/go.mod h1:fyalQWdtzDBECAQFBJuQe5bzQ02jGd5Qcbgb97Flm7U= github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 h1:EfpWLLCyXw8PSM2/XNJLjI3Pb27yVE+gIAfeqp8LUCc= @@ -177,11 +177,10 @@ github.com/redis/go-redis/extra/redisotel/v9 v9.0.5/go.mod h1:WZjPDy7VNzn77AAfnA github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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/segmentio/kafka-go v0.4.47 h1:IqziR4pA3vrZq7YdRxaT3w1/5fvIH5qpCwstUanQQB0= github.com/segmentio/kafka-go v0.4.47/go.mod h1:HjF6XbOKh0Pjlkr5GVZxt6CsjjwnmhVOfURM5KMd8qg= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -217,30 +216,30 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= -go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.49.0 h1:RtcvQ4iw3w9NBB5yRwgA4sSa82rfId7n4atVpvKx3bY= -go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.49.0/go.mod h1:f/PbKbRd4cdUICWell6DmzvVJ7QrmBgFrRHjXmAXbK4= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= -go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= -go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM= -go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ= -go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs= -go.opentelemetry.io/otel/exporters/zipkin v1.24.0 h1:3evrL5poBuh1KF51D9gO/S+N/1msnm4DaBqs/rpXUqY= -go.opentelemetry.io/otel/exporters/zipkin v1.24.0/go.mod h1:0EHgD8R0+8yRhUYJOGR8Hfg2dpiJQxDOszd5smVO9wM= -go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= -go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= -go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= -go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= -go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8= -go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0= -go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= -go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= -go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= -go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.52.0 h1:Ud1trPqDHGSxyMiJ9a2XAdtTCXmRy0Yf7MjhW4dXogI= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.52.0/go.mod h1:l/UzmhdRx9YP37NI/nSr7l1bgG0dZnGfZf6C7TiV4jI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 h1:9l89oX4ba9kHbBol3Xin3leYJ+252h0zszDtBwyKe2A= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0/go.mod h1:XLZfZboOJWHNKUv7eH0inh0E9VV6eWDFB/9yJyTLPp0= +go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 h1:R9DE4kQ4k+YtfLI2ULwX82VtNQ2J8yZmA7ZIF/D+7Mc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0/go.mod h1:OQFyQVrDlbe+R7xrEyDr/2Wr67Ol0hRUgsfA+V5A95s= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= +go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= +go.opentelemetry.io/otel/exporters/prometheus v0.49.0/go.mod h1:KfQ1wpjf3zsHjzP149P4LyAwWRupc6c7t1ZJ9eXpKQM= +go.opentelemetry.io/otel/exporters/zipkin v1.27.0 h1:aXcxb7F6ZDC1o2Z52LDfS2g6M2FB5CrxdR2gzY4QRNs= +go.opentelemetry.io/otel/exporters/zipkin v1.27.0/go.mod h1:+WMURoi4KmVB7ypbFPx3xtZTWen2Ca3lRK9u6DVTO5M= +go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= +go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= +go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= +go.opentelemetry.io/otel/sdk/metric v1.27.0 h1:5uGNOlpXi+Hbo/DRoI31BSb1v+OGcpv2NemcCrOL8gI= +go.opentelemetry.io/otel/sdk/metric v1.27.0/go.mod h1:we7jJVrYN2kh3mVBlswtPU22K0SA+769l93J6bsyvqw= +go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= +go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= +go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -346,20 +345,20 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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/api v0.184.0 h1:dmEdk6ZkJNXy1JcDhn/ou0ZUq7n9zropG2/tR4z+RDg= -google.golang.org/api v0.184.0/go.mod h1:CeDTtUEiYENAf8PPG5VZW2yNp2VM3VWbCeTioAZBTBA= +google.golang.org/api v0.186.0 h1:n2OPp+PPXX0Axh4GuSsL5QL8xQCTb2oDwyzPnQvqUug= +google.golang.org/api v0.186.0/go.mod h1:hvRbBmgoje49RV3xqVXrmP6w93n6ehGgIVPYrGtBFFc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20240604185151-ef581f913117 h1:HCZ6DlkKtCDAtD8ForECsY3tKuaR+p4R3grlK80uCCc= -google.golang.org/genproto v0.0.0-20240604185151-ef581f913117/go.mod h1:lesfX/+9iA+3OdqeCpoDddJaNxVB1AB6tD7EfqMmprc= -google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw= -google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto v0.0.0-20240617180043-68d350f18fd4 h1:CUiCqkPw1nNrNQzCCG4WA65m0nAmQiwXHpub3dNyruU= +google.golang.org/genproto v0.0.0-20240617180043-68d350f18fd4/go.mod h1:EvuUDCulqGgV80RvP1BHuom+smhX4qtlhnNatHuroGQ= +google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 h1:QW9+G6Fir4VcRXVH8x3LilNAb6cxBGLa6+GM4hRwexE= +google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3/go.mod h1:kdrSS/OiLkPrNUpzD4aHgCq2rVuC/YRxok32HXZ4vRE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 h1:Di6ANFilr+S60a4S61ZM00vLdw0IrQOSMS2/6mrnOU0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -395,31 +394,29 @@ gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= -lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= -modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= -modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= -modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= -modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= -modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= -modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= -modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/libc v1.22.5 h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE= -modernc.org/libc v1.22.5/go.mod h1:jj+Z7dTNX8fBScMVNRAYZ/jF91K8fdT2hYMThc3YjBY= -modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= -modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= -modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/cc/v4 v4.21.2 h1:dycHFB/jDc3IyacKipCNSDrjIC0Lm1hyoWOZTRR20Lk= +modernc.org/cc/v4 v4.21.2/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= +modernc.org/ccgo/v4 v4.17.10 h1:6wrtRozgrhCxieCeJh85QsxkX/2FFrT9hdaWPlbn4Zo= +modernc.org/ccgo/v4 v4.17.10/go.mod h1:0NBHgsqTTpm9cA5z2ccErvGZmtntSM9qD2kFAs6pjXM= +modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= +modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= +modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw= +modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= +modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 h1:5D53IMaUuA5InSeMu9eJtlQXS2NxAhyWQvkKEgXZhHI= +modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= +modernc.org/libc v1.52.1 h1:uau0VoiT5hnR+SpoWekCKbLqm7v6dhRL3hI+NQhgN3M= +modernc.org/libc v1.52.1/go.mod h1:HR4nVzFDSDizP620zcMCgjb1/8xk2lg5p/8yjfGv1IQ= +modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= +modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= +modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= +modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.22.1 h1:P2+Dhp5FR1RlVRkQ3dDfCiv3Ok8XPxqpe70IjYVA9oE= -modernc.org/sqlite v1.22.1/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk= -modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= -modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= -modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= -modernc.org/tcl v1.15.2/go.mod h1:3+k/ZaEbKrC8ePv8zJWPtBSW0V7Gg9g8rkmhI1Kfs3c= -modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= -modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= -modernc.org/z v1.7.3/go.mod h1:Ipv4tsdxZRbQyLq9Q1M6gdbkxYzdlrciF2Hi/lS7nWE= +modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= +modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= +modernc.org/sqlite v1.30.1 h1:YFhPVfu2iIgUf9kuA1CR7iiHdcEEsI2i+yjRYHscyxk= +modernc.org/sqlite v1.30.1/go.mod h1:DUmsiWQDaAvU4abhc/N+djlom/L2o8f7gZ95RCvyoLU= +modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= +modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= +modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= +modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= diff --git a/pkg/gofr/datasource/cassandra/go.mod b/pkg/gofr/datasource/cassandra/go.mod index a943212aa..62c389699 100644 --- a/pkg/gofr/datasource/cassandra/go.mod +++ b/pkg/gofr/datasource/cassandra/go.mod @@ -1,17 +1,18 @@ module gofr.dev/pkg/gofr/datasource/cassandra -go 1.21.1 +go 1.22 require ( github.com/gocql/gocql v1.6.0 - github.com/stretchr/testify v1.3.0 + github.com/stretchr/testify v1.9.0 go.uber.org/mock v0.4.0 ) require ( - github.com/davecgh/go-spew v1.1.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang/snappy v0.0.3 // indirect github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect github.com/pmezard/go-difflib v1.0.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/gofr/datasource/cassandra/go.sum b/pkg/gofr/datasource/cassandra/go.sum index 3b971a22b..3a52f8078 100644 --- a/pkg/gofr/datasource/cassandra/go.sum +++ b/pkg/gofr/datasource/cassandra/go.sum @@ -2,8 +2,9 @@ github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932 h1:mXoPYz/Ul5HYE github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 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/gocql/gocql v1.6.0 h1:IdFdOTbnpbd0pDhl4REKQDM+Q0SzKXQ1Yh+YZZ8T/qU= github.com/gocql/gocql v1.6.0/go.mod h1:3gM2c4D3AnkISwBxGnMMsS8Oy4y2lhbPRsH4xnJrHG8= github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= @@ -18,9 +19,14 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +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= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/gofr/datasource/clickhouse/go.mod b/pkg/gofr/datasource/clickhouse/go.mod index d378e4277..f65655854 100644 --- a/pkg/gofr/datasource/clickhouse/go.mod +++ b/pkg/gofr/datasource/clickhouse/go.mod @@ -1,9 +1,9 @@ module gofr.dev/pkg/gofr/datasource/clickhouse -go 1.21 +go 1.22 require ( - github.com/ClickHouse/clickhouse-go/v2 v2.23.2 + github.com/ClickHouse/clickhouse-go/v2 v2.25.0 github.com/stretchr/testify v1.9.0 go.uber.org/mock v0.4.0 ) @@ -22,8 +22,8 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/segmentio/asm v1.2.0 // indirect github.com/shopspring/decimal v1.4.0 // indirect - go.opentelemetry.io/otel v1.24.0 // indirect - go.opentelemetry.io/otel/trace v1.24.0 // indirect + go.opentelemetry.io/otel v1.26.0 // indirect + go.opentelemetry.io/otel/trace v1.26.0 // indirect golang.org/x/sys v0.18.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/gofr/datasource/clickhouse/go.sum b/pkg/gofr/datasource/clickhouse/go.sum index 7f00936e3..6eaadeda7 100644 --- a/pkg/gofr/datasource/clickhouse/go.sum +++ b/pkg/gofr/datasource/clickhouse/go.sum @@ -1,7 +1,7 @@ github.com/ClickHouse/ch-go v0.61.5 h1:zwR8QbYI0tsMiEcze/uIMK+Tz1D3XZXLdNrlaOpeEI4= github.com/ClickHouse/ch-go v0.61.5/go.mod h1:s1LJW/F/LcFs5HJnuogFMta50kKDO0lf9zzfrbl0RQg= -github.com/ClickHouse/clickhouse-go/v2 v2.23.2 h1:+DAKPMnxLS7pduQZsrJc8OhdLS2L9MfDEJ2TS+hpYDM= -github.com/ClickHouse/clickhouse-go/v2 v2.23.2/go.mod h1:aNap51J1OM3yxQJRgM+AlP/MPkGBCL8A74uQThoQhR0= +github.com/ClickHouse/clickhouse-go/v2 v2.25.0 h1:rKscwqgQHzWBTZySZDcHKxgs0Ad+xFULfZvo26W5UlY= +github.com/ClickHouse/clickhouse-go/v2 v2.25.0/go.mod h1:iDTViXk2Fgvf1jn2dbJd1ys+fBkdD1UMRnXlwmhijhQ= github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -59,10 +59,10 @@ github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7Jul github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= -go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= -go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= -go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= -go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= +go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs= +go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4= +go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA= +go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/pkg/gofr/datasource/mongo/go.mod b/pkg/gofr/datasource/mongo/go.mod index abe218033..adb1baa2b 100644 --- a/pkg/gofr/datasource/mongo/go.mod +++ b/pkg/gofr/datasource/mongo/go.mod @@ -2,11 +2,9 @@ module gofr.dev/pkg/gofr/datasource/mongo go 1.22 -toolchain go1.22.3 - require ( github.com/stretchr/testify v1.9.0 - go.mongodb.org/mongo-driver v1.15.0 + go.mongodb.org/mongo-driver v1.15.1 go.uber.org/mock v0.4.0 ) diff --git a/pkg/gofr/datasource/mongo/go.sum b/pkg/gofr/datasource/mongo/go.sum index ca16041a8..582807eae 100644 --- a/pkg/gofr/datasource/mongo/go.sum +++ b/pkg/gofr/datasource/mongo/go.sum @@ -21,8 +21,8 @@ github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gi 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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.mongodb.org/mongo-driver v1.15.0 h1:rJCKC8eEliewXjZGf0ddURtl7tTVy1TK3bfl0gkUSLc= -go.mongodb.org/mongo-driver v1.15.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= +go.mongodb.org/mongo-driver v1.15.1 h1:l+RvoUOoMXFmADTLfYDm7On9dRm7p4T80/lEQM+r7HU= +go.mongodb.org/mongo-driver v1.15.1/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From f10b5c5f0f18b06ca3cd2ff2643b16d27511e20d Mon Sep 17 00:00:00 2001 From: Aryan Mehrotra <44036979+aryanmehrotra@users.noreply.github.com> Date: Wed, 26 Jun 2024 17:24:25 +0530 Subject: [PATCH 10/17] Support for Clickhouse migrations (#750) --- pkg/gofr/migration/clickhouse.go | 105 +++++++++++++++++++ pkg/gofr/migration/clickhouse_test.go | 117 +++++++++++++++++++++ pkg/gofr/migration/datasource.go | 12 ++- pkg/gofr/migration/interface.go | 6 ++ pkg/gofr/migration/migration.go | 10 ++ pkg/gofr/migration/migration_test.go | 144 ++++++++++++++++++++++++++ pkg/gofr/migration/mock_interface.go | 80 ++++++++++++++ 7 files changed, 471 insertions(+), 3 deletions(-) create mode 100644 pkg/gofr/migration/clickhouse.go create mode 100644 pkg/gofr/migration/clickhouse_test.go diff --git a/pkg/gofr/migration/clickhouse.go b/pkg/gofr/migration/clickhouse.go new file mode 100644 index 000000000..5cb139518 --- /dev/null +++ b/pkg/gofr/migration/clickhouse.go @@ -0,0 +1,105 @@ +package migration + +import ( + "context" + "time" + + "gofr.dev/pkg/gofr/container" +) + +type clickHouseDS struct { + Clickhouse +} + +type clickHouseMigrator struct { + Clickhouse + + migrator +} + +func (ch clickHouseDS) apply(m migrator) migrator { + return clickHouseMigrator{ + Clickhouse: ch.Clickhouse, + migrator: m, + } +} + +const ( + CheckAndCreateChMigrationTable = `CREATE TABLE IF NOT EXISTS gofr_migrations +( + version Int64 NOT NULL, + method String NOT NULL, + start_time DateTime NOT NULL, + duration Int64 NULL, + PRIMARY KEY (version, method) +) ENGINE = MergeTree() +ORDER BY (version, method); +` + + getLastChGoFrMigration = `SELECT COALESCE(MAX(version), 0) as last_migration FROM gofr_migrations;` + + insertChGoFrMigrationRow = `INSERT INTO gofr_migrations (version, method, start_time, duration) VALUES (?, ?, ?, ?);` +) + +func (ch clickHouseMigrator) checkAndCreateMigrationTable(c *container.Container) error { + if err := c.Clickhouse.Exec(context.Background(), CheckAndCreateChMigrationTable); err != nil { + return err + } + + return ch.migrator.checkAndCreateMigrationTable(c) +} + +func (ch clickHouseMigrator) getLastMigration(c *container.Container) int64 { + type LastMigration struct { + Timestamp int64 `ch:"last_migration"` + } + + var lastMigrations []LastMigration + + var lastMigration int64 + + err := c.Clickhouse.Select(context.Background(), &lastMigrations, getLastChGoFrMigration) + if err != nil { + return 0 + } + + c.Debugf("SQL last migration fetched value is: %v", lastMigration) + + if len(lastMigrations) != 0 { + lastMigration = lastMigrations[0].Timestamp + } + + lm2 := ch.migrator.getLastMigration(c) + + if lm2 > lastMigration { + return lm2 + } + + return lastMigration +} + +func (ch clickHouseMigrator) beginTransaction(c *container.Container) transactionData { + cmt := ch.migrator.beginTransaction(c) + + c.Debug("Clickhouse Migrator begin successfully") + + return cmt +} + +func (ch clickHouseMigrator) commitMigration(c *container.Container, data transactionData) error { + err := ch.Clickhouse.Exec(context.Background(), insertChGoFrMigrationRow, data.MigrationNumber, + "UP", data.StartTime, time.Since(data.StartTime).Milliseconds()) + if err != nil { + return err + } + + c.Debugf("inserted record for migration %v in clickhouse gofr_migrations table", data.MigrationNumber) + + return ch.migrator.commitMigration(c, data) +} + +func (ch clickHouseMigrator) rollback(c *container.Container, data transactionData) { + c.Errorf("Migration %v failed", data.MigrationNumber) + + ch.migrator.rollback(c, data) +} diff --git a/pkg/gofr/migration/clickhouse_test.go b/pkg/gofr/migration/clickhouse_test.go new file mode 100644 index 000000000..be6301f3b --- /dev/null +++ b/pkg/gofr/migration/clickhouse_test.go @@ -0,0 +1,117 @@ +package migration + +import ( + "database/sql" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" + + "gofr.dev/pkg/gofr/container" + "gofr.dev/pkg/gofr/testutil" +) + +func clickHouseSetup(t *testing.T) (migrator, *MockClickhouse, *container.Container) { + ctrl := gomock.NewController(t) + + mockContainer, _ := container.NewMockContainer(t) + + mockClickhouse := NewMockClickhouse(ctrl) + + ds := Datasource{Clickhouse: mockClickhouse} + + ch := clickHouseDS{Clickhouse: mockClickhouse} + mg := ch.apply(ds) + + mockContainer.Clickhouse = mockClickhouse + + return mg, mockClickhouse, mockContainer +} + +func Test_ClickHouseCheckAndCreateMigrationTable(t *testing.T) { + mg, mockClickhouse, mockContainer := clickHouseSetup(t) + + testCases := []struct { + desc string + err error + }{ + {"no error", nil}, + {"connection failed", sql.ErrConnDone}, + } + + for i, tc := range testCases { + mockClickhouse.EXPECT().Exec(gomock.Any(), CheckAndCreateChMigrationTable).Return(tc.err) + + err := mg.checkAndCreateMigrationTable(mockContainer) + + assert.Equal(t, tc.err, err, "TEST[%v]\n %v Failed! ", i, tc.desc) + } +} + +func Test_ClickHouseGetLastMigration(t *testing.T) { + mg, mockClickhouse, mockContainer := clickHouseSetup(t) + + testCases := []struct { + desc string + err error + resp int64 + }{ + {"no error", nil, 0}, + {"connection failed", sql.ErrConnDone, 0}, + } + + for i, tc := range testCases { + mockClickhouse.EXPECT().Select(gomock.Any(), gomock.Any(), getLastChGoFrMigration).Return(tc.err) + + resp := mg.getLastMigration(mockContainer) + + assert.Equal(t, tc.resp, resp, "TEST[%v]\n %v Failed! ", i, tc.desc) + } +} + +func Test_ClickHouseCommitMigration(t *testing.T) { + mg, mockClickhouse, mockContainer := clickHouseSetup(t) + + testCases := []struct { + desc string + err error + }{ + {"no error", nil}, + {"connection failed", sql.ErrConnDone}, + } + + timeNow := time.Now() + + td := transactionData{ + StartTime: timeNow, + MigrationNumber: 10, + } + + for i, tc := range testCases { + mockClickhouse.EXPECT().Exec(gomock.Any(), insertChGoFrMigrationRow, td.MigrationNumber, + "UP", td.StartTime, gomock.Any()).Return(tc.err) + + err := mg.commitMigration(mockContainer, td) + + assert.Equal(t, tc.err, err, "TEST[%v]\n %v Failed! ", i, tc.desc) + } +} + +func Test_ClickHouseBeginTransaction(t *testing.T) { + logs := testutil.StdoutOutputForFunc(func() { + mg, _, mockContainer := clickHouseSetup(t) + mg.beginTransaction(mockContainer) + }) + + assert.Contains(t, logs, "Clickhouse Migrator begin successfully") +} + +func Test_ClickHouseRollback(t *testing.T) { + logs := testutil.StderrOutputForFunc(func() { + mg, _, mockContainer := clickHouseSetup(t) + mg.rollback(mockContainer, transactionData{MigrationNumber: 0}) + }) + + assert.Contains(t, logs, "Migration 0 failed") +} diff --git a/pkg/gofr/migration/datasource.go b/pkg/gofr/migration/datasource.go index de160279e..666a03a5d 100644 --- a/pkg/gofr/migration/datasource.go +++ b/pkg/gofr/migration/datasource.go @@ -7,29 +7,35 @@ type Datasource struct { // Need to think it through as it will bring breaking changes. Logger - SQL SQL - Redis Redis - PubSub PubSub + SQL SQL + Redis Redis + PubSub PubSub + Clickhouse Clickhouse } // It is a base implementation for migration manger, on this other database drivers have been wrapped. +//nolint:gocritic // Datasource has to be changed to a pointer in a different PR. func (d Datasource) checkAndCreateMigrationTable(*container.Container) error { return nil } +//nolint:gocritic // Datasource has to be changed to a pointer in a different PR. func (d Datasource) getLastMigration(*container.Container) int64 { return 0 } +//nolint:gocritic // Datasource has to be changed to a pointer in a different PR. func (d Datasource) beginTransaction(*container.Container) transactionData { return transactionData{} } +//nolint:gocritic // Datasource has to be changed to a pointer in a different PR. func (d Datasource) commitMigration(c *container.Container, data transactionData) error { c.Infof("Migration %v ran successfully", data.MigrationNumber) return nil } +//nolint:gocritic // Datasource has to be changed to a pointer in a different PR. func (d Datasource) rollback(*container.Container, transactionData) {} diff --git a/pkg/gofr/migration/interface.go b/pkg/gofr/migration/interface.go index 26e0b5231..ce7934c31 100644 --- a/pkg/gofr/migration/interface.go +++ b/pkg/gofr/migration/interface.go @@ -29,6 +29,12 @@ type PubSub interface { DeleteTopic(context context.Context, name string) error } +type Clickhouse interface { + Exec(ctx context.Context, query string, args ...any) error + Select(ctx context.Context, dest any, query string, args ...any) error + AsyncInsert(ctx context.Context, query string, wait bool, args ...any) error +} + // keeping the migrator interface unexported as, right now it is not being implemented directly, by the externalDB drivers. // keeping the implementations for externalDB at one place such that if any change in migration logic, we would change directly here. type migrator interface { diff --git a/pkg/gofr/migration/migration.go b/pkg/gofr/migration/migration.go index 20bdd62d3..bb7f6a09b 100644 --- a/pkg/gofr/migration/migration.go +++ b/pkg/gofr/migration/migration.go @@ -135,6 +135,16 @@ func getMigrator(c *container.Container) (Datasource, migrator, bool) { c.Debug("initialized data source for redis") } + if !isNil(c.Clickhouse) { + ok = true + + ds.Clickhouse = c.Clickhouse + + mg = clickHouseDS{ds.Clickhouse}.apply(mg) + + c.Debug("initialized data source for Clickhouse") + } + if c.PubSub != nil { ok = true diff --git a/pkg/gofr/migration/migration_test.go b/pkg/gofr/migration/migration_test.go index 4cfa636c9..ed4f4095f 100644 --- a/pkg/gofr/migration/migration_test.go +++ b/pkg/gofr/migration/migration_test.go @@ -1,9 +1,12 @@ package migration import ( + "context" + "database/sql" "testing" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "gofr.dev/pkg/gofr/container" "gofr.dev/pkg/gofr/logging" @@ -51,3 +54,144 @@ func Test_getMigratorDBInitialisation(t *testing.T) { assert.NotNil(t, datasource.Redis, "TEST Failed \nRedis not initialized, but should have been initialized") assert.Equal(t, true, isInitialised, "TEST Failed \nNo datastores are Initialized") } + +func initialiseClickHouseRunMocks(t *testing.T) (*MockClickhouse, *container.Container) { + mockClickHouse := NewMockClickhouse(gomock.NewController(t)) + + mockContainer, _ := container.NewMockContainer(t) + mockContainer.SQL = nil + mockContainer.Redis = nil + mockContainer.Mongo = nil + mockContainer.Cassandra = nil + mockContainer.PubSub = nil + mockContainer.Logger = logging.NewMockLogger(logging.DEBUG) + mockContainer.Clickhouse = mockClickHouse + + return mockClickHouse, mockContainer +} + +func TestMigrationRunClickhouseSuccess(t *testing.T) { + logs := testutil.StdoutOutputForFunc(func() { + migrationMap := map[int64]Migrate{ + 1: {UP: func(d Datasource) error { + err := d.Clickhouse.Exec(context.Background(), "SELECT * FROM users") + if err != nil { + return err + } + + return nil + }}, + } + + mockClickHouse, mockContainer := initialiseClickHouseRunMocks(t) + + mockClickHouse.EXPECT().Exec(gomock.Any(), CheckAndCreateChMigrationTable).Return(nil) + mockClickHouse.EXPECT().Select(gomock.Any(), gomock.Any(), getLastChGoFrMigration).Return(nil) + mockClickHouse.EXPECT().Exec(gomock.Any(), "SELECT * FROM users").Return(nil) + mockClickHouse.EXPECT().Exec(gomock.Any(), insertChGoFrMigrationRow, int64(1), + "UP", gomock.Any(), gomock.Any()).Return(nil) + + Run(migrationMap, mockContainer) + }) + + assert.Contains(t, logs, "Migration 1 ran successfully") +} + +func TestMigrationRunClickhouseMigrationFailure(t *testing.T) { + logs := testutil.StderrOutputForFunc(func() { + migrationMap := map[int64]Migrate{ + 1: {UP: func(d Datasource) error { + err := d.Clickhouse.Exec(context.Background(), "SELECT * FROM users") + if err != nil { + return err + } + + return nil + }}, + } + + mockClickHouse, mockContainer := initialiseClickHouseRunMocks(t) + + mockClickHouse.EXPECT().Exec(gomock.Any(), CheckAndCreateChMigrationTable).Return(nil) + mockClickHouse.EXPECT().Select(gomock.Any(), gomock.Any(), getLastChGoFrMigration).Return(nil) + mockClickHouse.EXPECT().Exec(gomock.Any(), "SELECT * FROM users").Return(sql.ErrConnDone) + + Run(migrationMap, mockContainer) + }) + + assert.Contains(t, logs, "Migration 1 failed") +} + +func TestMigrationRunClickhouseMigrationFailureWhileCheckingTable(t *testing.T) { + logs := testutil.StderrOutputForFunc(func() { + migrationMap := map[int64]Migrate{ + 1: {UP: func(d Datasource) error { + err := d.Clickhouse.Exec(context.Background(), "SELECT * FROM users") + if err != nil { + return err + } + + return nil + }}, + } + + mockClickHouse, mockContainer := initialiseClickHouseRunMocks(t) + + mockClickHouse.EXPECT().Exec(gomock.Any(), CheckAndCreateChMigrationTable).Return(sql.ErrConnDone) + + Run(migrationMap, mockContainer) + }) + + assert.Contains(t, logs, "failed to create gofr_migration table, err: sql: connection is already closed") +} + +func TestMigrationRunClickhouseCurrentMigrationEqualLastMigration(t *testing.T) { + logs := testutil.StdoutOutputForFunc(func() { + migrationMap := map[int64]Migrate{ + 0: {UP: func(d Datasource) error { + err := d.Clickhouse.Exec(context.Background(), "SELECT * FROM users") + if err != nil { + return err + } + + return nil + }}, + } + + mockClickHouse, mockContainer := initialiseClickHouseRunMocks(t) + + mockClickHouse.EXPECT().Exec(gomock.Any(), CheckAndCreateChMigrationTable).Return(nil) + mockClickHouse.EXPECT().Select(gomock.Any(), gomock.Any(), getLastChGoFrMigration).Return(nil) + + Run(migrationMap, mockContainer) + }) + + assert.Contains(t, logs, "skipping migration 0") +} + +func TestMigrationRunClickhouseCommitError(t *testing.T) { + logs := testutil.StderrOutputForFunc(func() { + migrationMap := map[int64]Migrate{ + 1: {UP: func(d Datasource) error { + err := d.Clickhouse.Exec(context.Background(), "SELECT * FROM users") + if err != nil { + return err + } + + return nil + }}, + } + + mockClickHouse, mockContainer := initialiseClickHouseRunMocks(t) + + mockClickHouse.EXPECT().Exec(gomock.Any(), CheckAndCreateChMigrationTable).Return(nil) + mockClickHouse.EXPECT().Select(gomock.Any(), gomock.Any(), getLastChGoFrMigration).Return(nil) + mockClickHouse.EXPECT().Exec(gomock.Any(), "SELECT * FROM users").Return(nil) + mockClickHouse.EXPECT().Exec(gomock.Any(), insertChGoFrMigrationRow, int64(1), + "UP", gomock.Any(), gomock.Any()).Return(sql.ErrConnDone) + + Run(migrationMap, mockContainer) + }) + + assert.Contains(t, logs, "failed to commit migration, err: sql: connection is already closed") +} diff --git a/pkg/gofr/migration/mock_interface.go b/pkg/gofr/migration/mock_interface.go index 92af905cc..9a7db0462 100644 --- a/pkg/gofr/migration/mock_interface.go +++ b/pkg/gofr/migration/mock_interface.go @@ -276,6 +276,86 @@ func (mr *MockPubSubMockRecorder) DeleteTopic(context, name any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteTopic", reflect.TypeOf((*MockPubSub)(nil).DeleteTopic), context, name) } +// MockClickhouse is a mock of Clickhouse interface. +type MockClickhouse struct { + ctrl *gomock.Controller + recorder *MockClickhouseMockRecorder +} + +// MockClickhouseMockRecorder is the mock recorder for MockClickhouse. +type MockClickhouseMockRecorder struct { + mock *MockClickhouse +} + +// NewMockClickhouse creates a new mock instance. +func NewMockClickhouse(ctrl *gomock.Controller) *MockClickhouse { + mock := &MockClickhouse{ctrl: ctrl} + mock.recorder = &MockClickhouseMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockClickhouse) EXPECT() *MockClickhouseMockRecorder { + return m.recorder +} + +// AsyncInsert mocks base method. +func (m *MockClickhouse) AsyncInsert(ctx context.Context, query string, wait bool, args ...any) error { + m.ctrl.T.Helper() + varargs := []any{ctx, query, wait} + for _, a := range args { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AsyncInsert", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// AsyncInsert indicates an expected call of AsyncInsert. +func (mr *MockClickhouseMockRecorder) AsyncInsert(ctx, query, wait any, args ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, query, wait}, args...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AsyncInsert", reflect.TypeOf((*MockClickhouse)(nil).AsyncInsert), varargs...) +} + +// Exec mocks base method. +func (m *MockClickhouse) Exec(ctx context.Context, query string, args ...any) error { + m.ctrl.T.Helper() + varargs := []any{ctx, query} + for _, a := range args { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Exec", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// Exec indicates an expected call of Exec. +func (mr *MockClickhouseMockRecorder) Exec(ctx, query any, args ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, query}, args...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockClickhouse)(nil).Exec), varargs...) +} + +// Select mocks base method. +func (m *MockClickhouse) Select(ctx context.Context, dest any, query string, args ...any) error { + m.ctrl.T.Helper() + varargs := []any{ctx, dest, query} + for _, a := range args { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Select", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// Select indicates an expected call of Select. +func (mr *MockClickhouseMockRecorder) Select(ctx, dest, query any, args ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, dest, query}, args...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Select", reflect.TypeOf((*MockClickhouse)(nil).Select), varargs...) +} + // Mockmigrator is a mock of migrator interface. type Mockmigrator struct { ctrl *gomock.Controller From cd5b92e7e80412d575eb30ad0083acda672b8c27 Mon Sep 17 00:00:00 2001 From: KedarisettiSreeVamsi <34485436+KedarisettiSreeVamsi@users.noreply.github.com> Date: Wed, 26 Jun 2024 17:28:48 +0530 Subject: [PATCH 11/17] Added Static File Handler (#674) --- .../serving-static-files/page.md | 75 ++++++++++ pkg/gofr/gofr.go | 30 ++++ pkg/gofr/gofr_test.go | 138 ++++++++++++++++++ pkg/gofr/http/router.go | 39 ++++- pkg/gofr/http/router_test.go | 69 +++++++++ pkg/gofr/swagger_test.go | 2 +- 6 files changed, 350 insertions(+), 3 deletions(-) create mode 100644 docs/advanced-guide/serving-static-files/page.md diff --git a/docs/advanced-guide/serving-static-files/page.md b/docs/advanced-guide/serving-static-files/page.md new file mode 100644 index 000000000..e1d856bc5 --- /dev/null +++ b/docs/advanced-guide/serving-static-files/page.md @@ -0,0 +1,75 @@ +# Serving Static Files using GoFr + +Often, we are required to serve static content such as a default profile image, a favicon, or a background image for our +web application. We want to have a mechanism to serve that static content without the hassle of implementing it from scratch. + +GoFr provides a default mechanism where if a `static` folder is available in the directory of the application, +it automatically provides an endpoint with `/static/`, here filename refers to the file we want to get static content to be served. + +Example project structure: + +```dotenv +project_folder +| +|---configs +| .env +|---static +| img1.jpeg +| img2.png +| img3.jpeg +| main.go +| main_test.go +``` + +main.go code: + +```go +package main + +import "gofr.dev/pkg/gofr" + +func main(){ + app := gofr.New() + app.Run() +} +``` + +Additionally, if we want to serve more static endpoints, we have a dedicated function called `AddStaticFiles()` +which takes 2 parameters `endpoint` and the `filepath` of the static folder which we want to serve. + +Example project structure: + +```dotenv +project_folder +| +|---configs +| .env +|---static +| img1.jpeg +| img2.png +| img3.jpeg +|---public +| |---css +| | main.css +| |---js +| | main.js +| | index.html +| main.go +| main_test.go +``` + +main.go file: + +```go +package main + +import "gofr.dev/pkg/gofr" + +func main(){ + app := gofr.New() + app.AddStaticFiles("public", "./public") + app.Run() +} +``` + +In the above example, both endpoints `/public` and `/static` are available for the app to render the static content. diff --git a/pkg/gofr/gofr.go b/pkg/gofr/gofr.go index 5ffad731a..90066cf6b 100644 --- a/pkg/gofr/gofr.go +++ b/pkg/gofr/gofr.go @@ -5,6 +5,7 @@ import ( "fmt" "net/http" "os" + "path/filepath" "strconv" "strings" "sync" @@ -30,6 +31,8 @@ import ( "gofr.dev/pkg/gofr/service" ) +const defaultPublicStaticDir = "static" + // App is the main application in the GoFr framework. type App struct { // Config can be used by applications to fetch custom configurations from environment or file. @@ -92,6 +95,14 @@ func New() *App { app.subscriptionManager = newSubscriptionManager(app.container) + // static fileserver + currentWd, _ := os.Getwd() + checkDirectory := filepath.Join(currentWd, defaultPublicStaticDir) + + if _, err = os.Stat(checkDirectory); err == nil { + app.AddStaticFiles(defaultPublicStaticDir, checkDirectory) + } + return app } @@ -439,3 +450,22 @@ func contains(elems []string, v string) bool { return false } + +func (a *App) AddStaticFiles(endpoint, filePath string) { + a.httpRegistered = true + + // update file path based on current directory if it starts with ./ + if strings.HasPrefix(filePath, "./") { + currentWorkingDir, _ := os.Getwd() + filePath = filepath.Join(currentWorkingDir, filePath) + } + + endpoint = "/" + strings.TrimPrefix(endpoint, "/") + + if _, err := os.Stat(filePath); err != nil { + a.container.Logger.Errorf("error in registering '%s' static endpoint, error: %v", endpoint, err) + return + } + + a.httpServer.router.AddStaticFiles(endpoint, filePath) +} diff --git a/pkg/gofr/gofr_test.go b/pkg/gofr/gofr_test.go index f91160bb9..1953839a0 100644 --- a/pkg/gofr/gofr_test.go +++ b/pkg/gofr/gofr_test.go @@ -561,3 +561,141 @@ func Test_AddCronJob_Success(t *testing.T) { assert.Truef(t, pass, "unable to add cron job to cron table") } + +func TestStaticHandler(t *testing.T) { + const indexHTML = "indexTest.html" + + // Generating some files for testing + htmlContent := []byte("Test Static File

Testing Static File

") + + createPublicDirectory(t, defaultPublicStaticDir, htmlContent) + + defer os.Remove("static/indexTest.html") + + createPublicDirectory(t, "testdir", htmlContent) + + defer os.RemoveAll("testdir") + + app := New() + + app.AddStaticFiles("gofrTest", "./testdir") + + app.httpRegistered = true + app.httpServer.port = 8022 + + go app.Run() + time.Sleep(1 * time.Second) + + host := "http://localhost:8022" + + tests := []struct { + desc string + method string + path string + statusCode int + expectedBody string + expectedBodyLength int + expectedResponseHeaderType string + }{ + { + desc: "check file content index.html", method: http.MethodGet, path: "/" + defaultPublicStaticDir + "/" + indexHTML, + statusCode: http.StatusOK, expectedBodyLength: len(htmlContent), + expectedResponseHeaderType: "text/html; charset=utf-8", expectedBody: string(htmlContent), + }, + { + desc: "check public endpoint", method: http.MethodGet, + path: "/" + defaultPublicStaticDir, statusCode: http.StatusNotFound, + }, + { + desc: "check file content index.html in custom dir", method: http.MethodGet, path: "/" + "gofrTest" + "/" + indexHTML, + statusCode: http.StatusOK, expectedBodyLength: len(htmlContent), + expectedResponseHeaderType: "text/html; charset=utf-8", expectedBody: string(htmlContent), + }, + { + desc: "check public endpoint in custom dir", method: http.MethodGet, path: "/" + "gofrTest", + statusCode: http.StatusNotFound, + }, + } + + for i, tc := range tests { + request, err := http.NewRequestWithContext(context.Background(), tc.method, host+tc.path, http.NoBody) + if err != nil { + t.Fatalf("TEST[%d], Failed to create request, error: %s", i, err) + } + + request.Header.Set("Content-Type", "application/json") + + client := http.Client{} + + resp, err := client.Do(request) + if err != nil { + t.Fatalf("TEST[%d], Request failed, error: %s", i, err) + } + + bodyBytes, err := io.ReadAll(resp.Body) + if err != nil { + t.Fatalf("TEST[%d], Failed to read response body, error: %s", i, err) + } + + body := string(bodyBytes) + + assert.NoError(t, err, "TEST[%d], Failed.\n%s", i, tc.desc) + assert.Equal(t, tc.statusCode, resp.StatusCode, "TEST[%d], Failed with Status Body.\n%s", i, tc.desc) + + if tc.expectedBody != "" { + assert.Contains(t, body, tc.expectedBody, "TEST[%d], Failed with Expected Body.\n%s", i, tc.desc) + } + + if tc.expectedBodyLength != 0 { + contentLength := resp.Header.Get("Content-Length") + assert.Equal(t, strconv.Itoa(tc.expectedBodyLength), contentLength, "TEST[%d], Failed at Content-Length.\n%s", i, tc.desc) + } + + if tc.expectedResponseHeaderType != "" { + assert.Equal(t, + tc.expectedResponseHeaderType, + resp.Header.Get("Content-Type"), + "TEST[%d], Failed at Expected Content-Type.\n%s", i, tc.desc) + } + + resp.Body.Close() + } +} + +func TestStaticHandlerInvalidFilePath(t *testing.T) { + // Generating some files for testing + logs := testutil.StderrOutputForFunc(func() { + app := New() + + app.AddStaticFiles("gofrTest", ".//,.!@#$%^&") + }) + + assert.Contains(t, logs, "no such file or directory") + assert.Contains(t, logs, "error in registering '/gofrTest' static endpoint") +} + +func createPublicDirectory(t *testing.T, defaultPublicStaticDir string, htmlContent []byte) { + t.Helper() + + const indexHTML = "indexTest.html" + + directory := "./" + defaultPublicStaticDir + if _, err := os.Stat(directory); err != nil { + if err = os.Mkdir("./"+defaultPublicStaticDir, os.ModePerm); err != nil { + t.Fatalf("Couldn't create a "+defaultPublicStaticDir+" directory, error: %s", err) + } + } + + file, err := os.Create(filepath.Join(directory, indexHTML)) + + if err != nil { + t.Fatalf("Couldn't create %s file", indexHTML) + } + + _, err = file.Write(htmlContent) + if err != nil { + t.Fatalf("Couldn't write to %s file", indexHTML) + } + + file.Close() +} diff --git a/pkg/gofr/http/router.go b/pkg/gofr/http/router.go index ced1c57ab..9b8c8ca5d 100644 --- a/pkg/gofr/http/router.go +++ b/pkg/gofr/http/router.go @@ -2,10 +2,12 @@ package http import ( "net/http" - - "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" + "os" + "path/filepath" + "strings" "github.com/gorilla/mux" + "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" ) // Router is responsible for routing HTTP request. @@ -45,3 +47,36 @@ func (rou *Router) UseMiddleware(mws ...Middleware) { rou.Use(middlewares...) } + +type staticFileConfig struct { + directoryName string +} + +func (rou *Router) AddStaticFiles(endpoint, dirName string) { + cfg := staticFileConfig{directoryName: dirName} + + fileServer := http.FileServer(http.Dir(cfg.directoryName)) + rou.Router.NewRoute().PathPrefix(endpoint + "/").Handler(http.StripPrefix(endpoint, cfg.staticHandler(fileServer))) +} + +func (staticConfig staticFileConfig) staticHandler(fileServer http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + url := r.URL.Path + + filePath := strings.Split(url, "/") + + fileName := filePath[len(filePath)-1] + + const defaultSwaggerFileName = "openapi.json" + + if _, err := os.Stat(filepath.Join(staticConfig.directoryName, url)); fileName == defaultSwaggerFileName && err == nil { + w.WriteHeader(http.StatusForbidden) + + _, _ = w.Write([]byte("403 forbidden")) + + return + } + + fileServer.ServeHTTP(w, r) + }) +} diff --git a/pkg/gofr/http/router_test.go b/pkg/gofr/http/router_test.go index 9c599f21e..afc6dba7f 100644 --- a/pkg/gofr/http/router_test.go +++ b/pkg/gofr/http/router_test.go @@ -3,7 +3,10 @@ package http import ( "net/http" "net/http/httptest" + "os" + "path/filepath" "testing" + "time" "github.com/stretchr/testify/assert" @@ -66,3 +69,69 @@ func TestRouterWithMiddleware(t *testing.T) { testHeaderValue := rec.Header().Get("X-Test-Middleware") assert.Equal(t, "applied", testHeaderValue, "Test_UseMiddleware Failed! header value mismatch.") } + +func TestRouter_AddStaticFiles(t *testing.T) { + cfg := map[string]string{"HTTP_PORT": "8000", "LOG_LEVEL": "INFO"} + _ = container.NewContainer(config.NewMockConfig(cfg)) + + createTestFileAndDirectory(t, "testDir") + + defer os.RemoveAll("testDir") + + time.Sleep(1 * time.Second) + + currentWorkingDir, _ := os.Getwd() + + // Create a new router instance using the mock container + router := NewRouter() + router.AddStaticFiles("/gofr", currentWorkingDir+"/testDir") + + // Send a request to the test handler + req := httptest.NewRequest("GET", "/gofr/indexTest.html", http.NoBody) + rec := httptest.NewRecorder() + router.ServeHTTP(rec, req) + + // Verify the response + assert.Equal(t, http.StatusOK, rec.Code) + + // Send a request to the test handler + req = httptest.NewRequest("GET", "/gofr/openapi.json", http.NoBody) + rec = httptest.NewRecorder() + router.ServeHTTP(rec, req) + + // Verify the response + assert.Equal(t, http.StatusForbidden, rec.Code) +} + +func createTestFileAndDirectory(t *testing.T, dirName string) { + t.Helper() + + htmlContent := []byte("Test Static File

Testing Static File

") + + const indexHTML = "indexTest.html" + + directory := "./" + dirName + + if err := os.Mkdir("./"+dirName, os.ModePerm); err != nil { + t.Fatalf("Couldn't create a "+dirName+" directory, error: %s", err) + } + + file, err := os.Create(filepath.Join(directory, indexHTML)) + if err != nil { + t.Fatalf("Couldn't create %s file", indexHTML) + } + + _, err = file.Write(htmlContent) + if err != nil { + t.Fatalf("Couldn't write to %s file", indexHTML) + } + + file.Close() + + file, err = os.Create(filepath.Join(directory, "openapi.json")) + if err != nil { + t.Fatalf("Couldn't create %s file", indexHTML) + } + + file.Close() +} diff --git a/pkg/gofr/swagger_test.go b/pkg/gofr/swagger_test.go index 46f1eff04..ec4d2dfcc 100644 --- a/pkg/gofr/swagger_test.go +++ b/pkg/gofr/swagger_test.go @@ -98,7 +98,7 @@ func TestSwaggerHandler(t *testing.T) { } if strings.Split(fileResponse.ContentType, ";")[0] != tc.contentType { - t.Errorf("Expected content type 'application/json', got '%s'", fileResponse.ContentType) + t.Errorf("Expected content type '%s', got '%s'", tc.contentType, fileResponse.ContentType) } } } From 0c039c2cc1d56bb60a7700503e982152d15ef7a5 Mon Sep 17 00:00:00 2001 From: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Date: Thu, 27 Jun 2024 07:45:09 +0200 Subject: [PATCH 12/17] typos suggestion (#764) --- CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md | 4 ++-- README.md | 2 +- SECURITY.md | 2 +- docs/advanced-guide/grpc/page.md | 2 +- docs/advanced-guide/handling-data-migrations/page.md | 4 ++-- docs/advanced-guide/overriding-default/page.md | 2 +- docs/advanced-guide/publishing-custom-metrics/page.md | 10 +++++----- docs/advanced-guide/swagger-documentation/page.md | 4 ++-- docs/advanced-guide/using-cron/page.md | 2 +- docs/page.md | 2 +- docs/quick-start/add-rest-handlers/page.md | 2 +- docs/quick-start/configuration/page.md | 2 +- docs/quick-start/introduction/page.md | 6 +++--- docs/quick-start/observability/page.md | 4 ++-- examples/using-cron-jobs/main.go | 2 +- examples/using-file-bind/README.md | 2 +- examples/using-file-bind/main.go | 2 +- pkg/gofr/cron_test.go | 2 +- pkg/gofr/datasource/README.md | 2 +- pkg/gofr/datasource/mongo/logger.go | 2 +- pkg/gofr/datasource/mongo/mock_logger.go | 4 ++-- pkg/gofr/datasource/redis/hook_test.go | 2 +- pkg/gofr/datasource/sql/sql_test.go | 4 ++-- 24 files changed, 36 insertions(+), 36 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 023dc4851..49daea853 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an +standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7cc1fde58..00e1d463d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -81,7 +81,7 @@ Please note that the recommended local port for the services are different than * Use only what is given to you as part of function parameter or receiver. No globals. Inject all dependencies including DB, Logger etc. * No magic. So, no init. In a large project, it becomes difficult to track which package is doing what at the - initialisation step. + initialization step. * Exported functions must have an associated goDoc. * Sensitive data(username, password, keys) should not be pushed. Always use environment variables. * Take interfaces and return concrete types. @@ -107,7 +107,7 @@ Please note that the recommended local port for the services are different than * When you consider a new documentation page is needed, start by adding a new file and writing your new documentation. Then - add a reference to it in [navigation.js](https://gofr.dev/docs/navigation.js). * If needed, update or add proper code examples for your changes. * In case images are needed, add it to [docs/public](https://gofr.dev/docs/public) folder. -* Make sure you don't break existing links and refernces. +* Make sure you don't break existing links and references. * Maintain Markdown standards, you can read more [here](https://www.markdownguide.org/basic-syntax/), this includes: - Headings (`#`, `##`, etc.) should be placed in order. - Use trailing white space or the
HTML tag at the end of the line. diff --git a/README.md b/README.md index b2cf3f07c..c9b15e35e 100644 --- a/README.md +++ b/README.md @@ -39,4 +39,4 @@ If you want to say thank you and/or support the active development of GoFr: 1. Add a [GitHub Star](https://github.com/gofr-dev/gofr/stargazers) to the project. 2. Write a review or tutorial on [Medium](https://medium.com/), [Dev.to](https://dev.to/) or personal blog. -3. Visit [CONTRIBUTING](CONTRIBUTING.md) for details on submitting patches and the contribution workflow. After your PR is merged to the repo, fill the [google form](https://forms.gle/R1Yz7ZzY3U5WWTgy5), and we will send you a GoFr T-Shirt and Stickers as a token of appreciation. +3. Visit [CONTRIBUTING](CONTRIBUTING.md) for details on submitting patches and the contribution workflow. After your PR is merged to the repo, fill the [Google Form](https://forms.gle/R1Yz7ZzY3U5WWTgy5), and we will send you a GoFr T-Shirt and Stickers as a token of appreciation. diff --git a/SECURITY.md b/SECURITY.md index c2095bc10..f6def206b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -11,4 +11,4 @@ Following versions are being supported for security updates. ## Reporting a Vulnerability -To report a vulnerability, please file an issue on this repo and add "security" label. Security related issues will be prioritised over others. We strive to triage the issue within a single working day. +To report a vulnerability, please file an issue on this repo and add "security" label. Security related issues will be prioritized over others. We strive to triage the issue within a single working day. diff --git a/docs/advanced-guide/grpc/page.md b/docs/advanced-guide/grpc/page.md index 61e4c8be4..0fc8b34c8 100644 --- a/docs/advanced-guide/grpc/page.md +++ b/docs/advanced-guide/grpc/page.md @@ -120,4 +120,4 @@ func main() { app.Run() } ``` ->Note: By default, grpc server will run on port 9000, to customize the port users can set GRPC_PORT config in the .env \ No newline at end of file +>Note: By default, gRPC server will run on port 9000, to customize the port users can set `GRPC_PORT` config in the .env \ No newline at end of file diff --git a/docs/advanced-guide/handling-data-migrations/page.md b/docs/advanced-guide/handling-data-migrations/page.md index 8b65a3bd9..5ce4d7bc1 100644 --- a/docs/advanced-guide/handling-data-migrations/page.md +++ b/docs/advanced-guide/handling-data-migrations/page.md @@ -46,7 +46,7 @@ func createTableEmployee() migration.Migrate { } ``` -`migration.Datasource` have the datasources whose migrations are supported i.e. Redis and SQL (MySQL and PostgreSQL). +`migration.Datasource` have the datasources whose migrations are supported i.e., Redis and SQL (MySQL and PostgreSQL). All migrations always run in a transaction. For MySQL it is highly recommended to use `IF EXISTS` and `IF NOT EXIST` in DDL commands as MySQL implicitly commits these commands. @@ -147,7 +147,7 @@ Value : {"method":"UP","startTime":"2024-02-26T15:03:46.844558+05:30","duration" Where, -**Version** : Migration version is the number provided in the map, i.e. sequence number. +**Version** : Migration version is the number provided in the map, i.e., sequence number. **Start Time** : Time when Migration Started in UTC. diff --git a/docs/advanced-guide/overriding-default/page.md b/docs/advanced-guide/overriding-default/page.md index 9ede5d258..3f5cc9f60 100644 --- a/docs/advanced-guide/overriding-default/page.md +++ b/docs/advanced-guide/overriding-default/page.md @@ -4,7 +4,7 @@ GoFr allows overriding default behavior of its features. ## Raw response format -GoFr by default wraps a handler's return value and assigns it to the "data" field in a response. +GoFr by default wraps a handler's return value and assigns it to the `data` field in a response. ### Example diff --git a/docs/advanced-guide/publishing-custom-metrics/page.md b/docs/advanced-guide/publishing-custom-metrics/page.md index 33eb14249..b84df0f52 100644 --- a/docs/advanced-guide/publishing-custom-metrics/page.md +++ b/docs/advanced-guide/publishing-custom-metrics/page.md @@ -5,10 +5,10 @@ GoFr publishes some {% new-tab-link newtab=false title="default metrics" href="/ GoFr can handle multiple different metrics concurrently, each uniquely identified by its name during initialization. It supports the following {% new-tab-link title="metrics" href="https://opentelemetry.io/docs/specs/otel/metrics/" /%} types in Prometheus format: -1. Counter -2. UpDownCounter -3. Histogram -4. Gauge +1. `Counter` +2. `UpDownCounter` +3. `Histogram` +4. `Gauge` If any custom metric is required, it can be created by using custom metrics as shown below: @@ -45,7 +45,7 @@ func main() { ## 2. UpDown Counter Metrics -UpDownCounter is a {% new-tab-link title="synchronous Instrument" href="https://opentelemetry.io/docs/specs/otel/metrics/api/#synchronous-instrument-api" /%} which supports increments and decrements. +`UpDownCounter` is a {% new-tab-link title="synchronous Instrument" href="https://opentelemetry.io/docs/specs/otel/metrics/api/#synchronous-instrument-api" /%} which supports increments and decrements. Note: If the value is monotonically increasing, use Counter instead. ### Usage diff --git a/docs/advanced-guide/swagger-documentation/page.md b/docs/advanced-guide/swagger-documentation/page.md index d6bd04b0b..9b4839323 100644 --- a/docs/advanced-guide/swagger-documentation/page.md +++ b/docs/advanced-guide/swagger-documentation/page.md @@ -8,7 +8,7 @@ easily provide interactive API documentation for your users. OpenAPI, also known as Swagger, is a specification for building APIs. An OpenAPI file allows you to describe your entire API, including: - Available endpoints (/users) and operations on each endpoint (GET /users, DELETE /users/{id}) -- Operation parameters, input and output for each operation +- Operation parameters, input, and output for each operation - Authentication methods - Contact information, license, terms of use, and other information. @@ -17,7 +17,7 @@ The complete OpenAPI Specification can be found on the official [Swagger website ## Enabling GoFr to render your openapi.json file -To allow GoFr to render your openapi documentation,simply place your `openapi.json` file inside the `static` directory of your project. +To allow GoFr to render your OpenAPI documentation, simply place your `openapi.json` file inside the `static` directory of your project. GoFr will automatically render the Swagger documentation at the `/.well-known/swagger` endpoint. Here are the steps: diff --git a/docs/advanced-guide/using-cron/page.md b/docs/advanced-guide/using-cron/page.md index 4a3d3e659..8e0ef64a8 100644 --- a/docs/advanced-guide/using-cron/page.md +++ b/docs/advanced-guide/using-cron/page.md @@ -24,7 +24,7 @@ range of values for which the cron should run and `*/n` to define number of time ## Adding cron jobs in GoFr applications Adding cron jobs to GoFr applications is made easy with a simple injection of user's function to the cron table maintained -by the gofr. The minimum time difference between cron job's two consecutive runs is a minute as it is the least significant +by the GoFr. The minimum time difference between cron job's two consecutive runs is a minute as it is the least significant scheduling time parameter. ```go app.AddCronJob("* * * * *", "job-name", func(ctx *gofr.Context) { diff --git a/docs/page.md b/docs/page.md index 35c19aa65..1740aa4a7 100644 --- a/docs/page.md +++ b/docs/page.md @@ -1,6 +1,6 @@ # Getting started -GoFr is Opinionated Web Framework written in Go (Golang). It helps in building robust and scalable applications. This framework is designed to offer a user-friendly and familiar abstraction for all the developers . We prioritize simplicity over complexity. +GoFr is Opinionated Web Framework written in Go (Golang). It helps in building robust and scalable applications. This framework is designed to offer a user-friendly and familiar abstraction for all the developers. We prioritize simplicity over complexity. In this section we will walk through what GoFr is, what problems it solves, and how it can help in building your project. diff --git a/docs/quick-start/add-rest-handlers/page.md b/docs/quick-start/add-rest-handlers/page.md index 54650e144..e858fbec6 100644 --- a/docs/quick-start/add-rest-handlers/page.md +++ b/docs/quick-start/add-rest-handlers/page.md @@ -95,7 +95,7 @@ func main() { } ``` -In this example, we define a user struct representing a database entity. The GetAll method in the provided code demonstrates how to override the default behavior for retrieving all entities. +In this example, we define a user struct representing a database entity. The `GetAll` method in the provided code demonstrates how to override the default behavior for retrieving all entities. This method can be used to implement custom logic for filtering, sorting, or retrieving additional data along with the entities. diff --git a/docs/quick-start/configuration/page.md b/docs/quick-start/configuration/page.md index 5369cbe87..022efc31e 100644 --- a/docs/quick-start/configuration/page.md +++ b/docs/quick-start/configuration/page.md @@ -2,7 +2,7 @@ GoFr simplifies configuration management by reading configuration via environment variables. Application code is decoupled from how configuration is managed as per the {%new-tab-link title="12-factor" href="https://12factor.net/config" %}. -Configs in GoFr can be used to initialise datasources, tracing, setting log levels, changing default HTTP or metrics port. +Configs in GoFr can be used to initialize datasources, tracing, setting log levels, changing default HTTP or metrics port. This abstraction provides a user-friendly interface for configuring user's application without modifying the code itself. To set configs create a `configs` directory in the project's root and add `.env` file. diff --git a/docs/quick-start/introduction/page.md b/docs/quick-start/introduction/page.md index af874704e..f3893b7f5 100644 --- a/docs/quick-start/introduction/page.md +++ b/docs/quick-start/introduction/page.md @@ -63,13 +63,13 @@ The `hello-world` server involves three essential steps: 1. **Creating GoFr Server:** - When `gofr.New()` is called, it initializes the framework and handles various setup tasks like initialising logger, metrics, datasources etc based on the configs. + When `gofr.New()` is called, it initializes the framework and handles various setup tasks like initializing logger, metrics, datasources, etc. based on the configs. - _This single line is a standard part of all gofr servers._ + _This single line is a standard part of all GoFr servers._ 2. **Attaching a Handler to a Path:** - In this step, the server is instructed to associate an HTTP request with a specific handler function. This is achieved through `app.GET("/greet", HandlerFunction)`, where _GET /greet_ maps to HandlerFunction. Likewise, `app.POST("/todo", ToDoCreationHandler)` links a _POST_ request to the /todo endpoint with _ToDoCreationHandler_. + In this step, the server is instructed to associate an HTTP request with a specific handler function. This is achieved through `app.GET("/greet", HandlerFunction)`, where _GET /greet_ maps to HandlerFunction. Likewise, `app.POST("/todo", ToDoCreationHandler)` links a _POST_ request to the `/todo` endpoint with _ToDoCreationHandler_. **Good To Know** diff --git a/docs/quick-start/observability/page.md b/docs/quick-start/observability/page.md index 95d9b919f..43f1ad2c1 100644 --- a/docs/quick-start/observability/page.md +++ b/docs/quick-start/observability/page.md @@ -27,7 +27,7 @@ Metrics play a pivotal role in fault detection and troubleshooting, offering vis They are instrumental in measuring and meeting service-level agreements (SLAs) to ensure expected performance and reliability. -GoFr publishes metrics to port: _2121_ on _/metrics_ endpoint in prometheus format. +GoFr publishes metrics to port: _2121_ on _/metrics_ endpoint in Prometheus format. {% table %} @@ -139,7 +139,7 @@ GoFr also supports creating {% new-tab-link newtab=false title="custom metrics" ## Tracing -{% new-tab-link title="Tracing" href="https://opentelemetry.io/docs/concepts/signals/#traces" /%} is a powerful tool for gaining insights into your application's behaviour, identifying bottlenecks, and improving +{% new-tab-link title="Tracing" href="https://opentelemetry.io/docs/concepts/signals/#traces" /%} is a powerful tool for gaining insights into your application's behavior, identifying bottlenecks, and improving system performance. A trace is a tree of spans. It is a collective of observable signals showing the path of work through a system. A trace on its own is distinguishable by a `TraceID`. diff --git a/examples/using-cron-jobs/main.go b/examples/using-cron-jobs/main.go index e18ac489a..a83ff04f0 100644 --- a/examples/using-cron-jobs/main.go +++ b/examples/using-cron-jobs/main.go @@ -23,7 +23,7 @@ func main() { // setting the maximum duration of this application time.Sleep(duration * time.Minute) - // not running the app to close after we have completed the crons runnning + // not running the app to close after we have completed the crons running // since this is an example the cron will not be running forever // to run cron forever, users can start the metric server or normal HTTP server // app.Run() diff --git a/examples/using-file-bind/README.md b/examples/using-file-bind/README.md index 6b000bccd..ef74f96a5 100644 --- a/examples/using-file-bind/README.md +++ b/examples/using-file-bind/README.md @@ -1,7 +1,7 @@ # Using File Bind Example This GoFr example demonstrates the use of context Bind where incoming request has multipart-form data and then binds -it to the fields of the struct. GoFr currently supports zip file type and also binds the more generic multipart.FileHeader +it to the fields of the struct. GoFr currently supports zip file type and also binds the more generic [`multipart.FileHeader`](https://pkg.go.dev/mime/multipart#FileHeader) ### Usage ```go diff --git a/examples/using-file-bind/main.go b/examples/using-file-bind/main.go index 6c8e3243f..aa813504e 100644 --- a/examples/using-file-bind/main.go +++ b/examples/using-file-bind/main.go @@ -63,6 +63,6 @@ func UploadHandler(c *gofr.Context) (interface{}, error) { return false, err } - // return the number of compressed files recieved + // return the number of compressed files received return fmt.Sprintf("zipped files: %d, len of file `a`: %d", len(d.Compressed.Files), len(content)), nil } diff --git a/pkg/gofr/cron_test.go b/pkg/gofr/cron_test.go index 77681432f..8fba83fed 100644 --- a/pkg/gofr/cron_test.go +++ b/pkg/gofr/cron_test.go @@ -115,7 +115,7 @@ func TestCron_parseSchedule_Error(t *testing.T) { expErrString string }{ { - desc: "incorrect numnber of schedule parts: less", + desc: "incorrect number of schedule parts: less", schedules: []string{"* * * * ", "* * * * * *"}, expErrString: "schedule string must have five components like * * * * *", }, diff --git a/pkg/gofr/datasource/README.md b/pkg/gofr/datasource/README.md index cf0010254..e6d6c32d5 100644 --- a/pkg/gofr/datasource/README.md +++ b/pkg/gofr/datasource/README.md @@ -54,7 +54,7 @@ Therefore, GoFr utilizes a pluggable approach for new datasources by separating - Interface Definition: Create an interface with required methods within the datasource package. - Register the interface with the container (similar to Mongo in https://github.com/tfogo/mongodb-go-tutorial). + Register the interface with the container (similar to MongoDB in https://github.com/tfogo/mongodb-go-tutorial). - Method Registration: diff --git a/pkg/gofr/datasource/mongo/logger.go b/pkg/gofr/datasource/mongo/logger.go index 9d955878b..a3337d53f 100644 --- a/pkg/gofr/datasource/mongo/logger.go +++ b/pkg/gofr/datasource/mongo/logger.go @@ -10,7 +10,7 @@ import ( type Logger interface { Debugf(pattern string, args ...interface{}) Logf(pattern string, args ...interface{}) - Errorf(patter string, args ...interface{}) + Errorf(pattern string, args ...interface{}) } type QueryLog struct { diff --git a/pkg/gofr/datasource/mongo/mock_logger.go b/pkg/gofr/datasource/mongo/mock_logger.go index 1c44c1002..794ea8b97 100644 --- a/pkg/gofr/datasource/mongo/mock_logger.go +++ b/pkg/gofr/datasource/mongo/mock_logger.go @@ -37,8 +37,8 @@ func (m *MockLogger) Logf(pattern string, args ...interface{}) { m.logf(INFO, pattern, args...) } -func (m *MockLogger) Errorf(patter string, args ...interface{}) { - m.logf(ERROR, patter, args...) +func (m *MockLogger) Errorf(pattern string, args ...interface{}) { + m.logf(ERROR, pattern, args...) } func (m *MockLogger) logf(level Level, format string, args ...interface{}) { diff --git a/pkg/gofr/datasource/redis/hook_test.go b/pkg/gofr/datasource/redis/hook_test.go index f0bd7d5bd..96a690d4b 100644 --- a/pkg/gofr/datasource/redis/hook_test.go +++ b/pkg/gofr/datasource/redis/hook_test.go @@ -14,7 +14,7 @@ func TestQueryLog_PrettyPrint(t *testing.T) { expOut []string }{ { - desc: "pipleine", + desc: "pipeline", ql: &QueryLog{ Query: "pipeline", Duration: 112, diff --git a/pkg/gofr/datasource/sql/sql_test.go b/pkg/gofr/datasource/sql/sql_test.go index 49b5a9f66..f7cd780e5 100644 --- a/pkg/gofr/datasource/sql/sql_test.go +++ b/pkg/gofr/datasource/sql/sql_test.go @@ -37,7 +37,7 @@ func TestNewSQL_ErrorCase(t *testing.T) { }) if !strings.Contains(testLogs, expectedLog) { - t.Errorf("TestNewSQL_ErrorCase Failed! Expcted error log doesn't match actual.") + t.Errorf("TestNewSQL_ErrorCase Failed! Expected error log doesn't match actual.") } } @@ -57,7 +57,7 @@ func TestNewSQL_InvalidDialect(t *testing.T) { }) if !strings.Contains(testLogs, errUnsupportedDialect.Error()) { - t.Errorf("TestNewSQL_ErrorCase Failed! Expcted error log doesn't match actual.") + t.Errorf("TestNewSQL_ErrorCase Failed! Expected error log doesn't match actual.") } } From 95c51a6dfddf4978f71c032aa5ea7bf6cfa36dd0 Mon Sep 17 00:00:00 2001 From: Aryan Mehrotra <44036979+aryanmehrotra@users.noreply.github.com> Date: Thu, 27 Jun 2024 11:20:40 +0530 Subject: [PATCH 13/17] Fix/codeql (#763) Co-authored-by: Srijan Rastogi <44723623+srijan-27@users.noreply.github.com> --- pkg/gofr/http/router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/gofr/http/router.go b/pkg/gofr/http/router.go index 9b8c8ca5d..48c3ecee1 100644 --- a/pkg/gofr/http/router.go +++ b/pkg/gofr/http/router.go @@ -69,7 +69,7 @@ func (staticConfig staticFileConfig) staticHandler(fileServer http.Handler) http const defaultSwaggerFileName = "openapi.json" - if _, err := os.Stat(filepath.Join(staticConfig.directoryName, url)); fileName == defaultSwaggerFileName && err == nil { + if _, err := os.Stat(filepath.Clean(filepath.Join(staticConfig.directoryName, url))); fileName == defaultSwaggerFileName && err == nil { w.WriteHeader(http.StatusForbidden) _, _ = w.Write([]byte("403 forbidden")) From 261b5dce1f49e52d0f009d92a7b5f4d3b8e3b286 Mon Sep 17 00:00:00 2001 From: Srijan Rastogi <44723623+srijan-27@users.noreply.github.com> Date: Thu, 27 Jun 2024 11:31:40 +0530 Subject: [PATCH 14/17] fix go mod for using-cron and using-websocket example (#767) --- examples/using-cron-jobs/go.mod | 6 +++--- examples/using-cron-jobs/go.sum | 3 +++ examples/using-web-socket/go.mod | 6 +++--- examples/using-web-socket/go.sum | 3 +++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/examples/using-cron-jobs/go.mod b/examples/using-cron-jobs/go.mod index 5578b2e70..35f75826b 100644 --- a/examples/using-cron-jobs/go.mod +++ b/examples/using-cron-jobs/go.mod @@ -11,7 +11,7 @@ require ( require ( cloud.google.com/go v0.115.0 // indirect - cloud.google.com/go/auth v0.5.1 // indirect + cloud.google.com/go/auth v0.6.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect cloud.google.com/go/compute/metadata v0.3.0 // indirect cloud.google.com/go/iam v1.1.8 // indirect @@ -37,7 +37,7 @@ require ( github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.4 // indirect + github.com/googleapis/gax-go/v2 v2.12.5 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect @@ -85,7 +85,7 @@ require ( golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - google.golang.org/api v0.185.0 // indirect + google.golang.org/api v0.186.0 // indirect google.golang.org/genproto v0.0.0-20240617180043-68d350f18fd4 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // indirect diff --git a/examples/using-cron-jobs/go.sum b/examples/using-cron-jobs/go.sum index c25a2dcf3..f7ab7f205 100644 --- a/examples/using-cron-jobs/go.sum +++ b/examples/using-cron-jobs/go.sum @@ -4,6 +4,7 @@ cloud.google.com/go v0.114.0/go.mod h1:ZV9La5YYxctro1HTPug5lXH/GefROyW8PPD4T8n9J cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= cloud.google.com/go/auth v0.5.1 h1:0QNO7VThG54LUzKiQxv8C6x1YX7lUrzlAa1nVLF8CIw= cloud.google.com/go/auth v0.5.1/go.mod h1:vbZT8GjzDf3AVqCcQmqeeM32U9HBFc32vVVAbwDsa6s= +cloud.google.com/go/auth v0.6.0/go.mod h1:b4acV+jLQDyjwm4OXHYjNvRi4jvGBzHWJRtJcy+2P4g= cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q= cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= @@ -111,6 +112,7 @@ github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfF github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.12.4 h1:9gWcmF85Wvq4ryPFvGFaOgPIs1AQX0d0bcbGw4Z96qg= github.com/googleapis/gax-go/v2 v2.12.4/go.mod h1:KYEYLorsnIGDi/rPC8b5TdlB9kbKoFubselGIoBMCwI= +github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= @@ -363,6 +365,7 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T google.golang.org/api v0.184.0 h1:dmEdk6ZkJNXy1JcDhn/ou0ZUq7n9zropG2/tR4z+RDg= google.golang.org/api v0.184.0/go.mod h1:CeDTtUEiYENAf8PPG5VZW2yNp2VM3VWbCeTioAZBTBA= google.golang.org/api v0.185.0/go.mod h1:HNfvIkJGlgrIlrbYkAm9W9IdkmKZjOTVh33YltygGbg= +google.golang.org/api v0.186.0/go.mod h1:hvRbBmgoje49RV3xqVXrmP6w93n6ehGgIVPYrGtBFFc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= diff --git a/examples/using-web-socket/go.mod b/examples/using-web-socket/go.mod index 1fa657d0e..0f6585bda 100644 --- a/examples/using-web-socket/go.mod +++ b/examples/using-web-socket/go.mod @@ -12,7 +12,7 @@ replace gofr.dev v1.8.1 => ../../../gofr require ( cloud.google.com/go v0.115.0 // indirect - cloud.google.com/go/auth v0.5.1 // indirect + cloud.google.com/go/auth v0.6.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect cloud.google.com/go/compute/metadata v0.3.0 // indirect cloud.google.com/go/iam v1.1.8 // indirect @@ -38,7 +38,7 @@ require ( github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.4 // indirect + github.com/googleapis/gax-go/v2 v2.12.5 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect @@ -85,7 +85,7 @@ require ( golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - google.golang.org/api v0.185.0 // indirect + google.golang.org/api v0.186.0 // indirect google.golang.org/genproto v0.0.0-20240617180043-68d350f18fd4 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // indirect diff --git a/examples/using-web-socket/go.sum b/examples/using-web-socket/go.sum index c25a2dcf3..f7ab7f205 100644 --- a/examples/using-web-socket/go.sum +++ b/examples/using-web-socket/go.sum @@ -4,6 +4,7 @@ cloud.google.com/go v0.114.0/go.mod h1:ZV9La5YYxctro1HTPug5lXH/GefROyW8PPD4T8n9J cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= cloud.google.com/go/auth v0.5.1 h1:0QNO7VThG54LUzKiQxv8C6x1YX7lUrzlAa1nVLF8CIw= cloud.google.com/go/auth v0.5.1/go.mod h1:vbZT8GjzDf3AVqCcQmqeeM32U9HBFc32vVVAbwDsa6s= +cloud.google.com/go/auth v0.6.0/go.mod h1:b4acV+jLQDyjwm4OXHYjNvRi4jvGBzHWJRtJcy+2P4g= cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q= cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= @@ -111,6 +112,7 @@ github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfF github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.12.4 h1:9gWcmF85Wvq4ryPFvGFaOgPIs1AQX0d0bcbGw4Z96qg= github.com/googleapis/gax-go/v2 v2.12.4/go.mod h1:KYEYLorsnIGDi/rPC8b5TdlB9kbKoFubselGIoBMCwI= +github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= @@ -363,6 +365,7 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T google.golang.org/api v0.184.0 h1:dmEdk6ZkJNXy1JcDhn/ou0ZUq7n9zropG2/tR4z+RDg= google.golang.org/api v0.184.0/go.mod h1:CeDTtUEiYENAf8PPG5VZW2yNp2VM3VWbCeTioAZBTBA= google.golang.org/api v0.185.0/go.mod h1:HNfvIkJGlgrIlrbYkAm9W9IdkmKZjOTVh33YltygGbg= +google.golang.org/api v0.186.0/go.mod h1:hvRbBmgoje49RV3xqVXrmP6w93n6ehGgIVPYrGtBFFc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= From c5154ce856dcd9b755c572cada587cefb394f313 Mon Sep 17 00:00:00 2001 From: srijan-27 Date: Thu, 27 Jun 2024 12:16:01 +0530 Subject: [PATCH 15/17] add labels explanation and usage --- .../publishing-custom-metrics/page.md | 72 ++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/docs/advanced-guide/publishing-custom-metrics/page.md b/docs/advanced-guide/publishing-custom-metrics/page.md index b84df0f52..f6b007760 100644 --- a/docs/advanced-guide/publishing-custom-metrics/page.md +++ b/docs/advanced-guide/publishing-custom-metrics/page.md @@ -64,7 +64,7 @@ func main() { app.Metrics().NewUpDownCounter("total_credit_day_sale", "used to track the total credit sales in a day") app.POST("/sale", func(ctx *gofr.Context) (interface{}, error) { - ctx.Metrics().IncrementCounter(ctx, "total_credit_day_sale") + ctx.Metrics().DeltaUpDownCounter(ctx, "total_credit_day_sale", 1000) return "Sale Completed", nil }) @@ -139,6 +139,76 @@ func main() { } ``` +## Adding Labels to Custom Metrics + +GoFr leverages metrics support by enabling labels. Labels are a key feature in metrics that allow you to categorize and filter metrics based on relevant information. + +### Understanding Labels + +Labels are key-value pairs attached to metrics. They provide additional context about the metric data. + +Common examples of labels include: +- environment: (e.g., "production", "staging") +- service: (e.g., "api-gateway", "database") +- status: (e.g., "success", "failure") + +By adding labels, you can create different time series for the same metric based on the label values. +This allows for more granular analysis and visualization in Grafana (or any other) dashboards. + +### Additional Considerations + +- Prefer to keep the number of labels manageable to avoid overwhelming complexity. +- Choose meaningful label names that clearly describe the data point. +- Ensure consistency in label naming conventions across your application. + +By effectively using labels in GoFr, you can enrich your custom metrics and gain deeper insights into your application's performance and behavior. + +### Usage: + +Labels are added while populating the data for metrics, by passing them as arguments (comma separated key-value pairs) +in the GoFr's methods (namely: `IncreamentCounter`, `DeltaUpDownCounter`, `RecordHistogram`, `SetGauge`). + +Example: `c.Metrics().IncrementCounter(c, "metric-name", "metric-value", "label-1", "value-1", "label-2", "value-2")` + +```go +package main + +import ( + "gofr.dev/pkg/gofr" +) + +func main() { + // Initialise gofr object + a := gofr.New() + + // Add custom metrics + a.Metrics().NewUpDownCounter("total_credit_day_sale", "used to track the total credit sales in a day") + + // Add all the routes + a.POST("/sale", SaleHandler) + a.POST("/return", ReturnHandler) + + // Run the application + a.Run() +} + +func SaleHandler(c *gofr.Context) (interface{}, error) { + // logic to create sales + + c.Metrics().DeltaUpDownCounter(c, "total_credit_day_sale", 10, "sale_type", "credit", "product_type", "beverage") // Here "sale_type" & "product_type" are the labels and "credit" & "beverage" are the values + + return "Sale Successful", nil +} + +func ReturnHandler(c *gofr.Context) (interface{}, error) { + // logic to create a sales return + + c.Metrics().DeltaUpDownCounter(c, "total_credit_day_sale", -5, "sale_type", "credit_return", "product_type", "dairy") + + return "Return Successful", nil +} +``` + **Good To Know** ```doc From 1b561199fa73aff1d7f34db17c7e36e0d5ccf431 Mon Sep 17 00:00:00 2001 From: Umang Mundhra Date: Fri, 28 Jun 2024 14:37:39 +0530 Subject: [PATCH 16/17] update remote level response (#770) --- .../remote-log-level-change/page.md | 10 ++-- .../remotelogger/dynamicLevelLogger.go | 13 +++-- .../remotelogger/dynamicLevelLogger_test.go | 49 +++++++++---------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/docs/advanced-guide/remote-log-level-change/page.md b/docs/advanced-guide/remote-log-level-change/page.md index 2191f3ae4..b7946c5f5 100644 --- a/docs/advanced-guide/remote-log-level-change/page.md +++ b/docs/advanced-guide/remote-log-level-change/page.md @@ -33,12 +33,10 @@ The remote log level endpoint should return a JSON response in the following for ```json { - "data": [ - { - "serviceName": "sample-service", - "logLevel": "DEBUG" - } - ] + "data": { + "serviceName": "test-service", + "logLevel": "DEBUG" + } } ``` diff --git a/pkg/gofr/logging/remotelogger/dynamicLevelLogger.go b/pkg/gofr/logging/remotelogger/dynamicLevelLogger.go index d6ed4ed73..42ba3acc3 100644 --- a/pkg/gofr/logging/remotelogger/dynamicLevelLogger.go +++ b/pkg/gofr/logging/remotelogger/dynamicLevelLogger.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "io" + "slices" "strconv" "time" @@ -81,9 +82,9 @@ func fetchAndUpdateLogLevel(remoteService service.HTTP, currentLevel logging.Lev defer resp.Body.Close() var response struct { - Data []struct { - ServiceName string `json:"serviceName"` - Level map[string]string `json:"logLevel"` + Data struct { + ServiceName string `json:"serviceName"` + Level string `json:"logLevel"` } `json:"data"` } @@ -97,8 +98,10 @@ func fetchAndUpdateLogLevel(remoteService service.HTTP, currentLevel logging.Lev return currentLevel, err } - if len(response.Data) > 0 { - newLevel := logging.GetLevelFromString(response.Data[0].Level["LOG_LEVEL"]) + logLevels := []string{"DEBUG", "INFO", "NOTICE", "WARN", "ERROR", "FATAL"} + + if slices.Contains(logLevels, response.Data.Level) && response.Data.ServiceName != "" { + newLevel := logging.GetLevelFromString(response.Data.Level) return newLevel, nil } diff --git a/pkg/gofr/logging/remotelogger/dynamicLevelLogger_test.go b/pkg/gofr/logging/remotelogger/dynamicLevelLogger_test.go index e0ab84456..71bda6f4d 100644 --- a/pkg/gofr/logging/remotelogger/dynamicLevelLogger_test.go +++ b/pkg/gofr/logging/remotelogger/dynamicLevelLogger_test.go @@ -1,7 +1,6 @@ package remotelogger import ( - "fmt" "net/http" "net/http/httptest" "strings" @@ -9,8 +8,6 @@ import ( "time" "github.com/stretchr/testify/assert" - "go.uber.org/mock/gomock" - "gofr.dev/pkg/gofr/logging" "gofr.dev/pkg/gofr/service" "gofr.dev/pkg/gofr/testutil" @@ -20,7 +17,7 @@ func TestRemoteLogger_UpdateLevel(t *testing.T) { mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json") - body := `{"data":[{"serviceName":"test-service","logLevel":{"LOG_LEVEL":"DEBUG"}}]}` + body := `{ "data": { "serviceName": "test-service","logLevel":"DEBUG" } }` _, _ = w.Write([]byte(body)) })) @@ -53,16 +50,29 @@ func TestRemoteLogger_UpdateLevelError(t *testing.T) { assert.Equal(t, logging.INFO, rl.currentLevel) } -func Test_fetchAndUpdateLogLevel_ErrorCases(t *testing.T) { +func Test_fetchAndUpdateLogLevel_InvalidResponse(t *testing.T) { logger := logging.NewMockLogger(logging.INFO) - ctrl := gomock.NewController(t) - mockMetrics := service.NewMockMetrics(ctrl) + mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "application/json") + + body := `{ "data": { "serviceName": "test-service","logLevel":"TEST" } }` + + _, _ = w.Write([]byte(body)) + })) + defer mockServer.Close() + + remoteService := service.NewHTTPService(mockServer.URL, logger, nil) + + level, err := fetchAndUpdateLogLevel(remoteService, logging.DEBUG) - mockMetrics.EXPECT().RecordHistogram(gomock.Any(), "app_http_service_response", gomock.Any(), "path", gomock.Any(), - "method", http.MethodGet, "status", fmt.Sprintf("%v", http.StatusInternalServerError)) + assert.Equal(t, logging.DEBUG, level, "Test_fetchAndUpdateLogLevel_InvalidResponse, Failed.\n") + + assert.Nil(t, err) +} - remoteService := service.NewHTTPService("http://", logger, mockMetrics) +func Test_fetchAndUpdateLogLevel_InvalidLogLevel(t *testing.T) { + logger := logging.NewMockLogger(logging.INFO) mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json") @@ -81,22 +91,11 @@ func Test_fetchAndUpdateLogLevel_ErrorCases(t *testing.T) { remoteService2 := service.NewHTTPService(mockServer.URL, logger, nil) - tests := []struct { - desc string - remoteService service.HTTP - currentLogLevel logging.Level - }{ - {"invalid URL for remote service", remoteService, logging.INFO}, - {"invalid response from remote service", remoteService2, logging.DEBUG}, - } - - for i, tc := range tests { - level, err := fetchAndUpdateLogLevel(tc.remoteService, tc.currentLogLevel) + level, err := fetchAndUpdateLogLevel(remoteService2, logging.DEBUG) - assert.Equal(t, tc.currentLogLevel, level, "TEST[%d], Failed.\n%s", i, tc.desc) + assert.Equal(t, logging.DEBUG, level, "Test_fetchAndUpdateLogLevel_InvalidResponse, Failed.\n") - assert.NotNil(t, err) - } + assert.NotNil(t, err) } func TestDynamicLoggerSuccess(t *testing.T) { @@ -104,7 +103,7 @@ func TestDynamicLoggerSuccess(t *testing.T) { mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json") - body := `{"data":[{"serviceName":"test-service","logLevel":{"LOG_LEVEL":"DEBUG"}}]}` + body := `{ "data": { "serviceName": "test-service","logLevel":"DEBUG" } }` _, _ = w.Write([]byte(body)) })) From cdf62fd4d6b0d9e5f080ba6e843b846e1b8d7f36 Mon Sep 17 00:00:00 2001 From: srijan-27 Date: Fri, 28 Jun 2024 16:15:54 +0530 Subject: [PATCH 17/17] udpate framework version --- pkg/gofr/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/gofr/version/version.go b/pkg/gofr/version/version.go index 1b4e510ae..26b076074 100644 --- a/pkg/gofr/version/version.go +++ b/pkg/gofr/version/version.go @@ -1,3 +1,3 @@ package version -const Framework = "v1.11.0" +const Framework = "v1.12.0"