diff --git a/docs/api/README.md b/docs/api/README.md index 7e5da659d..616d7e693 100644 --- a/docs/api/README.md +++ b/docs/api/README.md @@ -463,6 +463,7 @@ Accept: application/json "data": [ { "responseType": "string", + "logID": 0, "data": { "insertedAt": "2019-08-24T14:15:22Z", "timestamp": "2019-08-24T14:15:22Z", @@ -3655,6 +3656,7 @@ and "data": [ { "responseType": "string", + "logID": 0, "data": { "insertedAt": "2019-08-24T14:15:22Z", "timestamp": "2019-08-24T14:15:22Z", @@ -3760,6 +3762,7 @@ and ```json { "responseType": "string", + "logID": 0, "data": { "insertedAt": "2019-08-24T14:15:22Z", "timestamp": "2019-08-24T14:15:22Z", @@ -3888,7 +3891,8 @@ xor ```json { - "responseType": "string" + "responseType": "string", + "logID": 0 } ``` @@ -3898,6 +3902,7 @@ xor |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |responseType|string|true|none|none| +|logID|integer|true|none|none|

V2BulkElementResultCreateTransaction

@@ -3909,6 +3914,7 @@ xor ```json { "responseType": "string", + "logID": 0, "data": { "insertedAt": "2019-08-24T14:15:22Z", "timestamp": "2019-08-24T14:15:22Z", @@ -4020,7 +4026,8 @@ and ```json { - "responseType": "string" + "responseType": "string", + "logID": 0 } ``` @@ -4039,6 +4046,7 @@ and ```json { "responseType": "string", + "logID": 0, "data": { "insertedAt": "2019-08-24T14:15:22Z", "timestamp": "2019-08-24T14:15:22Z", @@ -4150,7 +4158,8 @@ and ```json { - "responseType": "string" + "responseType": "string", + "logID": 0 } ``` @@ -4169,6 +4178,7 @@ and ```json { "responseType": "string", + "logID": 0, "errorCode": "string", "errorDescription": "string", "errorDetails": "string" diff --git a/internal/api/common/mocks_ledger_controller_test.go b/internal/api/common/mocks_ledger_controller_test.go index 3b9b07eaf..cfa5e8724 100644 --- a/internal/api/common/mocks_ledger_controller_test.go +++ b/internal/api/common/mocks_ledger_controller_test.go @@ -70,12 +70,13 @@ func (mr *LedgerControllerMockRecorder) CountTransactions(ctx, query any) *gomoc } // CreateTransaction mocks base method. -func (m *LedgerController) CreateTransaction(ctx context.Context, parameters ledger0.Parameters[ledger0.RunScript]) (*ledger.CreatedTransaction, error) { +func (m *LedgerController) CreateTransaction(ctx context.Context, parameters ledger0.Parameters[ledger0.RunScript]) (*ledger.Log, *ledger.CreatedTransaction, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateTransaction", ctx, parameters) - ret0, _ := ret[0].(*ledger.CreatedTransaction) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(*ledger.CreatedTransaction) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } // CreateTransaction indicates an expected call of CreateTransaction. @@ -85,11 +86,12 @@ func (mr *LedgerControllerMockRecorder) CreateTransaction(ctx, parameters any) * } // DeleteAccountMetadata mocks base method. -func (m *LedgerController) DeleteAccountMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.DeleteAccountMetadata]) error { +func (m *LedgerController) DeleteAccountMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.DeleteAccountMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteAccountMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // DeleteAccountMetadata indicates an expected call of DeleteAccountMetadata. @@ -99,11 +101,12 @@ func (mr *LedgerControllerMockRecorder) DeleteAccountMetadata(ctx, parameters an } // DeleteTransactionMetadata mocks base method. -func (m *LedgerController) DeleteTransactionMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.DeleteTransactionMetadata]) error { +func (m *LedgerController) DeleteTransactionMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.DeleteTransactionMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteTransactionMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // DeleteTransactionMetadata indicates an expected call of DeleteTransactionMetadata. @@ -291,12 +294,13 @@ func (mr *LedgerControllerMockRecorder) ListTransactions(ctx, query any) *gomock } // RevertTransaction mocks base method. -func (m *LedgerController) RevertTransaction(ctx context.Context, parameters ledger0.Parameters[ledger0.RevertTransaction]) (*ledger.RevertedTransaction, error) { +func (m *LedgerController) RevertTransaction(ctx context.Context, parameters ledger0.Parameters[ledger0.RevertTransaction]) (*ledger.Log, *ledger.RevertedTransaction, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RevertTransaction", ctx, parameters) - ret0, _ := ret[0].(*ledger.RevertedTransaction) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(*ledger.RevertedTransaction) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } // RevertTransaction indicates an expected call of RevertTransaction. @@ -306,11 +310,12 @@ func (mr *LedgerControllerMockRecorder) RevertTransaction(ctx, parameters any) * } // SaveAccountMetadata mocks base method. -func (m *LedgerController) SaveAccountMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.SaveAccountMetadata]) error { +func (m *LedgerController) SaveAccountMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.SaveAccountMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SaveAccountMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // SaveAccountMetadata indicates an expected call of SaveAccountMetadata. @@ -320,11 +325,12 @@ func (mr *LedgerControllerMockRecorder) SaveAccountMetadata(ctx, parameters any) } // SaveTransactionMetadata mocks base method. -func (m *LedgerController) SaveTransactionMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.SaveTransactionMetadata]) error { +func (m *LedgerController) SaveTransactionMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.SaveTransactionMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SaveTransactionMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // SaveTransactionMetadata indicates an expected call of SaveTransactionMetadata. diff --git a/internal/api/v1/controllers_accounts_add_metadata.go b/internal/api/v1/controllers_accounts_add_metadata.go index eabbaebec..8263f3e06 100644 --- a/internal/api/v1/controllers_accounts_add_metadata.go +++ b/internal/api/v1/controllers_accounts_add_metadata.go @@ -33,7 +33,7 @@ func addAccountMetadata(w http.ResponseWriter, r *http.Request) { return } - err = l.SaveAccountMetadata(r.Context(), getCommandParameters(r, ledger.SaveAccountMetadata{ + _, err = l.SaveAccountMetadata(r.Context(), getCommandParameters(r, ledger.SaveAccountMetadata{ Address: address, Metadata: m, })) diff --git a/internal/api/v1/controllers_accounts_add_metadata_test.go b/internal/api/v1/controllers_accounts_add_metadata_test.go index 08f78771a..0a8a42750 100644 --- a/internal/api/v1/controllers_accounts_add_metadata_test.go +++ b/internal/api/v1/controllers_accounts_add_metadata_test.go @@ -1,6 +1,7 @@ package v1 import ( + ledger "github.com/formancehq/ledger/internal" "net/http" "net/http/httptest" "net/url" @@ -94,7 +95,7 @@ func TestAccountsAddMetadata(t *testing.T) { Metadata: testCase.body.(metadata.Metadata), }, }). - Return(nil) + Return(&ledger.Log{}, nil) } router := NewRouter(systemController, auth.NewNoAuth(), "develop", os.Getenv("DEBUG") == "true") diff --git a/internal/api/v1/controllers_accounts_delete_metadata.go b/internal/api/v1/controllers_accounts_delete_metadata.go index db1d2b6c9..2e57831dc 100644 --- a/internal/api/v1/controllers_accounts_delete_metadata.go +++ b/internal/api/v1/controllers_accounts_delete_metadata.go @@ -17,7 +17,7 @@ func deleteAccountMetadata(w http.ResponseWriter, r *http.Request) { return } - if err := common.LedgerFromContext(r.Context()). + if _, err := common.LedgerFromContext(r.Context()). DeleteAccountMetadata( r.Context(), getCommandParameters(r, ledger.DeleteAccountMetadata{ diff --git a/internal/api/v1/controllers_accounts_delete_metadata_test.go b/internal/api/v1/controllers_accounts_delete_metadata_test.go index 85d2d2eaf..6934cffe7 100644 --- a/internal/api/v1/controllers_accounts_delete_metadata_test.go +++ b/internal/api/v1/controllers_accounts_delete_metadata_test.go @@ -2,6 +2,7 @@ package v1 import ( "encoding/json" + ledger "github.com/formancehq/ledger/internal" "net/http" "net/http/httptest" "net/url" @@ -70,7 +71,7 @@ func TestAccountsDeleteMetadata(t *testing.T) { }, }, ). - Return(tc.returnErr) + Return(&ledger.Log{}, tc.returnErr) } router := NewRouter(systemController, auth.NewNoAuth(), "develop", os.Getenv("DEBUG") == "true") diff --git a/internal/api/v1/controllers_transactions_add_metadata.go b/internal/api/v1/controllers_transactions_add_metadata.go index 8982b4250..6e09db6ac 100644 --- a/internal/api/v1/controllers_transactions_add_metadata.go +++ b/internal/api/v1/controllers_transactions_add_metadata.go @@ -29,7 +29,7 @@ func addTransactionMetadata(w http.ResponseWriter, r *http.Request) { return } - if err := l.SaveTransactionMetadata(r.Context(), getCommandParameters(r, ledgercontroller.SaveTransactionMetadata{ + if _, err := l.SaveTransactionMetadata(r.Context(), getCommandParameters(r, ledgercontroller.SaveTransactionMetadata{ TransactionID: int(txID), Metadata: m, })); err != nil { diff --git a/internal/api/v1/controllers_transactions_add_metadata_test.go b/internal/api/v1/controllers_transactions_add_metadata_test.go index 30e2df4b3..f46c5e971 100644 --- a/internal/api/v1/controllers_transactions_add_metadata_test.go +++ b/internal/api/v1/controllers_transactions_add_metadata_test.go @@ -1,6 +1,7 @@ package v1 import ( + ledger "github.com/formancehq/ledger/internal" "net/http" "net/http/httptest" "net/url" @@ -58,7 +59,7 @@ func TestTransactionsAddMetadata(t *testing.T) { Metadata: testCase.body.(metadata.Metadata), }, }). - Return(nil) + Return(&ledger.Log{}, nil) } router := NewRouter(systemController, auth.NewNoAuth(), "develop", os.Getenv("DEBUG") == "true") diff --git a/internal/api/v1/controllers_transactions_create.go b/internal/api/v1/controllers_transactions_create.go index 71385b9a1..e1acb5e32 100644 --- a/internal/api/v1/controllers_transactions_create.go +++ b/internal/api/v1/controllers_transactions_create.go @@ -83,7 +83,7 @@ func createTransaction(w http.ResponseWriter, r *http.Request) { Metadata: payload.Metadata, } - res, err := l.CreateTransaction(r.Context(), getCommandParameters(r, common.TxToScriptData(txData, false))) + _, res, err := l.CreateTransaction(r.Context(), getCommandParameters(r, common.TxToScriptData(txData, false))) if err != nil { switch { case errors.Is(err, &ledgercontroller.ErrInsufficientFunds{}): @@ -119,7 +119,7 @@ func createTransaction(w http.ResponseWriter, r *http.Request) { Metadata: payload.Metadata, } - res, err := l.CreateTransaction(r.Context(), getCommandParameters(r, runScript)) + _, res, err := l.CreateTransaction(r.Context(), getCommandParameters(r, runScript)) if err != nil { switch { case errors.Is(err, &ledgercontroller.ErrInsufficientFunds{}): diff --git a/internal/api/v1/controllers_transactions_create_test.go b/internal/api/v1/controllers_transactions_create_test.go index 1ff7be7b7..f90ed338f 100644 --- a/internal/api/v1/controllers_transactions_create_test.go +++ b/internal/api/v1/controllers_transactions_create_test.go @@ -211,11 +211,10 @@ func TestTransactionsCreate(t *testing.T) { }, } - for _, testCase := range testCases { - tc := testCase + for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - if testCase.expectedStatusCode == 0 { - testCase.expectedStatusCode = http.StatusOK + if tc.expectedStatusCode == 0 { + tc.expectedStatusCode = http.StatusOK } expectedTx := ledger.NewTransaction().WithPostings( @@ -223,35 +222,35 @@ func TestTransactionsCreate(t *testing.T) { ) systemController, ledgerController := newTestingSystemController(t, true) - if testCase.expectedStatusCode < 300 && testCase.expectedStatusCode >= 200 { - testCase.expectedRunScript.Timestamp = time.Time{} + if tc.expectedStatusCode < 300 && tc.expectedStatusCode >= 200 { + tc.expectedRunScript.Timestamp = time.Time{} ledgerController.EXPECT(). CreateTransaction(gomock.Any(), ledgercontroller.Parameters[ledgercontroller.RunScript]{ DryRun: tc.expectedPreview, - Input: testCase.expectedRunScript, + Input: tc.expectedRunScript, }). - Return(&ledger.CreatedTransaction{ + Return(&ledger.Log{}, &ledger.CreatedTransaction{ Transaction: expectedTx, }, nil) } router := NewRouter(systemController, auth.NewNoAuth(), "develop", os.Getenv("DEBUG") == "true") - req := httptest.NewRequest(http.MethodPost, "/xxx/transactions", api.Buffer(t, testCase.payload)) + req := httptest.NewRequest(http.MethodPost, "/xxx/transactions", api.Buffer(t, tc.payload)) rec := httptest.NewRecorder() - req.URL.RawQuery = testCase.queryParams.Encode() + req.URL.RawQuery = tc.queryParams.Encode() router.ServeHTTP(rec, req) - require.Equal(t, testCase.expectedStatusCode, rec.Code) - if testCase.expectedStatusCode < 300 && testCase.expectedStatusCode >= 200 { + require.Equal(t, tc.expectedStatusCode, rec.Code) + if tc.expectedStatusCode < 300 && tc.expectedStatusCode >= 200 { tx, ok := api.DecodeSingleResponse[[]ledger.Transaction](t, rec.Body) require.True(t, ok) require.Equal(t, expectedTx, tx[0]) } else { err := api.ErrorResponse{} api.Decode(t, rec.Body, &err) - require.EqualValues(t, testCase.expectedErrorCode, err.ErrorCode) + require.EqualValues(t, tc.expectedErrorCode, err.ErrorCode) } }) } diff --git a/internal/api/v1/controllers_transactions_delete_metadata.go b/internal/api/v1/controllers_transactions_delete_metadata.go index 1f706fca4..e9129b24d 100644 --- a/internal/api/v1/controllers_transactions_delete_metadata.go +++ b/internal/api/v1/controllers_transactions_delete_metadata.go @@ -23,7 +23,7 @@ func deleteTransactionMetadata(w http.ResponseWriter, r *http.Request) { metadataKey := chi.URLParam(r, "key") - if err := l.DeleteTransactionMetadata(r.Context(), getCommandParameters(r, ledgercontroller.DeleteTransactionMetadata{ + if _, err := l.DeleteTransactionMetadata(r.Context(), getCommandParameters(r, ledgercontroller.DeleteTransactionMetadata{ TransactionID: int(transactionID), Key: metadataKey, })); err != nil { diff --git a/internal/api/v1/controllers_transactions_delete_metadata_test.go b/internal/api/v1/controllers_transactions_delete_metadata_test.go index a9006dc92..ae3fc6eb3 100644 --- a/internal/api/v1/controllers_transactions_delete_metadata_test.go +++ b/internal/api/v1/controllers_transactions_delete_metadata_test.go @@ -2,6 +2,7 @@ package v1 import ( "encoding/json" + ledger "github.com/formancehq/ledger/internal" "net/http" "net/http/httptest" "net/url" @@ -64,7 +65,7 @@ func TestTransactionsDeleteMetadata(t *testing.T) { Key: "foo", }, }). - Return(tc.returnErr) + Return(&ledger.Log{}, tc.returnErr) } router := NewRouter(systemController, auth.NewNoAuth(), "develop", os.Getenv("DEBUG") == "true") diff --git a/internal/api/v1/controllers_transactions_revert.go b/internal/api/v1/controllers_transactions_revert.go index 611f96e71..5612b836d 100644 --- a/internal/api/v1/controllers_transactions_revert.go +++ b/internal/api/v1/controllers_transactions_revert.go @@ -21,7 +21,7 @@ func revertTransaction(w http.ResponseWriter, r *http.Request) { return } - ret, err := l.RevertTransaction( + _, ret, err := l.RevertTransaction( r.Context(), getCommandParameters(r, ledgercontroller.RevertTransaction{ Force: api.QueryParamBool(r, "disableChecks"), diff --git a/internal/api/v1/controllers_transactions_revert_test.go b/internal/api/v1/controllers_transactions_revert_test.go index 301fff877..b2603e32e 100644 --- a/internal/api/v1/controllers_transactions_revert_test.go +++ b/internal/api/v1/controllers_transactions_revert_test.go @@ -76,7 +76,7 @@ func TestTransactionsRevert(t *testing.T) { Force: tc.expectForce, }, }). - Return(pointer.For(ledger.RevertedTransaction{ + Return(&ledger.Log{}, pointer.For(ledger.RevertedTransaction{ RevertTransaction: tc.returnTx, }), tc.returnErr) diff --git a/internal/api/v1/mocks_ledger_controller_test.go b/internal/api/v1/mocks_ledger_controller_test.go index 4e7fadbf2..a849cf030 100644 --- a/internal/api/v1/mocks_ledger_controller_test.go +++ b/internal/api/v1/mocks_ledger_controller_test.go @@ -70,12 +70,13 @@ func (mr *LedgerControllerMockRecorder) CountTransactions(ctx, query any) *gomoc } // CreateTransaction mocks base method. -func (m *LedgerController) CreateTransaction(ctx context.Context, parameters ledger0.Parameters[ledger0.RunScript]) (*ledger.CreatedTransaction, error) { +func (m *LedgerController) CreateTransaction(ctx context.Context, parameters ledger0.Parameters[ledger0.RunScript]) (*ledger.Log, *ledger.CreatedTransaction, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateTransaction", ctx, parameters) - ret0, _ := ret[0].(*ledger.CreatedTransaction) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(*ledger.CreatedTransaction) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } // CreateTransaction indicates an expected call of CreateTransaction. @@ -85,11 +86,12 @@ func (mr *LedgerControllerMockRecorder) CreateTransaction(ctx, parameters any) * } // DeleteAccountMetadata mocks base method. -func (m *LedgerController) DeleteAccountMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.DeleteAccountMetadata]) error { +func (m *LedgerController) DeleteAccountMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.DeleteAccountMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteAccountMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // DeleteAccountMetadata indicates an expected call of DeleteAccountMetadata. @@ -99,11 +101,12 @@ func (mr *LedgerControllerMockRecorder) DeleteAccountMetadata(ctx, parameters an } // DeleteTransactionMetadata mocks base method. -func (m *LedgerController) DeleteTransactionMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.DeleteTransactionMetadata]) error { +func (m *LedgerController) DeleteTransactionMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.DeleteTransactionMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteTransactionMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // DeleteTransactionMetadata indicates an expected call of DeleteTransactionMetadata. @@ -291,12 +294,13 @@ func (mr *LedgerControllerMockRecorder) ListTransactions(ctx, query any) *gomock } // RevertTransaction mocks base method. -func (m *LedgerController) RevertTransaction(ctx context.Context, parameters ledger0.Parameters[ledger0.RevertTransaction]) (*ledger.RevertedTransaction, error) { +func (m *LedgerController) RevertTransaction(ctx context.Context, parameters ledger0.Parameters[ledger0.RevertTransaction]) (*ledger.Log, *ledger.RevertedTransaction, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RevertTransaction", ctx, parameters) - ret0, _ := ret[0].(*ledger.RevertedTransaction) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(*ledger.RevertedTransaction) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } // RevertTransaction indicates an expected call of RevertTransaction. @@ -306,11 +310,12 @@ func (mr *LedgerControllerMockRecorder) RevertTransaction(ctx, parameters any) * } // SaveAccountMetadata mocks base method. -func (m *LedgerController) SaveAccountMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.SaveAccountMetadata]) error { +func (m *LedgerController) SaveAccountMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.SaveAccountMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SaveAccountMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // SaveAccountMetadata indicates an expected call of SaveAccountMetadata. @@ -320,11 +325,12 @@ func (mr *LedgerControllerMockRecorder) SaveAccountMetadata(ctx, parameters any) } // SaveTransactionMetadata mocks base method. -func (m *LedgerController) SaveTransactionMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.SaveTransactionMetadata]) error { +func (m *LedgerController) SaveTransactionMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.SaveTransactionMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SaveTransactionMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // SaveTransactionMetadata indicates an expected call of SaveTransactionMetadata. diff --git a/internal/api/v2/common.go b/internal/api/v2/common.go index 3351bc524..82fbc486e 100644 --- a/internal/api/v2/common.go +++ b/internal/api/v2/common.go @@ -1,9 +1,6 @@ package v2 import ( - "github.com/formancehq/go-libs/v2/metadata" - "github.com/formancehq/ledger/internal" - "github.com/formancehq/ledger/internal/api/common" "io" "net/http" "slices" @@ -179,37 +176,4 @@ func getPaginatedQueryOptionsOfFiltersForVolumes(r *http.Request) (*ledgercontro return pointer.For(ledgercontroller.NewPaginatedQueryOptions(*filtersForVolumes). WithPageSize(pageSize). WithQueryBuilder(qb)), nil -} - -type TransactionRequest struct { - Postings ledger.Postings `json:"postings"` - Script ledgercontroller.ScriptV1 `json:"script"` - Timestamp time.Time `json:"timestamp"` - Reference string `json:"reference"` - Metadata metadata.Metadata `json:"metadata" swaggertype:"object"` -} - -func (req *TransactionRequest) ToRunScript(allowUnboundedOverdrafts bool) (*ledgercontroller.RunScript, error) { - - if _, err := req.Postings.Validate(); err != nil { - return nil, err - } - - if len(req.Postings) > 0 { - txData := ledger.TransactionData{ - Postings: req.Postings, - Timestamp: req.Timestamp, - Reference: req.Reference, - Metadata: req.Metadata, - } - - return pointer.For(common.TxToScriptData(txData, allowUnboundedOverdrafts)), nil - } - - return &ledgercontroller.RunScript{ - Script: req.Script.ToCore(), - Timestamp: req.Timestamp, - Reference: req.Reference, - Metadata: req.Metadata, - }, nil -} +} \ No newline at end of file diff --git a/internal/api/v2/controllers_accounts_add_metadata.go b/internal/api/v2/controllers_accounts_add_metadata.go index b38dee690..b0a12038a 100644 --- a/internal/api/v2/controllers_accounts_add_metadata.go +++ b/internal/api/v2/controllers_accounts_add_metadata.go @@ -28,7 +28,7 @@ func addAccountMetadata(w http.ResponseWriter, r *http.Request) { return } - err = l.SaveAccountMetadata(r.Context(), getCommandParameters(r, ledger.SaveAccountMetadata{ + _, err = l.SaveAccountMetadata(r.Context(), getCommandParameters(r, ledger.SaveAccountMetadata{ Address: address, Metadata: m, })) diff --git a/internal/api/v2/controllers_accounts_add_metadata_test.go b/internal/api/v2/controllers_accounts_add_metadata_test.go index 505170334..7d6b73fd4 100644 --- a/internal/api/v2/controllers_accounts_add_metadata_test.go +++ b/internal/api/v2/controllers_accounts_add_metadata_test.go @@ -1,6 +1,7 @@ package v2 import ( + ledger "github.com/formancehq/ledger/internal" "net/http" "net/http/httptest" "net/url" @@ -67,7 +68,7 @@ func TestAccountsAddMetadata(t *testing.T) { Metadata: testCase.body.(metadata.Metadata), }, }). - Return(nil) + Return(&ledger.Log{}, nil) } router := NewRouter(systemController, auth.NewNoAuth(), os.Getenv("DEBUG") == "true") diff --git a/internal/api/v2/controllers_accounts_delete_metadata.go b/internal/api/v2/controllers_accounts_delete_metadata.go index 0e3115b91..fda3ac613 100644 --- a/internal/api/v2/controllers_accounts_delete_metadata.go +++ b/internal/api/v2/controllers_accounts_delete_metadata.go @@ -18,7 +18,7 @@ func deleteAccountMetadata(w http.ResponseWriter, r *http.Request) { return } - if err := common.LedgerFromContext(r.Context()). + if _, err := common.LedgerFromContext(r.Context()). DeleteAccountMetadata( r.Context(), getCommandParameters(r, ledger.DeleteAccountMetadata{ diff --git a/internal/api/v2/controllers_accounts_delete_metadata_test.go b/internal/api/v2/controllers_accounts_delete_metadata_test.go index 3130d49f1..c3d1fde78 100644 --- a/internal/api/v2/controllers_accounts_delete_metadata_test.go +++ b/internal/api/v2/controllers_accounts_delete_metadata_test.go @@ -2,6 +2,7 @@ package v2 import ( "encoding/json" + ledger "github.com/formancehq/ledger/internal" "net/http" "net/http/httptest" "net/url" @@ -67,7 +68,7 @@ func TestAccountsDeleteMetadata(t *testing.T) { Key: "foo", }, }). - Return(tc.returnErr) + Return(&ledger.Log{}, tc.returnErr) } router := NewRouter(systemController, auth.NewNoAuth(), os.Getenv("DEBUG") == "true") diff --git a/internal/api/v2/controllers_bulk.go b/internal/api/v2/controllers_bulk.go index afa1218d9..ab1a0dbce 100644 --- a/internal/api/v2/controllers_bulk.go +++ b/internal/api/v2/controllers_bulk.go @@ -4,6 +4,8 @@ import ( "context" "encoding/json" "fmt" + "github.com/formancehq/go-libs/v2/pointer" + "github.com/formancehq/go-libs/v2/time" "net/http" "errors" @@ -49,9 +51,9 @@ const ( ActionDeleteMetadata = "DELETE_METADATA" ) -type Bulk []Element +type Bulk []BulkElement -type Element struct { +type BulkElement struct { Action string `json:"action"` IdempotencyKey string `json:"ik"` Data json.RawMessage `json:"data"` @@ -63,6 +65,58 @@ type Result struct { ErrorDetails string `json:"errorDetails,omitempty"` Data any `json:"data,omitempty"` ResponseType string `json:"responseType"` // Added for sdk generation (discriminator in oneOf) + LogID int `json:"logID"` +} + +type AddMetadataRequest struct { + TargetType string `json:"targetType"` + TargetID json.RawMessage `json:"targetId"` + Metadata metadata.Metadata `json:"metadata"` +} + +type RevertTransactionRequest struct { + ID int `json:"id"` + Force bool `json:"force"` + AtEffectiveDate bool `json:"atEffectiveDate"` +} + +type DeleteMetadataRequest struct { + TargetType string `json:"targetType"` + TargetID json.RawMessage `json:"targetId"` + Key string `json:"key"` +} + +type TransactionRequest struct { + Postings ledger.Postings `json:"postings"` + Script ledgercontroller.ScriptV1 `json:"script"` + Timestamp time.Time `json:"timestamp"` + Reference string `json:"reference"` + Metadata metadata.Metadata `json:"metadata" swaggertype:"object"` +} + +func (req *TransactionRequest) ToRunScript(allowUnboundedOverdrafts bool) (*ledgercontroller.RunScript, error) { + + if _, err := req.Postings.Validate(); err != nil { + return nil, err + } + + if len(req.Postings) > 0 { + txData := ledger.TransactionData{ + Postings: req.Postings, + Timestamp: req.Timestamp, + Reference: req.Reference, + Metadata: req.Metadata, + } + + return pointer.For(common.TxToScriptData(txData, allowUnboundedOverdrafts)), nil + } + + return &ledgercontroller.RunScript{ + Script: req.Script.ToCore(), + Timestamp: req.Timestamp, + Reference: req.Reference, + Metadata: req.Metadata, + }, nil } func ProcessBulk( @@ -96,7 +150,7 @@ func ProcessBulk( return nil, errorsInBulk, fmt.Errorf("error parsing element %d: %s", i, err) } - createTransactionResult, err := l.CreateTransaction(ctx, ledgercontroller.Parameters[ledgercontroller.RunScript]{ + log, createTransactionResult, err := l.CreateTransaction(ctx, ledgercontroller.Parameters[ledgercontroller.RunScript]{ DryRun: false, IdempotencyKey: element.IdempotencyKey, Input: *rs, @@ -131,27 +185,26 @@ func ProcessBulk( ret = append(ret, Result{ Data: createTransactionResult.Transaction, ResponseType: element.Action, + LogID: log.ID, }) } case ActionAddMetadata: - type addMetadataRequest struct { - TargetType string `json:"targetType"` - TargetID json.RawMessage `json:"targetId"` - Metadata metadata.Metadata `json:"metadata"` - } - req := &addMetadataRequest{} + req := &AddMetadataRequest{} if err := json.Unmarshal(element.Data, req); err != nil { return nil, errorsInBulk, fmt.Errorf("error parsing element %d: %s", i, err) } - var err error + var ( + log *ledger.Log + err error + ) switch req.TargetType { case ledger.MetaTargetTypeAccount: address := "" if err := json.Unmarshal(req.TargetID, &address); err != nil { return nil, errorsInBulk, err } - err = l.SaveAccountMetadata(ctx, ledgercontroller.Parameters[ledgercontroller.SaveAccountMetadata]{ + log, err = l.SaveAccountMetadata(ctx, ledgercontroller.Parameters[ledgercontroller.SaveAccountMetadata]{ DryRun: false, IdempotencyKey: element.IdempotencyKey, Input: ledgercontroller.SaveAccountMetadata{ @@ -164,7 +217,7 @@ func ProcessBulk( if err := json.Unmarshal(req.TargetID, &transactionID); err != nil { return nil, errorsInBulk, err } - err = l.SaveTransactionMetadata(ctx, ledgercontroller.Parameters[ledgercontroller.SaveTransactionMetadata]{ + log, err = l.SaveTransactionMetadata(ctx, ledgercontroller.Parameters[ledgercontroller.SaveTransactionMetadata]{ DryRun: false, IdempotencyKey: element.IdempotencyKey, Input: ledgercontroller.SaveTransactionMetadata{ @@ -172,6 +225,8 @@ func ProcessBulk( Metadata: req.Metadata, }, }) + default: + return nil, errorsInBulk, fmt.Errorf("invalid target type: %s", req.TargetType) } if err != nil { var code string @@ -188,20 +243,16 @@ func ProcessBulk( } else { ret = append(ret, Result{ ResponseType: element.Action, + LogID: log.ID, }) } case ActionRevertTransaction: - type revertTransactionRequest struct { - ID int `json:"id"` - Force bool `json:"force"` - AtEffectiveDate bool `json:"atEffectiveDate"` - } - req := &revertTransactionRequest{} + req := &RevertTransactionRequest{} if err := json.Unmarshal(element.Data, req); err != nil { return nil, errorsInBulk, fmt.Errorf("error parsing element %d: %s", i, err) } - revertTransactionResult, err := l.RevertTransaction(ctx, ledgercontroller.Parameters[ledgercontroller.RevertTransaction]{ + log, revertTransactionResult, err := l.RevertTransaction(ctx, ledgercontroller.Parameters[ledgercontroller.RevertTransaction]{ DryRun: false, IdempotencyKey: element.IdempotencyKey, Input: ledgercontroller.RevertTransaction{ @@ -226,27 +277,27 @@ func ProcessBulk( ret = append(ret, Result{ Data: revertTransactionResult.RevertTransaction, ResponseType: element.Action, + LogID: log.ID, }) } case ActionDeleteMetadata: - type deleteMetadataRequest struct { - TargetType string `json:"targetType"` - TargetID json.RawMessage `json:"targetId"` - Key string `json:"key"` - } - req := &deleteMetadataRequest{} + req := &DeleteMetadataRequest{} if err := json.Unmarshal(element.Data, req); err != nil { return nil, errorsInBulk, fmt.Errorf("error parsing element %d: %s", i, err) } - var err error + var ( + log *ledger.Log + err error + ) switch req.TargetType { case ledger.MetaTargetTypeAccount: address := "" if err := json.Unmarshal(req.TargetID, &address); err != nil { return nil, errorsInBulk, err } - err = l.DeleteAccountMetadata(ctx, ledgercontroller.Parameters[ledgercontroller.DeleteAccountMetadata]{ + + log, err = l.DeleteAccountMetadata(ctx, ledgercontroller.Parameters[ledgercontroller.DeleteAccountMetadata]{ DryRun: false, IdempotencyKey: element.IdempotencyKey, Input: ledgercontroller.DeleteAccountMetadata{ @@ -259,7 +310,8 @@ func ProcessBulk( if err := json.Unmarshal(req.TargetID, &transactionID); err != nil { return nil, errorsInBulk, err } - err = l.DeleteTransactionMetadata(ctx, ledgercontroller.Parameters[ledgercontroller.DeleteTransactionMetadata]{ + + log, err = l.DeleteTransactionMetadata(ctx, ledgercontroller.Parameters[ledgercontroller.DeleteTransactionMetadata]{ DryRun: false, IdempotencyKey: element.IdempotencyKey, Input: ledgercontroller.DeleteTransactionMetadata{ @@ -267,6 +319,8 @@ func ProcessBulk( Key: req.Key, }, }) + default: + return nil, errorsInBulk, fmt.Errorf("unsupported target type: %s", req.TargetType) } if err != nil { var code string @@ -283,6 +337,7 @@ func ProcessBulk( } else { ret = append(ret, Result{ ResponseType: element.Action, + LogID: log.ID, }) } } diff --git a/internal/api/v2/controllers_bulk_test.go b/internal/api/v2/controllers_bulk_test.go index aa6b6f38b..31f8e857d 100644 --- a/internal/api/v2/controllers_bulk_test.go +++ b/internal/api/v2/controllers_bulk_test.go @@ -68,7 +68,7 @@ func TestBulk(t *testing.T) { Timestamp: now, }, false), }). - Return(&ledger.CreatedTransaction{ + Return(&ledger.Log{}, &ledger.CreatedTransaction{ Transaction: ledger.Transaction{ TransactionData: ledger.TransactionData{ Postings: postings, @@ -118,7 +118,7 @@ func TestBulk(t *testing.T) { }, }, }). - Return(nil) + Return(&ledger.Log{}, nil) }, expectResults: []Result{{ ResponseType: ActionAddMetadata, @@ -146,7 +146,7 @@ func TestBulk(t *testing.T) { }, }, }). - Return(nil) + Return(&ledger.Log{}, nil) }, expectResults: []Result{{ ResponseType: ActionAddMetadata, @@ -167,7 +167,7 @@ func TestBulk(t *testing.T) { TransactionID: 1, }, }). - Return(&ledger.RevertedTransaction{}, nil) + Return(&ledger.Log{}, &ledger.RevertedTransaction{}, nil) }, expectResults: []Result{{ Data: map[string]any{ @@ -198,7 +198,7 @@ func TestBulk(t *testing.T) { Key: "foo", }, }). - Return(nil) + Return(&ledger.Log{}, nil) }, expectResults: []Result{{ ResponseType: ActionDeleteMetadata, @@ -248,7 +248,7 @@ func TestBulk(t *testing.T) { }, }, }). - Return(nil) + Return(&ledger.Log{}, nil) mockLedger.EXPECT(). SaveAccountMetadata(gomock.Any(), ledgercontroller.Parameters[ledgercontroller.SaveAccountMetadata]{ Input: ledgercontroller.SaveAccountMetadata{ @@ -258,7 +258,7 @@ func TestBulk(t *testing.T) { }, }, }). - Return(errors.New("unexpected error")) + Return(nil, errors.New("unexpected error")) }, expectResults: []Result{{ ResponseType: ActionAddMetadata, @@ -316,7 +316,7 @@ func TestBulk(t *testing.T) { }, }, }). - Return(nil) + Return(&ledger.Log{}, nil) mockLedger.EXPECT(). SaveAccountMetadata(gomock.Any(), ledgercontroller.Parameters[ledgercontroller.SaveAccountMetadata]{ Input: ledgercontroller.SaveAccountMetadata{ @@ -326,7 +326,7 @@ func TestBulk(t *testing.T) { }, }, }). - Return(errors.New("unexpected error")) + Return(nil, errors.New("unexpected error")) mockLedger.EXPECT(). SaveAccountMetadata(gomock.Any(), ledgercontroller.Parameters[ledgercontroller.SaveAccountMetadata]{ Input: ledgercontroller.SaveAccountMetadata{ @@ -336,7 +336,7 @@ func TestBulk(t *testing.T) { }, }, }). - Return(nil) + Return(&ledger.Log{}, nil) }, expectResults: []Result{{ ResponseType: ActionAddMetadata, diff --git a/internal/api/v2/controllers_transactions_add_metadata.go b/internal/api/v2/controllers_transactions_add_metadata.go index fa81f7292..9b1118b72 100644 --- a/internal/api/v2/controllers_transactions_add_metadata.go +++ b/internal/api/v2/controllers_transactions_add_metadata.go @@ -29,7 +29,7 @@ func addTransactionMetadata(w http.ResponseWriter, r *http.Request) { return } - if err := l.SaveTransactionMetadata(r.Context(), getCommandParameters(r, ledgercontroller.SaveTransactionMetadata{ + if _, err := l.SaveTransactionMetadata(r.Context(), getCommandParameters(r, ledgercontroller.SaveTransactionMetadata{ TransactionID: int(txID), Metadata: m, })); err != nil { diff --git a/internal/api/v2/controllers_transactions_add_metadata_test.go b/internal/api/v2/controllers_transactions_add_metadata_test.go index eadc9de5a..8f108cd9b 100644 --- a/internal/api/v2/controllers_transactions_add_metadata_test.go +++ b/internal/api/v2/controllers_transactions_add_metadata_test.go @@ -95,7 +95,7 @@ func TestTransactionsAddMetadata(t *testing.T) { Metadata: testCase.body.(metadata.Metadata), }, }). - Return(testCase.returnErr) + Return(nil, testCase.returnErr) } router := NewRouter(systemController, auth.NewNoAuth(), os.Getenv("DEBUG") == "true") diff --git a/internal/api/v2/controllers_transactions_create.go b/internal/api/v2/controllers_transactions_create.go index 912c18b45..2147d146e 100644 --- a/internal/api/v2/controllers_transactions_create.go +++ b/internal/api/v2/controllers_transactions_create.go @@ -37,7 +37,7 @@ func createTransaction(w http.ResponseWriter, r *http.Request) { return } - res, err := l.CreateTransaction(r.Context(), getCommandParameters(r, *runScript)) + _, res, err := l.CreateTransaction(r.Context(), getCommandParameters(r, *runScript)) if err != nil { switch { case errors.Is(err, &ledgercontroller.ErrInsufficientFunds{}): diff --git a/internal/api/v2/controllers_transactions_create_test.go b/internal/api/v2/controllers_transactions_create_test.go index d243b675e..e4870caf2 100644 --- a/internal/api/v2/controllers_transactions_create_test.go +++ b/internal/api/v2/controllers_transactions_create_test.go @@ -407,11 +407,11 @@ func TestTransactionCreate(t *testing.T) { }) if tc.returnError == nil { - expect.Return(&ledger.CreatedTransaction{ + expect.Return(&ledger.Log{}, &ledger.CreatedTransaction{ Transaction: expectedTx, }, nil) } else { - expect.Return(nil, tc.returnError) + expect.Return(nil, nil, tc.returnError) } } diff --git a/internal/api/v2/controllers_transactions_delete_metadata.go b/internal/api/v2/controllers_transactions_delete_metadata.go index 0d7c281a1..f14067c30 100644 --- a/internal/api/v2/controllers_transactions_delete_metadata.go +++ b/internal/api/v2/controllers_transactions_delete_metadata.go @@ -25,7 +25,7 @@ func deleteTransactionMetadata(w http.ResponseWriter, r *http.Request) { metadataKey := chi.URLParam(r, "key") - if err := l.DeleteTransactionMetadata(r.Context(), getCommandParameters(r, ledgercontroller.DeleteTransactionMetadata{ + if _, err := l.DeleteTransactionMetadata(r.Context(), getCommandParameters(r, ledgercontroller.DeleteTransactionMetadata{ TransactionID: int(txID), Key: metadataKey, })); err != nil { diff --git a/internal/api/v2/controllers_transactions_delete_metadata_test.go b/internal/api/v2/controllers_transactions_delete_metadata_test.go index 882ca685e..a239b4ecf 100644 --- a/internal/api/v2/controllers_transactions_delete_metadata_test.go +++ b/internal/api/v2/controllers_transactions_delete_metadata_test.go @@ -2,6 +2,7 @@ package v2 import ( "encoding/json" + ledger "github.com/formancehq/ledger/internal" "net/http" "net/http/httptest" "net/url" @@ -64,7 +65,7 @@ func TestTransactionsDeleteMetadata(t *testing.T) { Key: "foo", }, }). - Return(tc.returnErr) + Return(&ledger.Log{}, tc.returnErr) } router := NewRouter(systemController, auth.NewNoAuth(), os.Getenv("DEBUG") == "true") diff --git a/internal/api/v2/controllers_transactions_revert.go b/internal/api/v2/controllers_transactions_revert.go index 2d7af3255..aae713ef1 100644 --- a/internal/api/v2/controllers_transactions_revert.go +++ b/internal/api/v2/controllers_transactions_revert.go @@ -21,7 +21,7 @@ func revertTransaction(w http.ResponseWriter, r *http.Request) { return } - ret, err := l.RevertTransaction( + _, ret, err := l.RevertTransaction( r.Context(), getCommandParameters(r, ledgercontroller.RevertTransaction{ Force: api.QueryParamBool(r, "force"), diff --git a/internal/api/v2/controllers_transactions_revert_test.go b/internal/api/v2/controllers_transactions_revert_test.go index 987c4d513..8b03710a8 100644 --- a/internal/api/v2/controllers_transactions_revert_test.go +++ b/internal/api/v2/controllers_transactions_revert_test.go @@ -76,7 +76,7 @@ func TestTransactionsRevert(t *testing.T) { Force: tc.expectForce, }, }). - Return(&ledger.RevertedTransaction{ + Return(&ledger.Log{}, &ledger.RevertedTransaction{ RevertTransaction: tc.returnTx, }, tc.returnErr) diff --git a/internal/api/v2/mocks_ledger_controller_test.go b/internal/api/v2/mocks_ledger_controller_test.go index 28d3291a2..0613e2e93 100644 --- a/internal/api/v2/mocks_ledger_controller_test.go +++ b/internal/api/v2/mocks_ledger_controller_test.go @@ -70,12 +70,13 @@ func (mr *LedgerControllerMockRecorder) CountTransactions(ctx, query any) *gomoc } // CreateTransaction mocks base method. -func (m *LedgerController) CreateTransaction(ctx context.Context, parameters ledger0.Parameters[ledger0.RunScript]) (*ledger.CreatedTransaction, error) { +func (m *LedgerController) CreateTransaction(ctx context.Context, parameters ledger0.Parameters[ledger0.RunScript]) (*ledger.Log, *ledger.CreatedTransaction, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateTransaction", ctx, parameters) - ret0, _ := ret[0].(*ledger.CreatedTransaction) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(*ledger.CreatedTransaction) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } // CreateTransaction indicates an expected call of CreateTransaction. @@ -85,11 +86,12 @@ func (mr *LedgerControllerMockRecorder) CreateTransaction(ctx, parameters any) * } // DeleteAccountMetadata mocks base method. -func (m *LedgerController) DeleteAccountMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.DeleteAccountMetadata]) error { +func (m *LedgerController) DeleteAccountMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.DeleteAccountMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteAccountMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // DeleteAccountMetadata indicates an expected call of DeleteAccountMetadata. @@ -99,11 +101,12 @@ func (mr *LedgerControllerMockRecorder) DeleteAccountMetadata(ctx, parameters an } // DeleteTransactionMetadata mocks base method. -func (m *LedgerController) DeleteTransactionMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.DeleteTransactionMetadata]) error { +func (m *LedgerController) DeleteTransactionMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.DeleteTransactionMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteTransactionMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // DeleteTransactionMetadata indicates an expected call of DeleteTransactionMetadata. @@ -291,12 +294,13 @@ func (mr *LedgerControllerMockRecorder) ListTransactions(ctx, query any) *gomock } // RevertTransaction mocks base method. -func (m *LedgerController) RevertTransaction(ctx context.Context, parameters ledger0.Parameters[ledger0.RevertTransaction]) (*ledger.RevertedTransaction, error) { +func (m *LedgerController) RevertTransaction(ctx context.Context, parameters ledger0.Parameters[ledger0.RevertTransaction]) (*ledger.Log, *ledger.RevertedTransaction, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RevertTransaction", ctx, parameters) - ret0, _ := ret[0].(*ledger.RevertedTransaction) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(*ledger.RevertedTransaction) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } // RevertTransaction indicates an expected call of RevertTransaction. @@ -306,11 +310,12 @@ func (mr *LedgerControllerMockRecorder) RevertTransaction(ctx, parameters any) * } // SaveAccountMetadata mocks base method. -func (m *LedgerController) SaveAccountMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.SaveAccountMetadata]) error { +func (m *LedgerController) SaveAccountMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.SaveAccountMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SaveAccountMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // SaveAccountMetadata indicates an expected call of SaveAccountMetadata. @@ -320,11 +325,12 @@ func (mr *LedgerControllerMockRecorder) SaveAccountMetadata(ctx, parameters any) } // SaveTransactionMetadata mocks base method. -func (m *LedgerController) SaveTransactionMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.SaveTransactionMetadata]) error { +func (m *LedgerController) SaveTransactionMetadata(ctx context.Context, parameters ledger0.Parameters[ledger0.SaveTransactionMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SaveTransactionMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // SaveTransactionMetadata indicates an expected call of SaveTransactionMetadata. diff --git a/internal/controller/ledger/controller.go b/internal/controller/ledger/controller.go index fc1ca32ba..feb401262 100644 --- a/internal/controller/ledger/controller.go +++ b/internal/controller/ledger/controller.go @@ -37,7 +37,7 @@ type Controller interface { // * ErrTransactionReferenceConflict // * ErrIdempotencyKeyConflict // * ErrInsufficientFunds - CreateTransaction(ctx context.Context, parameters Parameters[RunScript]) (*ledger.CreatedTransaction, error) + CreateTransaction(ctx context.Context, parameters Parameters[RunScript]) (*ledger.Log, *ledger.CreatedTransaction, error) // RevertTransaction allow to revert a transaction. // It can return following errors: // * ErrInsufficientFunds @@ -45,22 +45,22 @@ type Controller interface { // * ErrNotFound // Parameter force indicate we want to force revert the transaction even if the accounts does not have funds // Parameter atEffectiveDate indicate we want to set the timestamp of the newly created transaction on the timestamp of the reverted transaction - RevertTransaction(ctx context.Context, parameters Parameters[RevertTransaction]) (*ledger.RevertedTransaction, error) + RevertTransaction(ctx context.Context, parameters Parameters[RevertTransaction]) (*ledger.Log, *ledger.RevertedTransaction, error) // SaveTransactionMetadata allow to add metadata to an existing transaction // It can return following errors: // * ErrNotFound - SaveTransactionMetadata(ctx context.Context, parameters Parameters[SaveTransactionMetadata]) error + SaveTransactionMetadata(ctx context.Context, parameters Parameters[SaveTransactionMetadata]) (*ledger.Log, error) // SaveAccountMetadata allow to add metadata to an account // If the account does not exist, it is created - SaveAccountMetadata(ctx context.Context, parameters Parameters[SaveAccountMetadata]) error + SaveAccountMetadata(ctx context.Context, parameters Parameters[SaveAccountMetadata]) (*ledger.Log, error) // DeleteTransactionMetadata allow to remove metadata of a transaction // It can return following errors: // * ErrNotFound : indicate the transaction was not found OR the metadata does not exist on the transaction - DeleteTransactionMetadata(ctx context.Context, parameters Parameters[DeleteTransactionMetadata]) error + DeleteTransactionMetadata(ctx context.Context, parameters Parameters[DeleteTransactionMetadata]) (*ledger.Log, error) // DeleteAccountMetadata allow to remove metadata of an account // It can return following errors: // * ErrNotFound : indicate the account was not found OR the metadata does not exist on the account - DeleteAccountMetadata(ctx context.Context, parameters Parameters[DeleteAccountMetadata]) error + DeleteAccountMetadata(ctx context.Context, parameters Parameters[DeleteAccountMetadata]) (*ledger.Log, error) // Import allow to import the logs of an existing ledger // It can return following errors: // * ErrImport diff --git a/internal/controller/ledger/controller_default.go b/internal/controller/ledger/controller_default.go index d5d8bdf56..f8dcc70ef 100644 --- a/internal/controller/ledger/controller_default.go +++ b/internal/controller/ledger/controller_default.go @@ -306,7 +306,7 @@ func (ctrl *DefaultController) createTransaction(ctx context.Context, sqlTX TX, }, err } -func (ctrl *DefaultController) CreateTransaction(ctx context.Context, parameters Parameters[RunScript]) (*ledger.CreatedTransaction, error) { +func (ctrl *DefaultController) CreateTransaction(ctx context.Context, parameters Parameters[RunScript]) (*ledger.Log, *ledger.CreatedTransaction, error) { return ctrl.createTransactionLp.forgeLog(ctx, ctrl.store, parameters, ctrl.createTransaction) } @@ -372,7 +372,7 @@ func (ctrl *DefaultController) revertTransaction(ctx context.Context, sqlTX TX, }, nil } -func (ctrl *DefaultController) RevertTransaction(ctx context.Context, parameters Parameters[RevertTransaction]) (*ledger.RevertedTransaction, error) { +func (ctrl *DefaultController) RevertTransaction(ctx context.Context, parameters Parameters[RevertTransaction]) (*ledger.Log, *ledger.RevertedTransaction, error) { return ctrl.revertTransactionLp.forgeLog(ctx, ctrl.store, parameters, ctrl.revertTransaction) } @@ -388,9 +388,9 @@ func (ctrl *DefaultController) saveTransactionMetadata(ctx context.Context, sqlT }, nil } -func (ctrl *DefaultController) SaveTransactionMetadata(ctx context.Context, parameters Parameters[SaveTransactionMetadata]) error { - _, err := ctrl.saveTransactionMetadataLp.forgeLog(ctx, ctrl.store, parameters, ctrl.saveTransactionMetadata) - return err +func (ctrl *DefaultController) SaveTransactionMetadata(ctx context.Context, parameters Parameters[SaveTransactionMetadata]) (*ledger.Log, error) { + log, _, err := ctrl.saveTransactionMetadataLp.forgeLog(ctx, ctrl.store, parameters, ctrl.saveTransactionMetadata) + return log, err } func (ctrl *DefaultController) saveAccountMetadata(ctx context.Context, sqlTX TX, parameters Parameters[SaveAccountMetadata]) (*ledger.SavedMetadata, error) { @@ -408,10 +408,10 @@ func (ctrl *DefaultController) saveAccountMetadata(ctx context.Context, sqlTX TX }, nil } -func (ctrl *DefaultController) SaveAccountMetadata(ctx context.Context, parameters Parameters[SaveAccountMetadata]) error { - _, err := ctrl.saveAccountMetadataLp.forgeLog(ctx, ctrl.store, parameters, ctrl.saveAccountMetadata) +func (ctrl *DefaultController) SaveAccountMetadata(ctx context.Context, parameters Parameters[SaveAccountMetadata]) (*ledger.Log, error) { + log, _, err := ctrl.saveAccountMetadataLp.forgeLog(ctx, ctrl.store, parameters, ctrl.saveAccountMetadata) - return err + return log, err } func (ctrl *DefaultController) deleteTransactionMetadata(ctx context.Context, sqlTX TX, parameters Parameters[DeleteTransactionMetadata]) (*ledger.DeletedMetadata, error) { @@ -431,9 +431,9 @@ func (ctrl *DefaultController) deleteTransactionMetadata(ctx context.Context, sq }, nil } -func (ctrl *DefaultController) DeleteTransactionMetadata(ctx context.Context, parameters Parameters[DeleteTransactionMetadata]) error { - _, err := ctrl.deleteTransactionMetadataLp.forgeLog(ctx, ctrl.store, parameters, ctrl.deleteTransactionMetadata) - return err +func (ctrl *DefaultController) DeleteTransactionMetadata(ctx context.Context, parameters Parameters[DeleteTransactionMetadata]) (*ledger.Log, error) { + log, _, err := ctrl.deleteTransactionMetadataLp.forgeLog(ctx, ctrl.store, parameters, ctrl.deleteTransactionMetadata) + return log, err } func (ctrl *DefaultController) deleteAccountMetadata(ctx context.Context, sqlTX TX, parameters Parameters[DeleteAccountMetadata]) (*ledger.DeletedMetadata, error) { @@ -449,9 +449,9 @@ func (ctrl *DefaultController) deleteAccountMetadata(ctx context.Context, sqlTX }, nil } -func (ctrl *DefaultController) DeleteAccountMetadata(ctx context.Context, parameters Parameters[DeleteAccountMetadata]) error { - _, err := ctrl.deleteAccountMetadataLp.forgeLog(ctx, ctrl.store, parameters, ctrl.deleteAccountMetadata) - return err +func (ctrl *DefaultController) DeleteAccountMetadata(ctx context.Context, parameters Parameters[DeleteAccountMetadata]) (*ledger.Log, error) { + log, _, err := ctrl.deleteAccountMetadataLp.forgeLog(ctx, ctrl.store, parameters, ctrl.deleteAccountMetadata) + return log, err } var _ Controller = (*DefaultController)(nil) diff --git a/internal/controller/ledger/controller_default_test.go b/internal/controller/ledger/controller_default_test.go index e6165068f..ed3974972 100644 --- a/internal/controller/ledger/controller_default_test.go +++ b/internal/controller/ledger/controller_default_test.go @@ -62,7 +62,7 @@ func TestCreateTransaction(t *testing.T) { return x }) - _, err := l.CreateTransaction(context.Background(), Parameters[RunScript]{ + _, _, err := l.CreateTransaction(context.Background(), Parameters[RunScript]{ Input: runScript, }) require.NoError(t, err) @@ -108,7 +108,7 @@ func TestRevertTransaction(t *testing.T) { })). Return(nil) - _, err := l.RevertTransaction(ctx, Parameters[RevertTransaction]{ + _, _, err := l.RevertTransaction(ctx, Parameters[RevertTransaction]{ Input: RevertTransaction{ TransactionID: 1, }, @@ -147,7 +147,7 @@ func TestSaveTransactionMetadata(t *testing.T) { })). Return(nil) - err := l.SaveTransactionMetadata(ctx, Parameters[SaveTransactionMetadata]{ + _, err := l.SaveTransactionMetadata(ctx, Parameters[SaveTransactionMetadata]{ Input: SaveTransactionMetadata{ Metadata: m, TransactionID: 1, @@ -184,7 +184,7 @@ func TestDeleteTransactionMetadata(t *testing.T) { })). Return(nil) - err := l.DeleteTransactionMetadata(ctx, Parameters[DeleteTransactionMetadata]{ + _, err := l.DeleteTransactionMetadata(ctx, Parameters[DeleteTransactionMetadata]{ Input: DeleteTransactionMetadata{ TransactionID: 1, Key: "foo", diff --git a/internal/controller/ledger/controller_generated_test.go b/internal/controller/ledger/controller_generated_test.go index 4fae9acac..7416ba889 100644 --- a/internal/controller/ledger/controller_generated_test.go +++ b/internal/controller/ledger/controller_generated_test.go @@ -69,12 +69,13 @@ func (mr *MockControllerMockRecorder) CountTransactions(ctx, query any) *gomock. } // CreateTransaction mocks base method. -func (m *MockController) CreateTransaction(ctx context.Context, parameters Parameters[RunScript]) (*ledger.CreatedTransaction, error) { +func (m *MockController) CreateTransaction(ctx context.Context, parameters Parameters[RunScript]) (*ledger.Log, *ledger.CreatedTransaction, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateTransaction", ctx, parameters) - ret0, _ := ret[0].(*ledger.CreatedTransaction) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(*ledger.CreatedTransaction) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } // CreateTransaction indicates an expected call of CreateTransaction. @@ -84,11 +85,12 @@ func (mr *MockControllerMockRecorder) CreateTransaction(ctx, parameters any) *go } // DeleteAccountMetadata mocks base method. -func (m *MockController) DeleteAccountMetadata(ctx context.Context, parameters Parameters[DeleteAccountMetadata]) error { +func (m *MockController) DeleteAccountMetadata(ctx context.Context, parameters Parameters[DeleteAccountMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteAccountMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // DeleteAccountMetadata indicates an expected call of DeleteAccountMetadata. @@ -98,11 +100,12 @@ func (mr *MockControllerMockRecorder) DeleteAccountMetadata(ctx, parameters any) } // DeleteTransactionMetadata mocks base method. -func (m *MockController) DeleteTransactionMetadata(ctx context.Context, parameters Parameters[DeleteTransactionMetadata]) error { +func (m *MockController) DeleteTransactionMetadata(ctx context.Context, parameters Parameters[DeleteTransactionMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteTransactionMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // DeleteTransactionMetadata indicates an expected call of DeleteTransactionMetadata. @@ -290,12 +293,13 @@ func (mr *MockControllerMockRecorder) ListTransactions(ctx, query any) *gomock.C } // RevertTransaction mocks base method. -func (m *MockController) RevertTransaction(ctx context.Context, parameters Parameters[RevertTransaction]) (*ledger.RevertedTransaction, error) { +func (m *MockController) RevertTransaction(ctx context.Context, parameters Parameters[RevertTransaction]) (*ledger.Log, *ledger.RevertedTransaction, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RevertTransaction", ctx, parameters) - ret0, _ := ret[0].(*ledger.RevertedTransaction) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(*ledger.RevertedTransaction) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } // RevertTransaction indicates an expected call of RevertTransaction. @@ -305,11 +309,12 @@ func (mr *MockControllerMockRecorder) RevertTransaction(ctx, parameters any) *go } // SaveAccountMetadata mocks base method. -func (m *MockController) SaveAccountMetadata(ctx context.Context, parameters Parameters[SaveAccountMetadata]) error { +func (m *MockController) SaveAccountMetadata(ctx context.Context, parameters Parameters[SaveAccountMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SaveAccountMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // SaveAccountMetadata indicates an expected call of SaveAccountMetadata. @@ -319,11 +324,12 @@ func (mr *MockControllerMockRecorder) SaveAccountMetadata(ctx, parameters any) * } // SaveTransactionMetadata mocks base method. -func (m *MockController) SaveTransactionMetadata(ctx context.Context, parameters Parameters[SaveTransactionMetadata]) error { +func (m *MockController) SaveTransactionMetadata(ctx context.Context, parameters Parameters[SaveTransactionMetadata]) (*ledger.Log, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SaveTransactionMetadata", ctx, parameters) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*ledger.Log) + ret1, _ := ret[1].(error) + return ret0, ret1 } // SaveTransactionMetadata indicates an expected call of SaveTransactionMetadata. diff --git a/internal/controller/ledger/controller_with_events.go b/internal/controller/ledger/controller_with_events.go index 16d4886bd..e704bae78 100644 --- a/internal/controller/ledger/controller_with_events.go +++ b/internal/controller/ledger/controller_with_events.go @@ -19,22 +19,22 @@ func NewControllerWithEvents(ledger ledger.Ledger, underlying Controller, listen listener: listener, } } -func (ctrl *ControllerWithEvents) CreateTransaction(ctx context.Context, parameters Parameters[RunScript]) (*ledger.CreatedTransaction, error) { - ret, err := ctrl.Controller.CreateTransaction(ctx, parameters) +func (ctrl *ControllerWithEvents) CreateTransaction(ctx context.Context, parameters Parameters[RunScript]) (*ledger.Log, *ledger.CreatedTransaction, error) { + log, ret, err := ctrl.Controller.CreateTransaction(ctx, parameters) if err != nil { - return nil, err + return nil, nil, err } if !parameters.DryRun { ctrl.listener.CommittedTransactions(ctx, ctrl.ledger.Name, ret.Transaction, ret.AccountMetadata) } - return ret, nil + return log, ret, nil } -func (ctrl *ControllerWithEvents) RevertTransaction(ctx context.Context, parameters Parameters[RevertTransaction]) (*ledger.RevertedTransaction, error) { - ret, err := ctrl.Controller.RevertTransaction(ctx, parameters) +func (ctrl *ControllerWithEvents) RevertTransaction(ctx context.Context, parameters Parameters[RevertTransaction]) (*ledger.Log, *ledger.RevertedTransaction, error) { + log, ret, err := ctrl.Controller.RevertTransaction(ctx, parameters) if err != nil { - return nil, err + return nil, nil, err } if !parameters.DryRun { ctrl.listener.RevertedTransaction( @@ -45,13 +45,13 @@ func (ctrl *ControllerWithEvents) RevertTransaction(ctx context.Context, paramet ) } - return ret, nil + return log, ret, nil } -func (ctrl *ControllerWithEvents) SaveTransactionMetadata(ctx context.Context, parameters Parameters[SaveTransactionMetadata]) error { - err := ctrl.Controller.SaveTransactionMetadata(ctx, parameters) +func (ctrl *ControllerWithEvents) SaveTransactionMetadata(ctx context.Context, parameters Parameters[SaveTransactionMetadata]) (*ledger.Log, error) { + log, err := ctrl.Controller.SaveTransactionMetadata(ctx, parameters) if err != nil { - return err + return nil, err } if !parameters.DryRun { ctrl.listener.SavedMetadata( @@ -63,13 +63,13 @@ func (ctrl *ControllerWithEvents) SaveTransactionMetadata(ctx context.Context, p ) } - return nil + return log, nil } -func (ctrl *ControllerWithEvents) SaveAccountMetadata(ctx context.Context, parameters Parameters[SaveAccountMetadata]) error { - err := ctrl.Controller.SaveAccountMetadata(ctx, parameters) +func (ctrl *ControllerWithEvents) SaveAccountMetadata(ctx context.Context, parameters Parameters[SaveAccountMetadata]) (*ledger.Log, error) { + log, err := ctrl.Controller.SaveAccountMetadata(ctx, parameters) if err != nil { - return err + return nil, err } if !parameters.DryRun { ctrl.listener.SavedMetadata( @@ -81,13 +81,13 @@ func (ctrl *ControllerWithEvents) SaveAccountMetadata(ctx context.Context, param ) } - return nil + return log, nil } -func (ctrl *ControllerWithEvents) DeleteTransactionMetadata(ctx context.Context, parameters Parameters[DeleteTransactionMetadata]) error { - err := ctrl.Controller.DeleteTransactionMetadata(ctx, parameters) +func (ctrl *ControllerWithEvents) DeleteTransactionMetadata(ctx context.Context, parameters Parameters[DeleteTransactionMetadata]) (*ledger.Log, error) { + log, err := ctrl.Controller.DeleteTransactionMetadata(ctx, parameters) if err != nil { - return err + return nil, err } if !parameters.DryRun { ctrl.listener.DeletedMetadata( @@ -99,13 +99,13 @@ func (ctrl *ControllerWithEvents) DeleteTransactionMetadata(ctx context.Context, ) } - return nil + return log, nil } -func (ctrl *ControllerWithEvents) DeleteAccountMetadata(ctx context.Context, parameters Parameters[DeleteAccountMetadata]) error { - err := ctrl.Controller.DeleteAccountMetadata(ctx, parameters) +func (ctrl *ControllerWithEvents) DeleteAccountMetadata(ctx context.Context, parameters Parameters[DeleteAccountMetadata]) (*ledger.Log, error) { + log, err := ctrl.Controller.DeleteAccountMetadata(ctx, parameters) if err != nil { - return err + return nil, err } if !parameters.DryRun { ctrl.listener.DeletedMetadata( @@ -117,7 +117,7 @@ func (ctrl *ControllerWithEvents) DeleteAccountMetadata(ctx context.Context, par ) } - return nil + return log, nil } var _ Controller = (*ControllerWithEvents)(nil) diff --git a/internal/controller/ledger/controller_with_too_many_client_handling.go b/internal/controller/ledger/controller_with_too_many_client_handling.go index 911fcb6fb..01b864d63 100644 --- a/internal/controller/ledger/controller_with_too_many_client_handling.go +++ b/internal/controller/ledger/controller_with_too_many_client_handling.go @@ -38,40 +38,45 @@ func NewControllerWithTooManyClientHandling( } } -func (ctrl *ControllerWithTooManyClientHandling) CreateTransaction(ctx context.Context, parameters Parameters[RunScript]) (*ledger.CreatedTransaction, error) { +func (ctrl *ControllerWithTooManyClientHandling) CreateTransaction(ctx context.Context, parameters Parameters[RunScript]) (*ledger.Log, *ledger.CreatedTransaction, error) { return handleRetry(ctx, ctrl.tracer, ctrl.delayCalculator, parameters, ctrl.Controller.CreateTransaction) } -func (ctrl *ControllerWithTooManyClientHandling) RevertTransaction(ctx context.Context, parameters Parameters[RevertTransaction]) (*ledger.RevertedTransaction, error) { +func (ctrl *ControllerWithTooManyClientHandling) RevertTransaction(ctx context.Context, parameters Parameters[RevertTransaction]) (*ledger.Log, *ledger.RevertedTransaction, error) { return handleRetry(ctx, ctrl.tracer, ctrl.delayCalculator, parameters, ctrl.Controller.RevertTransaction) } -func (ctrl *ControllerWithTooManyClientHandling) SaveTransactionMetadata(ctx context.Context, parameters Parameters[SaveTransactionMetadata]) error { - _, err := handleRetry(ctx, ctrl.tracer, ctrl.delayCalculator, parameters, func(ctx context.Context, parameters Parameters[SaveTransactionMetadata]) (*struct{}, error) { - return nil, ctrl.Controller.SaveTransactionMetadata(ctx, parameters) +func (ctrl *ControllerWithTooManyClientHandling) SaveTransactionMetadata(ctx context.Context, parameters Parameters[SaveTransactionMetadata]) (*ledger.Log, error) { + log, _, err := handleRetry(ctx, ctrl.tracer, ctrl.delayCalculator, parameters, func(ctx context.Context, parameters Parameters[SaveTransactionMetadata]) (*ledger.Log, *struct{}, error) { + log, err := ctrl.Controller.SaveTransactionMetadata(ctx, parameters) + return log, nil, err }) - return err + + return log, err } -func (ctrl *ControllerWithTooManyClientHandling) SaveAccountMetadata(ctx context.Context, parameters Parameters[SaveAccountMetadata]) error { - _, err := handleRetry(ctx, ctrl.tracer, ctrl.delayCalculator, parameters, func(ctx context.Context, parameters Parameters[SaveAccountMetadata]) (*struct{}, error) { - return nil, ctrl.Controller.SaveAccountMetadata(ctx, parameters) +func (ctrl *ControllerWithTooManyClientHandling) SaveAccountMetadata(ctx context.Context, parameters Parameters[SaveAccountMetadata]) (*ledger.Log, error) { + log, _, err := handleRetry(ctx, ctrl.tracer, ctrl.delayCalculator, parameters, func(ctx context.Context, parameters Parameters[SaveAccountMetadata]) (*ledger.Log, *struct{}, error) { + log, err := ctrl.Controller.SaveAccountMetadata(ctx, parameters) + return log, nil, err }) - return err + return log, err } -func (ctrl *ControllerWithTooManyClientHandling) DeleteTransactionMetadata(ctx context.Context, parameters Parameters[DeleteTransactionMetadata]) error { - _, err := handleRetry(ctx, ctrl.tracer, ctrl.delayCalculator, parameters, func(ctx context.Context, parameters Parameters[DeleteTransactionMetadata]) (*struct{}, error) { - return nil, ctrl.Controller.DeleteTransactionMetadata(ctx, parameters) +func (ctrl *ControllerWithTooManyClientHandling) DeleteTransactionMetadata(ctx context.Context, parameters Parameters[DeleteTransactionMetadata]) (*ledger.Log, error) { + log, _, err := handleRetry(ctx, ctrl.tracer, ctrl.delayCalculator, parameters, func(ctx context.Context, parameters Parameters[DeleteTransactionMetadata]) (*ledger.Log, *struct{}, error) { + log, err := ctrl.Controller.DeleteTransactionMetadata(ctx, parameters) + return log, nil, err }) - return err + return log, err } -func (ctrl *ControllerWithTooManyClientHandling) DeleteAccountMetadata(ctx context.Context, parameters Parameters[DeleteAccountMetadata]) error { - _, err := handleRetry(ctx, ctrl.tracer, ctrl.delayCalculator, parameters, func(ctx context.Context, parameters Parameters[DeleteAccountMetadata]) (*struct{}, error) { - return nil, ctrl.Controller.DeleteAccountMetadata(ctx, parameters) +func (ctrl *ControllerWithTooManyClientHandling) DeleteAccountMetadata(ctx context.Context, parameters Parameters[DeleteAccountMetadata]) (*ledger.Log, error) { + log, _, err := handleRetry(ctx, ctrl.tracer, ctrl.delayCalculator, parameters, func(ctx context.Context, parameters Parameters[DeleteAccountMetadata]) (*ledger.Log, *struct{}, error) { + log, err := ctrl.Controller.DeleteAccountMetadata(ctx, parameters) + return log, nil, err }) - return err + return log, err } var _ Controller = (*ControllerWithTooManyClientHandling)(nil) @@ -81,29 +86,29 @@ func handleRetry[INPUT, OUTPUT any]( tracer trace.Tracer, delayCalculator DelayCalculator, parameters Parameters[INPUT], - fn func(ctx context.Context, parameters Parameters[INPUT]) (*OUTPUT, error), -) (*OUTPUT, error) { + fn func(ctx context.Context, parameters Parameters[INPUT]) (*ledger.Log, *OUTPUT, error), +) (*ledger.Log, *OUTPUT, error) { ctx, span := tracer.Start(ctx, "TooManyClientRetrier") defer span.End() count := 0 for { - output, err := fn(ctx, parameters) + log, output, err := fn(ctx, parameters) if err != nil && errors.Is(err, postgres.ErrTooManyClient{}) { delay := delayCalculator.Next(count) if delay == 0 { - return nil, err + return nil, nil, err } select { case <-ctx.Done(): - return nil, ctx.Err() + return nil, nil, ctx.Err() case <-time.After(delay): count++ span.SetAttributes(attribute.Int("retry", count)) continue } } - return output, err + return log, output, err } } diff --git a/internal/controller/ledger/controller_with_too_many_client_handling_test.go b/internal/controller/ledger/controller_with_too_many_client_handling_test.go index 2dca515f8..1d172da60 100644 --- a/internal/controller/ledger/controller_with_too_many_client_handling_test.go +++ b/internal/controller/ledger/controller_with_too_many_client_handling_test.go @@ -27,12 +27,12 @@ func TestNewControllerWithTooManyClientHandling(t *testing.T) { underlyingLedgerController.EXPECT(). CreateTransaction(gomock.Any(), parameters). - Return(nil, postgres.ErrTooManyClient{}). + Return(nil, nil, postgres.ErrTooManyClient{}). Times(2) underlyingLedgerController.EXPECT(). CreateTransaction(gomock.Any(), parameters). - Return(&ledger.CreatedTransaction{ + Return(&ledger.Log{}, &ledger.CreatedTransaction{ Transaction: ledger.NewTransaction(), }, nil) @@ -45,7 +45,7 @@ func TestNewControllerWithTooManyClientHandling(t *testing.T) { Return(10 * time.Millisecond) ledgerController := NewControllerWithTooManyClientHandling(underlyingLedgerController, noop.Tracer{}, delayCalculator) - _, err := ledgerController.CreateTransaction(ctx, parameters) + _, _, err := ledgerController.CreateTransaction(ctx, parameters) require.NoError(t, err) }) @@ -61,7 +61,7 @@ func TestNewControllerWithTooManyClientHandling(t *testing.T) { underlyingLedgerController.EXPECT(). CreateTransaction(gomock.Any(), parameters). - Return(nil, postgres.ErrTooManyClient{}). + Return(nil, nil, postgres.ErrTooManyClient{}). Times(2) delayCalculator.EXPECT(). @@ -73,7 +73,7 @@ func TestNewControllerWithTooManyClientHandling(t *testing.T) { Return(time.Duration(0)) ledgerController := NewControllerWithTooManyClientHandling(underlyingLedgerController, noop.Tracer{}, delayCalculator) - _, err := ledgerController.CreateTransaction(ctx, parameters) + _, _, err := ledgerController.CreateTransaction(ctx, parameters) require.Error(t, err) require.True(t, errors.Is(err, postgres.ErrTooManyClient{})) }) diff --git a/internal/controller/ledger/controller_with_traces.go b/internal/controller/ledger/controller_with_traces.go index 9c25bea1a..20b505323 100644 --- a/internal/controller/ledger/controller_with_traces.go +++ b/internal/controller/ledger/controller_with_traces.go @@ -98,40 +98,46 @@ func (ctrl *ControllerWithTraces) GetVolumesWithBalances(ctx context.Context, q }) } -func (ctrl *ControllerWithTraces) CreateTransaction(ctx context.Context, parameters Parameters[RunScript]) (*ledger.CreatedTransaction, error) { - return tracing.Trace(ctx, ctrl.tracer, "CreateTransaction", func(ctx context.Context) (*ledger.CreatedTransaction, error) { - return ctrl.underlying.CreateTransaction(ctx, parameters) - }) +func (ctrl *ControllerWithTraces) CreateTransaction(ctx context.Context, parameters Parameters[RunScript]) (*ledger.Log, *ledger.CreatedTransaction, error) { + ctx, span := ctrl.tracer.Start(ctx, "CreateTransaction") + defer span.End() + + return ctrl.underlying.CreateTransaction(ctx, parameters) } -func (ctrl *ControllerWithTraces) RevertTransaction(ctx context.Context, parameters Parameters[RevertTransaction]) (*ledger.RevertedTransaction, error) { - return tracing.Trace(ctx, ctrl.tracer, "RevertTransaction", func(ctx context.Context) (*ledger.RevertedTransaction, error) { - return ctrl.underlying.RevertTransaction(ctx, parameters) - }) +func (ctrl *ControllerWithTraces) RevertTransaction(ctx context.Context, parameters Parameters[RevertTransaction]) (*ledger.Log, *ledger.RevertedTransaction, error) { + ctx, span := ctrl.tracer.Start(ctx, "RevertTransaction") + defer span.End() + + return ctrl.underlying.RevertTransaction(ctx, parameters) } -func (ctrl *ControllerWithTraces) SaveTransactionMetadata(ctx context.Context, parameters Parameters[SaveTransactionMetadata]) error { - return tracing.SkipResult(tracing.Trace(ctx, ctrl.tracer, "SaveTransactionMetadata", tracing.NoResult(func(ctx context.Context) error { - return ctrl.underlying.SaveTransactionMetadata(ctx, parameters) - }))) +func (ctrl *ControllerWithTraces) SaveTransactionMetadata(ctx context.Context, parameters Parameters[SaveTransactionMetadata]) (*ledger.Log, error) { + ctx, span := ctrl.tracer.Start(ctx, "SaveTransactionMetadata") + defer span.End() + + return ctrl.underlying.SaveTransactionMetadata(ctx, parameters) } -func (ctrl *ControllerWithTraces) SaveAccountMetadata(ctx context.Context, parameters Parameters[SaveAccountMetadata]) error { - return tracing.SkipResult(tracing.Trace(ctx, ctrl.tracer, "SaveAccountMetadata", tracing.NoResult(func(ctx context.Context) error { - return ctrl.underlying.SaveAccountMetadata(ctx, parameters) - }))) +func (ctrl *ControllerWithTraces) SaveAccountMetadata(ctx context.Context, parameters Parameters[SaveAccountMetadata]) (*ledger.Log, error) { + ctx, span := ctrl.tracer.Start(ctx, "SaveAccountMetadata") + defer span.End() + + return ctrl.underlying.SaveAccountMetadata(ctx, parameters) } -func (ctrl *ControllerWithTraces) DeleteTransactionMetadata(ctx context.Context, parameters Parameters[DeleteTransactionMetadata]) error { - return tracing.SkipResult(tracing.Trace(ctx, ctrl.tracer, "DeleteTransactionMetadata", tracing.NoResult(func(ctx context.Context) error { - return ctrl.underlying.DeleteTransactionMetadata(ctx, parameters) - }))) +func (ctrl *ControllerWithTraces) DeleteTransactionMetadata(ctx context.Context, parameters Parameters[DeleteTransactionMetadata]) (*ledger.Log, error) { + ctx, span := ctrl.tracer.Start(ctx, "DeleteTransactionMetadata") + defer span.End() + + return ctrl.underlying.DeleteTransactionMetadata(ctx, parameters) } -func (ctrl *ControllerWithTraces) DeleteAccountMetadata(ctx context.Context, parameters Parameters[DeleteAccountMetadata]) error { - return tracing.SkipResult(tracing.Trace(ctx, ctrl.tracer, "DeleteAccountMetadata", tracing.NoResult(func(ctx context.Context) error { - return ctrl.underlying.DeleteAccountMetadata(ctx, parameters) - }))) +func (ctrl *ControllerWithTraces) DeleteAccountMetadata(ctx context.Context, parameters Parameters[DeleteAccountMetadata]) (*ledger.Log, error) { + ctx, span := ctrl.tracer.Start(ctx, "DeleteAccountMetadata") + defer span.End() + + return ctrl.underlying.DeleteAccountMetadata(ctx, parameters) } func (ctrl *ControllerWithTraces) GetStats(ctx context.Context) (Stats, error) { diff --git a/internal/controller/ledger/log_process.go b/internal/controller/ledger/log_process.go index cb09770d9..6415a812d 100644 --- a/internal/controller/ledger/log_process.go +++ b/internal/controller/ledger/log_process.go @@ -30,14 +30,17 @@ func (lp *logProcessor[INPUT, OUTPUT]) runTx( store Store, parameters Parameters[INPUT], fn func(ctx context.Context, sqlTX TX, parameters Parameters[INPUT]) (*OUTPUT, error), -) (*OUTPUT, error) { - var payload *OUTPUT +) (*ledger.Log, *OUTPUT, error) { + var ( + output *OUTPUT + log ledger.Log + ) err := store.WithTX(ctx, nil, func(tx TX) (commit bool, err error) { - payload, err = fn(ctx, tx, parameters) + output, err = fn(ctx, tx, parameters) if err != nil { return false, err } - log := ledger.NewLog(*payload) + log = ledger.NewLog(*output) log.IdempotencyKey = parameters.IdempotencyKey log.IdempotencyHash = ledger.ComputeIdempotencyHash(parameters.Input) @@ -53,7 +56,7 @@ func (lp *logProcessor[INPUT, OUTPUT]) runTx( return true, nil }) - return payload, err + return &log, output, err } func (lp *logProcessor[INPUT, OUTPUT]) forgeLog( @@ -61,19 +64,19 @@ func (lp *logProcessor[INPUT, OUTPUT]) forgeLog( store Store, parameters Parameters[INPUT], fn func(ctx context.Context, sqlTX TX, parameters Parameters[INPUT]) (*OUTPUT, error), -) (*OUTPUT, error) { +) (*ledger.Log, *OUTPUT, error) { if parameters.IdempotencyKey != "" { - output, err := lp.fetchLogWithIK(ctx, store, parameters) + log, output, err := lp.fetchLogWithIK(ctx, store, parameters) if err != nil { - return nil, err + return nil, nil, err } if output != nil { - return output, nil + return log, output, nil } } for { - output, err := lp.runTx(ctx, store, parameters, fn) + log, output, err := lp.runTx(ctx, store, parameters, fn) if err != nil { switch { case errors.Is(err, postgres.ErrDeadlockDetected): @@ -85,39 +88,39 @@ func (lp *logProcessor[INPUT, OUTPUT]) forgeLog( continue // A log with the IK could have been inserted in the meantime, read again the database to retrieve it case errors.Is(err, ErrIdempotencyKeyConflict{}): - output, err := lp.fetchLogWithIK(ctx, store, parameters) + log, output, err := lp.fetchLogWithIK(ctx, store, parameters) if err != nil { - return nil, err + return nil, nil, err } if output == nil { panic("incoherent error, received duplicate IK but log not found in database") } - return output, nil + return log, output, nil default: - return nil, fmt.Errorf("unexpected error while forging log: %w", err) + return nil, nil, fmt.Errorf("unexpected error while forging log: %w", err) } } - return output, nil + return log, output, nil } } -func (lp *logProcessor[INPUT, OUTPUT]) fetchLogWithIK(ctx context.Context, store Store, parameters Parameters[INPUT]) (*OUTPUT, error) { +func (lp *logProcessor[INPUT, OUTPUT]) fetchLogWithIK(ctx context.Context, store Store, parameters Parameters[INPUT]) (*ledger.Log, *OUTPUT, error) { log, err := store.ReadLogWithIdempotencyKey(ctx, parameters.IdempotencyKey) if err != nil && !errors.Is(err, postgres.ErrNotFound) { - return nil, err + return nil, nil, err } if err == nil { // notes(gfyrag): idempotency hash should never be empty in this case, but data from previous // ledger version does not have this field and it cannot be recomputed if log.IdempotencyHash != "" { if computedHash := ledger.ComputeIdempotencyHash(parameters.Input); log.IdempotencyHash != computedHash { - return nil, newErrInvalidIdempotencyInputs(log.IdempotencyKey, log.IdempotencyHash, computedHash) + return nil, nil, newErrInvalidIdempotencyInputs(log.IdempotencyKey, log.IdempotencyHash, computedHash) } } - return pointer.For(log.Data.(OUTPUT)), nil + return log, pointer.For(log.Data.(OUTPUT)), nil } - return nil, nil + return nil, nil, nil } diff --git a/internal/controller/ledger/log_process_test.go b/internal/controller/ledger/log_process_test.go index 8b58981e2..544b42848 100644 --- a/internal/controller/ledger/log_process_test.go +++ b/internal/controller/ledger/log_process_test.go @@ -32,7 +32,7 @@ func TestForgeLogWithIKConflict(t *testing.T) { }, nil) lp := newLogProcessor[RunScript, ledger.CreatedTransaction]("foo", noop.Int64Counter{}) - _, err := lp.forgeLog(ctx, store, Parameters[RunScript]{ + _, _, err := lp.forgeLog(ctx, store, Parameters[RunScript]{ IdempotencyKey: "foo", }, nil) require.NoError(t, err) @@ -56,6 +56,6 @@ func TestForgeLogWithDeadlock(t *testing.T) { Return(nil) lp := newLogProcessor[RunScript, ledger.CreatedTransaction]("foo", noop.Int64Counter{}) - _, err := lp.forgeLog(ctx, store, Parameters[RunScript]{}, nil) + _, _, err := lp.forgeLog(ctx, store, Parameters[RunScript]{}, nil) require.NoError(t, err) } diff --git a/openapi.yaml b/openapi.yaml index 325d63003..81042b8ec 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -3658,8 +3658,11 @@ components: properties: responseType: type: string + logID: + type: integer required: - responseType + - logID V2BulkElementResultCreateTransaction: allOf: - $ref: '#/components/schemas/V2BaseBulkElementResult' diff --git a/openapi/v2.yaml b/openapi/v2.yaml index b7cb740f0..137eb09c8 100644 --- a/openapi/v2.yaml +++ b/openapi/v2.yaml @@ -1928,8 +1928,11 @@ components: properties: responseType: type: string + logID: + type: integer required: - responseType + - logID V2BulkElementResultCreateTransaction: allOf: - $ref: "#/components/schemas/V2BaseBulkElementResult" diff --git a/pkg/client/.speakeasy/gen.lock b/pkg/client/.speakeasy/gen.lock index 0474584bd..984658c2d 100644 --- a/pkg/client/.speakeasy/gen.lock +++ b/pkg/client/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: a9ac79e1-e429-4ee3-96c4-ec973f19bec3 management: - docChecksum: b360e18f2833b14257df2742a09a1999 + docChecksum: 5e24fc96851e508606f6b6668ed3ffb3 docVersion: v1 speakeasyVersion: 1.351.0 generationVersion: 2.384.1 - releaseVersion: 0.4.27 - configChecksum: 9a9eff6bf575499aecf0bdcfa3f6d80b + releaseVersion: 0.4.28 + configChecksum: 9eb898e4ab7291afdada27c15d20aa5d features: go: additionalDependencies: 0.1.0 diff --git a/pkg/client/.speakeasy/gen.yaml b/pkg/client/.speakeasy/gen.yaml index 1cbee3f5c..943f49877 100644 --- a/pkg/client/.speakeasy/gen.yaml +++ b/pkg/client/.speakeasy/gen.yaml @@ -15,7 +15,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true go: - version: 0.4.27 + version: 0.4.28 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false clientServerStatusCodesAsErrors: true diff --git a/pkg/client/docs/models/components/v2bulkelementresultaddmetadata.md b/pkg/client/docs/models/components/v2bulkelementresultaddmetadata.md index 5f8d1fefb..ae6b68121 100644 --- a/pkg/client/docs/models/components/v2bulkelementresultaddmetadata.md +++ b/pkg/client/docs/models/components/v2bulkelementresultaddmetadata.md @@ -5,4 +5,5 @@ | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `ResponseType` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| `ResponseType` | *string* | :heavy_check_mark: | N/A | +| `LogID` | *int64* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/pkg/client/docs/models/components/v2bulkelementresultcreatetransaction.md b/pkg/client/docs/models/components/v2bulkelementresultcreatetransaction.md index eac3e3d86..dc6c43bba 100644 --- a/pkg/client/docs/models/components/v2bulkelementresultcreatetransaction.md +++ b/pkg/client/docs/models/components/v2bulkelementresultcreatetransaction.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `ResponseType` | *string* | :heavy_check_mark: | N/A | +| `LogID` | *int64* | :heavy_check_mark: | N/A | | `Data` | [components.V2Transaction](../../models/components/v2transaction.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/pkg/client/docs/models/components/v2bulkelementresultdeletemetadata.md b/pkg/client/docs/models/components/v2bulkelementresultdeletemetadata.md index 40a884420..ca68c3046 100644 --- a/pkg/client/docs/models/components/v2bulkelementresultdeletemetadata.md +++ b/pkg/client/docs/models/components/v2bulkelementresultdeletemetadata.md @@ -5,4 +5,5 @@ | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `ResponseType` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| `ResponseType` | *string* | :heavy_check_mark: | N/A | +| `LogID` | *int64* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/pkg/client/docs/models/components/v2bulkelementresulterror.md b/pkg/client/docs/models/components/v2bulkelementresulterror.md index 1fdefd125..e0af2417a 100644 --- a/pkg/client/docs/models/components/v2bulkelementresulterror.md +++ b/pkg/client/docs/models/components/v2bulkelementresulterror.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | | `ResponseType` | *string* | :heavy_check_mark: | N/A | +| `LogID` | *int64* | :heavy_check_mark: | N/A | | `ErrorCode` | *string* | :heavy_check_mark: | N/A | | `ErrorDescription` | *string* | :heavy_check_mark: | N/A | | `ErrorDetails` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/pkg/client/docs/models/components/v2bulkelementresultreverttransaction.md b/pkg/client/docs/models/components/v2bulkelementresultreverttransaction.md index b85016b60..23bf770d5 100644 --- a/pkg/client/docs/models/components/v2bulkelementresultreverttransaction.md +++ b/pkg/client/docs/models/components/v2bulkelementresultreverttransaction.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `ResponseType` | *string* | :heavy_check_mark: | N/A | +| `LogID` | *int64* | :heavy_check_mark: | N/A | | `Data` | [components.V2Transaction](../../models/components/v2transaction.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/pkg/client/formance.go b/pkg/client/formance.go index 9246adb7e..27f37ab7a 100644 --- a/pkg/client/formance.go +++ b/pkg/client/formance.go @@ -143,9 +143,9 @@ func New(opts ...SDKOption) *Formance { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "v1", - SDKVersion: "0.4.27", + SDKVersion: "0.4.28", GenVersion: "2.384.1", - UserAgent: "speakeasy-sdk/go 0.4.27 2.384.1 v1 github.com/formancehq/ledger/pkg/client", + UserAgent: "speakeasy-sdk/go 0.4.28 2.384.1 v1 github.com/formancehq/ledger/pkg/client", Hooks: hooks.New(), }, } diff --git a/pkg/client/models/components/v2bulkelementresult.go b/pkg/client/models/components/v2bulkelementresult.go index 31623ee90..0f18b1cb2 100644 --- a/pkg/client/models/components/v2bulkelementresult.go +++ b/pkg/client/models/components/v2bulkelementresult.go @@ -11,6 +11,7 @@ import ( type V2BulkElementResultError struct { ResponseType string `json:"responseType"` + LogID int64 `json:"logID"` ErrorCode string `json:"errorCode"` ErrorDescription string `json:"errorDescription"` ErrorDetails *string `json:"errorDetails,omitempty"` @@ -23,6 +24,13 @@ func (o *V2BulkElementResultError) GetResponseType() string { return o.ResponseType } +func (o *V2BulkElementResultError) GetLogID() int64 { + if o == nil { + return 0 + } + return o.LogID +} + func (o *V2BulkElementResultError) GetErrorCode() string { if o == nil { return "" @@ -46,6 +54,7 @@ func (o *V2BulkElementResultError) GetErrorDetails() *string { type V2BulkElementResultDeleteMetadata struct { ResponseType string `json:"responseType"` + LogID int64 `json:"logID"` } func (o *V2BulkElementResultDeleteMetadata) GetResponseType() string { @@ -55,8 +64,16 @@ func (o *V2BulkElementResultDeleteMetadata) GetResponseType() string { return o.ResponseType } +func (o *V2BulkElementResultDeleteMetadata) GetLogID() int64 { + if o == nil { + return 0 + } + return o.LogID +} + type V2BulkElementResultRevertTransaction struct { ResponseType string `json:"responseType"` + LogID int64 `json:"logID"` Data V2Transaction `json:"data"` } @@ -67,6 +84,13 @@ func (o *V2BulkElementResultRevertTransaction) GetResponseType() string { return o.ResponseType } +func (o *V2BulkElementResultRevertTransaction) GetLogID() int64 { + if o == nil { + return 0 + } + return o.LogID +} + func (o *V2BulkElementResultRevertTransaction) GetData() V2Transaction { if o == nil { return V2Transaction{} @@ -76,6 +100,7 @@ func (o *V2BulkElementResultRevertTransaction) GetData() V2Transaction { type V2BulkElementResultAddMetadata struct { ResponseType string `json:"responseType"` + LogID int64 `json:"logID"` } func (o *V2BulkElementResultAddMetadata) GetResponseType() string { @@ -85,8 +110,16 @@ func (o *V2BulkElementResultAddMetadata) GetResponseType() string { return o.ResponseType } +func (o *V2BulkElementResultAddMetadata) GetLogID() int64 { + if o == nil { + return 0 + } + return o.LogID +} + type V2BulkElementResultCreateTransaction struct { ResponseType string `json:"responseType"` + LogID int64 `json:"logID"` Data V2Transaction `json:"data"` } @@ -97,6 +130,13 @@ func (o *V2BulkElementResultCreateTransaction) GetResponseType() string { return o.ResponseType } +func (o *V2BulkElementResultCreateTransaction) GetLogID() int64 { + if o == nil { + return 0 + } + return o.LogID +} + func (o *V2BulkElementResultCreateTransaction) GetData() V2Transaction { if o == nil { return V2Transaction{} diff --git a/pkg/generate/generator.go b/pkg/generate/generator.go index 52d041b4e..0b1bfcd5d 100644 --- a/pkg/generate/generator.go +++ b/pkg/generate/generator.go @@ -1,42 +1,248 @@ package generate import ( + "context" + "encoding/json" + "errors" + "fmt" "github.com/dop251/goja" + ledger "github.com/formancehq/ledger/internal" + v2 "github.com/formancehq/ledger/internal/api/v2" + ledgercontroller "github.com/formancehq/ledger/internal/controller/ledger" + "github.com/formancehq/ledger/pkg/client" + "github.com/formancehq/ledger/pkg/client/models/components" + "github.com/formancehq/ledger/pkg/client/models/operations" "github.com/google/uuid" + "math/big" + "time" ) +type Action struct { + v2.BulkElement +} + type Result struct { - Script string `json:"script"` - Variables map[string]string `json:"variables"` + components.V2BulkElementResult +} + +func (r Result) GetLogID() int64 { + switch r.Type { + case components.V2BulkElementResultTypeCreateTransaction: + return r.V2BulkElementResultCreateTransaction.LogID + case components.V2BulkElementResultTypeAddMetadata: + return r.V2BulkElementResultAddMetadata.LogID + case components.V2BulkElementResultTypeDeleteMetadata: + return r.V2BulkElementResultDeleteMetadata.LogID + case components.V2BulkElementResultTypeRevertTransaction: + return r.V2BulkElementResultRevertTransaction.LogID + default: + panic(fmt.Sprintf("unexpected result type: %s", r.Type)) + } +} + +func (r Action) Apply(ctx context.Context, client *client.V2, l string) (*Result, error) { + + var bulkElement components.V2BulkElement + switch r.Action { + case v2.ActionCreateTransaction, "": // Handling "" as CREATE_TRANSACTION for backward compatibility + transactionRequest := &ledgercontroller.RunScript{} + err := json.Unmarshal(r.Data, transactionRequest) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal transaction request: %w", err) + } + + bulkElement = components.CreateV2BulkElementCreateTransaction(components.V2BulkElementCreateTransaction{ + Data: &components.V2PostTransaction{ + Timestamp: func() *time.Time { + if transactionRequest.Timestamp.IsZero() { + return nil + } + return &transactionRequest.Timestamp.Time + }(), + Script: &components.V2PostTransactionScript{ + Plain: transactionRequest.Script.Plain, + Vars: transactionRequest.Script.Vars, + }, + Reference: func() *string { + if transactionRequest.Reference == "" { + return nil + } + return &transactionRequest.Reference + }(), + Metadata: transactionRequest.Metadata, + }, + }) + case v2.ActionAddMetadata: + addMetadataRequest := &v2.AddMetadataRequest{} + err := json.Unmarshal(r.Data, addMetadataRequest) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal add metadata request: %w", err) + } + + var targetID components.V2TargetID + switch addMetadataRequest.TargetType { + case ledger.MetaTargetTypeAccount: + var targetIDStr string + if err := json.Unmarshal(addMetadataRequest.TargetID, &targetIDStr); err != nil { + return nil, fmt.Errorf("failed to unmarshal target id: %w", err) + } + targetID = components.CreateV2TargetIDStr(targetIDStr) + case ledger.MetaTargetTypeTransaction: + var targetIDInt int + if err := json.Unmarshal(addMetadataRequest.TargetID, &targetIDInt); err != nil { + return nil, fmt.Errorf("failed to unmarshal target id: %w", err) + } + targetID = components.CreateV2TargetIDBigint(big.NewInt(int64(targetIDInt))) + default: + panic("unexpected target id type") + } + + bulkElement = components.CreateV2BulkElementAddMetadata(components.V2BulkElementAddMetadata{ + Data: &components.Data{ + TargetID: targetID, + TargetType: components.V2TargetType(addMetadataRequest.TargetType), + Metadata: addMetadataRequest.Metadata, + }, + }) + case v2.ActionDeleteMetadata: + deleteMetadataRequest := &v2.DeleteMetadataRequest{} + err := json.Unmarshal(r.Data, deleteMetadataRequest) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal delete metadata request: %w", err) + } + + var targetID components.V2TargetID + switch deleteMetadataRequest.TargetType { + case ledger.MetaTargetTypeAccount: + var targetIDStr string + if err := json.Unmarshal(deleteMetadataRequest.TargetID, &targetIDStr); err != nil { + return nil, fmt.Errorf("failed to unmarshal target id: %w", err) + } + targetID = components.CreateV2TargetIDStr(targetIDStr) + case ledger.MetaTargetTypeTransaction: + var targetIDInt int + if err := json.Unmarshal(deleteMetadataRequest.TargetID, &targetIDInt); err != nil { + return nil, fmt.Errorf("failed to unmarshal target id: %w", err) + } + targetID = components.CreateV2TargetIDBigint(big.NewInt(int64(targetIDInt))) + default: + panic("unexpected target id type") + } + + bulkElement = components.CreateV2BulkElementDeleteMetadata(components.V2BulkElementDeleteMetadata{ + Data: &components.V2BulkElementDeleteMetadataData{ + TargetID: targetID, + TargetType: components.V2TargetType(deleteMetadataRequest.TargetType), + Key: deleteMetadataRequest.Key, + }, + }) + case v2.ActionRevertTransaction: + revertMetadataRequest := &v2.RevertTransactionRequest{} + err := json.Unmarshal(r.Data, revertMetadataRequest) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal delete metadata request: %w", err) + } + + bulkElement = components.CreateV2BulkElementRevertTransaction(components.V2BulkElementRevertTransaction{ + Data: &components.V2BulkElementRevertTransactionData{ + ID: big.NewInt(int64(revertMetadataRequest.ID)), + Force: &revertMetadataRequest.Force, + AtEffectiveDate: &revertMetadataRequest.AtEffectiveDate, + }, + }) + default: + panic("unexpected action") + } + + response, err := client.CreateBulk(ctx, operations.V2CreateBulkRequest{ + Ledger: l, + RequestBody: []components.V2BulkElement{bulkElement}, + }) + if err != nil { + return nil, fmt.Errorf("creating transaction: %w", err) + } + + return &Result{response.V2BulkResponse.Data[0]}, nil } type Generator struct { - next func(int) Result + next func(int) (*Action, error) } -func (g *Generator) Next(iteration int) Result { +func (g *Generator) Next(iteration int) (*Action, error) { return g.next(iteration) } func NewGenerator(script string) (*Generator, error) { runtime := goja.New() + _, err := runtime.RunString(script) if err != nil { return nil, err } + runtime.SetFieldNameMapper(goja.TagFieldNameMapper("json", true)) + err = runtime.Set("uuid", uuid.NewString) if err != nil { return nil, err } - var next func(int) Result + var next func(int) map[string]any err = runtime.ExportTo(runtime.Get("next"), &next) if err != nil { panic(err) } return &Generator{ - next: next, + next: func(i int) (*Action, error) { + ret := next(i) + + var ( + action string + ik string + data map[string]any + ok bool + ) + rawAction := ret["action"] + if rawAction == nil { + return nil, errors.New("'action' must be set") + } + + action, ok = rawAction.(string) + if !ok { + return nil, errors.New("'action' must be a string") + } + + rawData := ret["data"] + if rawData == nil { + return nil, errors.New("'data' must be set") + } + data, ok = rawData.(map[string]any) + if !ok { + return nil, errors.New("'data' must be a map[string]any") + } + + dataAsJsonRawMessage, err := json.Marshal(data) + if err != nil { + return nil, err + } + + rawIK := ret["ik"] + if rawIK != nil { + ik, ok = rawIK.(string) + if !ok { + return nil, errors.New("'ik' must be a string") + } + } + + return &Action{ + BulkElement: v2.BulkElement{ + Action: action, + IdempotencyKey: ik, + Data: dataAsJsonRawMessage, + }, + }, nil + }, }, nil -} \ No newline at end of file +} diff --git a/pkg/generate/generator_test.go b/pkg/generate/generator_test.go new file mode 100644 index 000000000..8f99dc6ba --- /dev/null +++ b/pkg/generate/generator_test.go @@ -0,0 +1,109 @@ +//go:build it + +package generate + +import ( + "github.com/formancehq/go-libs/v2/bun/bunconnect" + "github.com/formancehq/go-libs/v2/logging" + "github.com/formancehq/go-libs/v2/testing/docker" + "github.com/formancehq/go-libs/v2/testing/platform/pgtesting" + "github.com/formancehq/ledger/pkg/client/models/operations" + . "github.com/formancehq/ledger/pkg/testserver" + "github.com/stretchr/testify/require" + "os" + "testing" +) + +func TestGenerator(t *testing.T) { + + dockerPool := docker.NewPool(t, logging.Testing()) + pgServer := pgtesting.CreatePostgresServer(t, dockerPool) + ctx := logging.TestingContext() + + testServer := New(t, Configuration{ + PostgresConfiguration: bunconnect.ConnectionOptions{ + DatabaseSourceName: pgServer.GetDSN(), + }, + Debug: os.Getenv("DEBUG") == "true", + }) + require.NoError(t, testServer.Start()) + t.Cleanup(func() { + require.NoError(t, testServer.Stop(ctx)) + }) + + _, err := testServer.Client().Ledger.V2.CreateLedger(ctx, operations.V2CreateLedgerRequest{ + Ledger: "default", + }) + require.NoError(t, err) + + generator, err := NewGenerator(script) + require.NoError(t, err) + + const ledgerName = "default" + + for i := 0; i < 4; i++ { + action, err := generator.Next(i) + require.NoError(t, err) + + _, err = action.Apply(ctx, testServer.Client().Ledger.V2, ledgerName) + require.NoError(t, err) + } + + txs, err := ListTransactions(ctx, testServer, operations.V2ListTransactionsRequest{ + Ledger: ledgerName, + }) + require.NoError(t, err) + require.Len(t, txs.Data, 2) + require.True(t, txs.Data[1].Reverted) + require.False(t, txs.Data[0].Reverted) + require.Equal(t, map[string]string{ + "foo": "bar", + }, txs.Data[1].Metadata) +} + +const script = ` +function next(iteration) { + switch (iteration % 4) { + case 0: + return { + action: 'CREATE_TRANSACTION', + data: { + plain: ` + "`" + ` +send [USD/2 100] ( + source = @world + destination = @bank +) +` + "`" + ` + } + } + case 1: + return { + action: 'ADD_METADATA', + data: { + targetID: 1, + targetType: 'TRANSACTION', + metadata: { + "foo": "bar", + "foo2": "bar2" + } + } + } + case 2: + return { + action: 'DELETE_METADATA', + data: { + targetID: 1, + targetType: 'TRANSACTION', + key: "foo2" + } + } + case 3: + return { + action: 'REVERT_TRANSACTION', + data: { + id: 1 + } + } + } +} +` diff --git a/test/performance/benchmark_test.go b/test/performance/benchmark_test.go index 3ac8b0f21..2182d827c 100644 --- a/test/performance/benchmark_test.go +++ b/test/performance/benchmark_test.go @@ -7,9 +7,6 @@ import ( "encoding/json" "fmt" . "github.com/formancehq/go-libs/v2/collectionutils" - ledgerclient "github.com/formancehq/ledger/pkg/client" - "github.com/formancehq/ledger/pkg/client/models/components" - "github.com/formancehq/ledger/pkg/client/models/operations" "github.com/formancehq/ledger/pkg/generate" "net/http" "sort" @@ -22,42 +19,41 @@ import ( "github.com/stretchr/testify/require" ) -type TransactionProvider interface { - Get(iteration int) (string, map[string]string) +type ActionProvider interface { + Get(iteration int) (*generate.Action, error) } -type TransactionProviderFn func(iteration int) (string, map[string]string) +type ActionProviderFn func(iteration int) (*generate.Action, error) -func (fn TransactionProviderFn) Get(iteration int) (string, map[string]string) { +func (fn ActionProviderFn) Get(iteration int) (*generate.Action, error) { return fn(iteration) } -type TransactionProviderFactory interface { - Create() (TransactionProvider, error) +type ActionProviderFactory interface { + Create() (ActionProvider, error) } -type TransactionProviderFactoryFn func() (TransactionProvider, error) +type ActionProviderFactoryFn func() (ActionProvider, error) -func (fn TransactionProviderFactoryFn) Create() (TransactionProvider, error) { +func (fn ActionProviderFactoryFn) Create() (ActionProvider, error) { return fn() } -func NewJSTransactionProviderFactory(script string) TransactionProviderFactoryFn { - return func() (TransactionProvider, error) { +func NewJSActionProviderFactory(script string) ActionProviderFactoryFn { + return func() (ActionProvider, error) { generator, err := generate.NewGenerator(script) if err != nil { return nil, err } - return TransactionProviderFn(func(iteration int) (string, map[string]string) { - ret := generator.Next(iteration) - return ret.Script, ret.Variables + return ActionProviderFn(func(iteration int) (*generate.Action, error) { + return generator.Next(iteration) }), nil } } type Benchmark struct { EnvFactory EnvFactory - Scenarios map[string]TransactionProviderFactory + Scenarios map[string]ActionProviderFactory reports map[string]map[string]*report b *testing.B @@ -98,17 +94,18 @@ func (benchmark *Benchmark) Run(ctx context.Context) map[string][]Result { b.RunParallel(func(pb *testing.PB) { - transactionProvider, err := benchmark.Scenarios[scenario].Create() + actionProvider, err := benchmark.Scenarios[scenario].Create() require.NoError(b, err) for pb.Next() { iteration := int(cpt.Add(1)) - script, vars := transactionProvider.Get(iteration) + action, err := actionProvider.Get(iteration) + require.NoError(b, err) now := time.Now() - _, err := benchmark.createTransaction(ctx, env.Client(), l, script, vars) + _, err = action.Apply(ctx, env.Client().Ledger.V2, l.Name) require.NoError(b, err) report.registerTransactionLatency(time.Since(now)) @@ -149,58 +146,7 @@ func (benchmark *Benchmark) Run(ctx context.Context) map[string][]Result { return results } -func (benchmark *Benchmark) createTransaction( - ctx context.Context, - client *ledgerclient.Formance, - l ledger.Ledger, - script string, - vars map[string]string, -) (*ledger.Transaction, error) { - response, err := client.Ledger.V2.CreateTransaction(ctx, operations.V2CreateTransactionRequest{ - Ledger: l.Name, - V2PostTransaction: components.V2PostTransaction{ - Script: &components.V2PostTransactionScript{ - Plain: script, - Vars: vars, - }, - }, - }) - if err != nil { - return nil, fmt.Errorf("creating transaction: %w", err) - } - - return &ledger.Transaction{ - TransactionData: ledger.TransactionData{ - Postings: Map(response.V2CreateTransactionResponse.Data.Postings, func(from components.V2Posting) ledger.Posting { - return ledger.Posting{ - Source: from.Source, - Destination: from.Destination, - Amount: from.Amount, - Asset: from.Asset, - } - }), - Metadata: response.V2CreateTransactionResponse.Data.Metadata, - Timestamp: time.Time{ - Time: response.V2CreateTransactionResponse.Data.Timestamp, - }, - Reference: func() string { - if response.V2CreateTransactionResponse.Data.Reference == nil { - return "" - } - return *response.V2CreateTransactionResponse.Data.Reference - }(), - }, - ID: int(response.V2CreateTransactionResponse.Data.ID.Int64()), - RevertedAt: func() *time.Time { - if response.V2CreateTransactionResponse.Data.RevertedAt == nil { - return nil - } - return &time.Time{Time: *response.V2CreateTransactionResponse.Data.RevertedAt} - }(), - }, nil -} - -func New(b *testing.B, envFactory EnvFactory, scenarios map[string]TransactionProviderFactory) *Benchmark { +func New(b *testing.B, envFactory EnvFactory, scenarios map[string]ActionProviderFactory) *Benchmark { return &Benchmark{ b: b, EnvFactory: envFactory, diff --git a/test/performance/example_scripts/example1.js b/test/performance/example_scripts/example1.js index 43e9e65b9..81e7c0997 100644 --- a/test/performance/example_scripts/example1.js +++ b/test/performance/example_scripts/example1.js @@ -1,4 +1,4 @@ -const script = `vars { +const plain = `vars { account $order account $seller } @@ -17,10 +17,13 @@ send [USD/2 99] ( function next(iteration) { return { - script, - variables: { - order: `orders:${uuid()}`, - seller: `sellers:${iteration % 5}` + action: 'CREATE_TRANSACTION', + data: { + plain, + vars: { + order: `orders:${uuid()}`, + seller: `sellers:${iteration % 5}` + } } } } diff --git a/test/performance/scripts/any_bounded_to_any.js b/test/performance/scripts/any_bounded_to_any.js index 755938560..b96b24b9e 100644 --- a/test/performance/scripts/any_bounded_to_any.js +++ b/test/performance/scripts/any_bounded_to_any.js @@ -1,16 +1,19 @@ function next() { return { - script: `vars { - account $source - account $destination - } - send [USD/2 100] ( - source = $source allowing overdraft up to [USD/2 100] - destination = $destination - )`, - variables: { - destination: "dst:" + uuid(), - source: "src:" + uuid() + action: 'CREATE_TRANSACTION', + data: { + plain: `vars { + account $source + account $destination + } + send [USD/2 100] ( + source = $source allowing overdraft up to [USD/2 100] + destination = $destination + )`, + vars: { + destination: "dst:" + uuid(), + source: "src:" + uuid() + } } } } \ No newline at end of file diff --git a/test/performance/scripts/any_unbounded_to_any.js b/test/performance/scripts/any_unbounded_to_any.js index 1c401e1cb..ffbc02224 100644 --- a/test/performance/scripts/any_unbounded_to_any.js +++ b/test/performance/scripts/any_unbounded_to_any.js @@ -1,16 +1,19 @@ function next() { return { - script: `vars { - account $source - account $destination - } - send [USD/2 100] ( - source = $source allowing unbounded overdraft - destination = $destination - )`, - variables: { - destination: "dst:" + uuid(), - source: "src:" + uuid() + action: 'CREATE_TRANSACTION', + data: { + plain: `vars { + account $source + account $destination + } + send [USD/2 100] ( + source = $source allowing unbounded overdraft + destination = $destination + )`, + vars: { + destination: "dst:" + uuid(), + source: "src:" + uuid() + } } } } \ No newline at end of file diff --git a/test/performance/scripts/world_to_any.js b/test/performance/scripts/world_to_any.js index 3f68f8d87..cf61ae531 100644 --- a/test/performance/scripts/world_to_any.js +++ b/test/performance/scripts/world_to_any.js @@ -1,14 +1,17 @@ function next() { return { - script: `vars { - account $destination - } - send [USD/2 100] ( - source = @world - destination = $destination - )`, - variables: { - destination: "dst:" + uuid() + action: 'CREATE_TRANSACTION', + data: { + plain: `vars { + account $destination + } + send [USD/2 100] ( + source = @world + destination = $destination + )`, + vars: { + destination: "dst:" + uuid() + } } } } diff --git a/test/performance/scripts/world_to_bank.js b/test/performance/scripts/world_to_bank.js index ee248e864..66338267d 100644 --- a/test/performance/scripts/world_to_bank.js +++ b/test/performance/scripts/world_to_bank.js @@ -1,9 +1,12 @@ function next() { return { - script: `send [USD/2 100] ( - source = @world - destination = @bank - )`, - variables: {} + action: 'CREATE_TRANSACTION', + data: { + plain: `send [USD/2 100] ( + source = @world + destination = @bank + )`, + vars: {} + } } } \ No newline at end of file diff --git a/test/performance/write_test.go b/test/performance/write_test.go index aa6b03913..a52c03621 100644 --- a/test/performance/write_test.go +++ b/test/performance/write_test.go @@ -36,7 +36,7 @@ var ( envFactory EnvFactory - scripts = map[string]TransactionProviderFactory{} + scripts = map[string]ActionProviderFactory{} ) func init() { @@ -104,13 +104,13 @@ func BenchmarkWrite(b *testing.B) { script, err := scriptsDir.ReadFile(filepath.Join("scripts", entry.Name())) require.NoError(b, err) - scripts[strings.TrimSuffix(entry.Name(), ".js")] = NewJSTransactionProviderFactory(string(script)) + scripts[strings.TrimSuffix(entry.Name(), ".js")] = NewJSActionProviderFactory(string(script)) } } else { file, err := os.ReadFile(scriptFlag) require.NoError(b, err, "reading file "+scriptFlag) - scripts["provided"] = NewJSTransactionProviderFactory(string(file)) + scripts["provided"] = NewJSActionProviderFactory(string(file)) } if envFactory == nil { diff --git a/tools/generator/cmd/root.go b/tools/generator/cmd/root.go index da07b4fbf..938896bda 100644 --- a/tools/generator/cmd/root.go +++ b/tools/generator/cmd/root.go @@ -29,7 +29,7 @@ var ( } parallelFlag = "parallel" ledgerFlag = "ledger" - untilTransactionIDFlag = "until-transaction-id" + untilLogIDFlag = "until-log-id" clientIDFlag = "client-id" clientSecretFlag = "client-secret" authUrlFlag = "auth-url" @@ -55,9 +55,9 @@ func run(cmd *cobra.Command, args []string) error { return fmt.Errorf("failed to get ledger: %w", err) } - untilTransactionID, err := cmd.Flags().GetInt64(untilTransactionIDFlag) + untilLogID, err := cmd.Flags().GetInt64(untilLogIDFlag) if err != nil { - return fmt.Errorf("failed to get untilTransactionID: %w", err) + return fmt.Errorf("failed to get untilLogID: %w", err) } insecureSkipVerify, err := cmd.Flags().GetBool(insecureSkipVerifyFlag) @@ -137,26 +137,19 @@ func run(cmd *cobra.Command, args []string) error { for { logging.FromContext(ctx).Infof("Run iteration %d/%d", vu, iteration) - next := generator.Next(vu) - tx, err := client.Ledger.V2.CreateTransaction( - ctx, - operations.V2CreateTransactionRequest{ - Ledger: ledger, - V2PostTransaction: components.V2PostTransaction{ - Script: &components.V2PostTransactionScript{ - Plain: next.Script, - Vars: next.Variables, - }, - }, - }, - ) + action, err := generator.Next(vu) + if err != nil { + return fmt.Errorf("iteration %d/%d failed: %w", vu, iteration, err) + } + + ret, err := action.Apply(ctx, client.Ledger.V2, ledger) if err != nil { if errors.Is(err, context.Canceled) { return nil } return fmt.Errorf("iteration %d/%d failed: %w", vu, iteration, err) } - if untilTransactionID != 0 && tx.V2CreateTransactionResponse.Data.ID.Int64() >= untilTransactionID { + if untilLogID != 0 && ret.GetLogID() >= untilLogID { return nil } iteration++ @@ -181,6 +174,6 @@ func init() { rootCmd.Flags().Bool(insecureSkipVerifyFlag, false, "Skip TLS verification") rootCmd.Flags().IntP(parallelFlag, "p", 1, "Number of parallel users") rootCmd.Flags().StringP(ledgerFlag, "l", "default", "Ledger to feed") - rootCmd.Flags().Int64P(untilTransactionIDFlag, "u", 0, "Stop after this transaction ID") + rootCmd.Flags().Int64P(untilLogIDFlag, "u", 0, "Stop after this transaction ID") rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") } diff --git a/tools/generator/examples/example1.js b/tools/generator/examples/example1.js index 2517a3c16..cefe6c0b5 100644 --- a/tools/generator/examples/example1.js +++ b/tools/generator/examples/example1.js @@ -1,4 +1,4 @@ -const script = `vars { +const plain = `vars { account $order account $seller } @@ -17,10 +17,13 @@ send [USD/2 99] ( function next(iteration) { return { - script, - variables: { - order: `orders:${uuid()}`, - seller: `sellers:${iteration % 5}` + action: 'CREATE_TRANSACTION', + data: { + plain, + vars: { + order: `orders:${uuid()}`, + seller: `sellers:${iteration % 5}` + } } } } \ No newline at end of file diff --git a/tools/generator/examples_test.go b/tools/generator/examples_test.go new file mode 100644 index 000000000..2dd7f1b3b --- /dev/null +++ b/tools/generator/examples_test.go @@ -0,0 +1,30 @@ +//go:build it + +package main_test + +import ( + "embed" + "github.com/formancehq/ledger/pkg/generate" + "github.com/stretchr/testify/require" + "path/filepath" + "testing" +) + +//go:embed examples +var examples embed.FS + +func TestGenerator(t *testing.T) { + dirEntries, err := examples.ReadDir("examples") + require.NoError(t, err) + + for _, entry := range dirEntries { + example, err := examples.ReadFile(filepath.Join("examples", entry.Name())) + require.NoError(t, err) + + generator, err := generate.NewGenerator(string(example)) + require.NoError(t, err) + + _, err = generator.Next(1) + require.NoError(t, err) + } +} diff --git a/tools/generator/go.mod b/tools/generator/go.mod index e9c1d89bc..0e08ee16d 100644 --- a/tools/generator/go.mod +++ b/tools/generator/go.mod @@ -6,44 +6,179 @@ toolchain go1.23.2 replace github.com/formancehq/ledger => ../.. +replace github.com/formancehq/ledger/pkg/client => ../../pkg/client + require ( github.com/formancehq/go-libs/v2 v2.0.1-0.20241107141636-5509ff77294e github.com/formancehq/ledger v0.0.0-00010101000000-000000000000 - github.com/formancehq/ledger/pkg/client v0.0.0-20241104151610-5314238836a3 + github.com/formancehq/ledger/pkg/client v0.0.0-00010101000000-000000000000 github.com/spf13/cobra v1.8.1 + github.com/stretchr/testify v1.9.0 golang.org/x/oauth2 v0.23.0 golang.org/x/sync v0.8.0 ) require ( + dario.cat/mergo v1.0.1 // indirect + filippo.io/edwards25519 v1.1.0 // indirect + github.com/IBM/sarama v1.43.3 // indirect github.com/ThreeDotsLabs/watermill v1.3.7 // indirect + github.com/ThreeDotsLabs/watermill-http/v2 v2.3.1 // indirect + github.com/ThreeDotsLabs/watermill-kafka/v3 v3.0.5 // indirect + github.com/ThreeDotsLabs/watermill-nats/v2 v2.1.1 // indirect + github.com/ajg/form v1.5.1 // indirect + github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-msk-iam-sasl-signer-go v1.0.0 // indirect + github.com/aws/aws-sdk-go-v2 v1.32.3 // indirect + github.com/aws/aws-sdk-go-v2/config v1.28.1 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.42 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.18 // indirect + github.com/aws/aws-sdk-go-v2/feature/rds/auth v1.4.22 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.22 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.22 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.3 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.24.3 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.3 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.32.3 // indirect + github.com/aws/smithy-go v1.22.0 // indirect + github.com/bahlo/generic-list-go v0.2.0 // indirect + github.com/bluele/gcache v0.0.2 // indirect + github.com/buger/jsonparser v1.1.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dlclark/regexp2 v1.11.4 // indirect + github.com/dnwe/otelsarama v0.0.0-20240308230250-9388d9d40bc0 // indirect github.com/dop251/goja v0.0.0-20241009100908-5f46f2705ca3 // indirect + github.com/eapache/go-resiliency v1.7.0 // indirect + github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect + github.com/eapache/queue v1.1.0 // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/ericlagergren/decimal v0.0.0-20240411145413-00de7ca16731 // indirect github.com/fatih/color v1.18.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/formancehq/numscript v0.0.9-0.20241009144012-1150c14a1417 // indirect + github.com/go-chi/chi v4.1.2+incompatible // indirect + github.com/go-chi/chi/v5 v5.1.0 // indirect + github.com/go-chi/cors v1.2.1 // indirect + github.com/go-chi/render v1.0.3 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect + github.com/go-sql-driver/mysql v1.8.1 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/pprof v0.0.0-20240910150728-a0b0bb1d4134 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/mux v1.8.1 // indirect + github.com/gorilla/schema v1.4.1 // indirect + github.com/gorilla/securecookie v1.1.2 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-retryablehttp v0.7.7 // indirect + github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/invopop/jsonschema v0.12.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect + github.com/jackc/pgx/v5 v5.7.1 // indirect + github.com/jackc/pgxlisten v0.0.0-20241005155529-9d952acd6a6c // indirect + github.com/jackc/puddle/v2 v2.2.2 // indirect + github.com/jcmturner/aescts/v2 v2.0.0 // indirect + github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect + github.com/jcmturner/gofork v1.7.6 // indirect + github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect + github.com/jcmturner/rpc/v2 v2.0.3 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/klauspost/compress v1.17.11 // indirect github.com/lithammer/shortuuid/v3 v3.0.7 // indirect + github.com/logrusorgru/aurora v2.0.3+incompatible // indirect + github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect + github.com/muhlemmer/gu v0.3.1 // indirect + github.com/muhlemmer/httpforwarded v0.1.0 // indirect + github.com/nats-io/nats.go v1.37.0 // indirect + github.com/nats-io/nkeys v0.4.7 // indirect + github.com/nats-io/nuid v1.0.1 // indirect github.com/oklog/ulid v1.3.1 // indirect + github.com/onsi/ginkgo/v2 v2.20.2 // indirect + github.com/onsi/gomega v1.34.2 // 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.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect + github.com/puzpuzpuz/xsync/v3 v3.4.0 // indirect + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/riandyrn/otelchi v0.10.1 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/shirou/gopsutil/v4 v4.24.9 // indirect + github.com/shomali11/util v0.0.0-20220717175126-f0771b70947f // indirect + github.com/shomali11/xsql v0.0.0-20190608141458-bf76292144df // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/tklauser/go-sysconf v0.3.14 // indirect + github.com/tklauser/numcpus v0.9.0 // indirect + github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect + github.com/uptrace/bun v1.2.5 // indirect + github.com/uptrace/bun/dialect/pgdialect v1.2.5 // indirect + github.com/uptrace/bun/extra/bunotel v1.2.5 // indirect github.com/uptrace/opentelemetry-go-extra/otellogrus v0.3.2 // indirect + github.com/uptrace/opentelemetry-go-extra/otelsql v0.3.2 // indirect github.com/uptrace/opentelemetry-go-extra/otelutil v0.3.2 // indirect + github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect + github.com/xdg-go/pbkdf2 v1.0.0 // indirect + github.com/xdg-go/scram v1.1.2 // indirect + github.com/xdg-go/stringprep v1.0.4 // indirect + github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect + github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect + github.com/xeipuuv/gojsonschema v1.2.0 // indirect + github.com/xo/dburl v0.23.2 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect + github.com/zitadel/oidc/v2 v2.12.2 // indirect + go.opentelemetry.io/contrib/instrumentation/host v0.56.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect + go.opentelemetry.io/contrib/instrumentation/runtime v0.56.0 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.31.0 // indirect go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.31.0 // indirect go.opentelemetry.io/otel/log v0.7.0 // indirect go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect go.opentelemetry.io/otel/trace v1.31.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect + go.uber.org/dig v1.18.0 // indirect + go.uber.org/fx v1.23.0 // indirect + go.uber.org/mock v0.5.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect + golang.org/x/crypto v0.28.0 // indirect + golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect + golang.org/x/net v0.30.0 // indirect golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.19.0 // indirect + golang.org/x/tools v0.26.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241021214115-324edc3d5d38 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38 // indirect + google.golang.org/grpc v1.67.1 // indirect + google.golang.org/protobuf v1.35.1 // indirect + gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/tools/generator/go.sum b/tools/generator/go.sum index c299c4c1e..6b801ebf8 100644 --- a/tools/generator/go.sum +++ b/tools/generator/go.sum @@ -1,9 +1,73 @@ +dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= +dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/IBM/sarama v1.43.3 h1:Yj6L2IaNvb2mRBop39N7mmJAHBVY3dTPncr3qGVkxPA= +github.com/IBM/sarama v1.43.3/go.mod h1:FVIRaLrhK3Cla/9FfRF5X9Zua2KpS3SYIXxhac1H+FQ= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/ThreeDotsLabs/watermill v1.3.7 h1:NV0PSTmuACVEOV4dMxRnmGXrmbz8U83LENOvpHekN7o= github.com/ThreeDotsLabs/watermill v1.3.7/go.mod h1:lBnrLbxOjeMRgcJbv+UiZr8Ylz8RkJ4m6i/VN/Nk+to= +github.com/ThreeDotsLabs/watermill-http/v2 v2.3.1 h1:M0iYM5HsGcoxtiQqprRlYZNZnGk3w5LsE9RbC2R8myQ= +github.com/ThreeDotsLabs/watermill-http/v2 v2.3.1/go.mod h1:RwGHEzGsEEXC/rQNLWQqR83+WPlABgOgnv2kTB56Y4Y= +github.com/ThreeDotsLabs/watermill-kafka/v3 v3.0.5 h1:ud+4txnRgtr3kZXfXZ5+C7kVQEvsLc5HSNUEa0g+X1Q= +github.com/ThreeDotsLabs/watermill-kafka/v3 v3.0.5/go.mod h1:t4o+4A6GB+XC8WL3DandhzPwd265zQuyWMQC/I+WIOU= +github.com/ThreeDotsLabs/watermill-nats/v2 v2.1.1 h1:afAkAFzeooBRQvxElR+6xoigXKCukcZXnE9ACxhwlPI= +github.com/ThreeDotsLabs/watermill-nats/v2 v2.1.1/go.mod h1:stjbT+s4u/s5ime5jdIyvPyjBGwGeJewIN7jxH8gp4k= +github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= +github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= +github.com/alitto/pond v1.9.2 h1:9Qb75z/scEZVCoSU+osVmQ0I0JOeLfdTDafrbcJ8CLs= +github.com/alitto/pond v1.9.2/go.mod h1:xQn3P/sHTYcU/1BR3i86IGIrilcrGC2LiS+E2+CJWsI= +github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 h1:yL7+Jz0jTC6yykIK/Wh74gnTJnrGr5AyrNMXuA0gves= +github.com/antlr/antlr4/runtime/Go/antlr v1.4.10/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aws/aws-msk-iam-sasl-signer-go v1.0.0 h1:UyjtGmO0Uwl/K+zpzPwLoXzMhcN9xmnR2nrqJoBrg3c= +github.com/aws/aws-msk-iam-sasl-signer-go v1.0.0/go.mod h1:TJAXuFs2HcMib3sN5L0gUC+Q01Qvy3DemvA55WuC+iA= +github.com/aws/aws-sdk-go-v2 v1.32.3 h1:T0dRlFBKcdaUPGNtkBSwHZxrtis8CQU17UpNBZYd0wk= +github.com/aws/aws-sdk-go-v2 v1.32.3/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo= +github.com/aws/aws-sdk-go-v2/config v1.28.1 h1:oxIvOUXy8x0U3fR//0eq+RdCKimWI900+SV+10xsCBw= +github.com/aws/aws-sdk-go-v2/config v1.28.1/go.mod h1:bRQcttQJiARbd5JZxw6wG0yIK3eLeSCPdg6uqmmlIiI= +github.com/aws/aws-sdk-go-v2/credentials v1.17.42 h1:sBP0RPjBU4neGpIYyx8mkU2QqLPl5u9cmdTWVzIpHkM= +github.com/aws/aws-sdk-go-v2/credentials v1.17.42/go.mod h1:FwZBfU530dJ26rv9saAbxa9Ej3eF/AK0OAY86k13n4M= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.18 h1:68jFVtt3NulEzojFesM/WVarlFpCaXLKaBxDpzkQ9OQ= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.18/go.mod h1:Fjnn5jQVIo6VyedMc0/EhPpfNlPl7dHV916O6B+49aE= +github.com/aws/aws-sdk-go-v2/feature/rds/auth v1.4.22 h1:n89ziXnsp3dyOlodim8OHv0edSu47H7i75UYxDz1YVQ= +github.com/aws/aws-sdk-go-v2/feature/rds/auth v1.4.22/go.mod h1:7uC80VxwPjAykLSIzkyTgZ+LjFDil+OVndzd8wGMOYY= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.22 h1:Jw50LwEkVjuVzE1NzkhNKkBf9cRN7MtE1F/b2cOKTUM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.22/go.mod h1:Y/SmAyPcOTmpeVaWSzSKiILfXTVJwrGmYZhcRbhWuEY= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.22 h1:981MHwBaRZM7+9QSR6XamDzF/o7ouUGxFzr+nVSIhrs= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.22/go.mod h1:1RA1+aBEfn+CAB/Mh0MB6LsdCYCnjZm7tKXtnk499ZQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 h1:TToQNkvGguu209puTojY/ozlqy2d/SFNcoLIqTFi42g= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0/go.mod h1:0jp+ltwkf+SwG2fm/PKo8t4y8pJSgOCO4D8Lz3k0aHQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.3 h1:qcxX0JYlgWH3hpPUnd6U0ikcl6LLA9sLkXE2w1fpMvY= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.3/go.mod h1:cLSNEmI45soc+Ef8K/L+8sEA3A3pYFEYf5B5UI+6bH4= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.3 h1:UTpsIf0loCIWEbrqdLb+0RxnTXfWh2vhw4nQmFi4nPc= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.3/go.mod h1:FZ9j3PFHHAR+w0BSEjK955w5YD2UwB/l/H0yAK3MJvI= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.3 h1:2YCmIXv3tmiItw0LlYf6v7gEHebLY45kBEnPezbUKyU= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.3/go.mod h1:u19stRyNPxGhj6dRm+Cdgu6N75qnbW7+QN0q0dsAk58= +github.com/aws/aws-sdk-go-v2/service/sts v1.32.3 h1:wVnQ6tigGsRqSWDEEyH6lSAJ9OyFUsSnbaUWChuSGzs= +github.com/aws/aws-sdk-go-v2/service/sts v1.32.3/go.mod h1:VZa9yTFyj4o10YGsmDO4gbQJUvvhY72fhumT8W4LqsE= +github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= +github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= +github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= +github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= +github.com/bluele/gcache v0.0.2 h1:WcbfdXICg7G/DGBh1PFfcirkWOQV+v077yF1pSy3DGw= +github.com/bluele/gcache v0.0.2/go.mod h1:m15KV+ECjptwSPxKhOhQoAFQVtUFjTVkc3H8o0t/fp0= +github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= +github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= 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/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8= +github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -11,38 +75,157 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dlclark/regexp2 v1.11.4 h1:rPYF9/LECdNymJufQKmri9gV604RvvABwgOA8un7yAo= github.com/dlclark/regexp2 v1.11.4/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dnwe/otelsarama v0.0.0-20240308230250-9388d9d40bc0 h1:R2zQhFwSCyyd7L43igYjDrH0wkC/i+QBPELuY0HOu84= +github.com/dnwe/otelsarama v0.0.0-20240308230250-9388d9d40bc0/go.mod h1:2MqLKYJfjs3UriXXF9Fd0Qmh/lhxi/6tHXkqtXxyIHc= +github.com/docker/cli v27.3.1+incompatible h1:qEGdFBF3Xu6SCvCYhc7CzaQTlBmqDuzxPDpigSyeKQQ= +github.com/docker/cli v27.3.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/docker v27.3.1+incompatible h1:KttF0XoteNTicmUtBO0L2tP+J7FGRFTjaEF4k6WdhfI= +github.com/docker/docker v27.3.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= +github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20241009100908-5f46f2705ca3 h1:MXsAuToxwsTn5BEEYm2DheqIiC4jWGmkEJ1uy+KFhvQ= github.com/dop251/goja v0.0.0-20241009100908-5f46f2705ca3/go.mod h1:MxLav0peU43GgvwVgNbLAj1s/bSGboKkhuULvq/7hx4= +github.com/eapache/go-resiliency v1.7.0 h1:n3NRTnBn5N0Cbi/IeOHuQn9s2UwVUH7Ga0ZWcP+9JTA= +github.com/eapache/go-resiliency v1.7.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= +github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= +github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= +github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/ericlagergren/decimal v0.0.0-20240411145413-00de7ca16731 h1:R/ZjJpjQKsZ6L/+Gf9WHbt31GG8NMVcpRqUE+1mMIyo= github.com/ericlagergren/decimal v0.0.0-20240411145413-00de7ca16731/go.mod h1:M9R1FoZ3y//hwwnJtO51ypFGwm8ZfpxPT/ZLtO1mcgQ= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= -github.com/formancehq/go-libs/v2 v2.0.1-0.20241107140023-218febd1c023 h1:JWRNtxQs0IsxTK5wdrvIc9wi4Kscm9TNBOn2wuW9szU= -github.com/formancehq/go-libs/v2 v2.0.1-0.20241107140023-218febd1c023/go.mod h1:DTqSp28pYPZa4O1WrOg3kobhgTHdk9geGtxnws9EViM= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/formancehq/go-libs/v2 v2.0.1-0.20241107141636-5509ff77294e h1:O7HXIkgcHTY81Ehoex+a2JpmKWP+Co6eYZdoHX0r96w= github.com/formancehq/go-libs/v2 v2.0.1-0.20241107141636-5509ff77294e/go.mod h1:DTqSp28pYPZa4O1WrOg3kobhgTHdk9geGtxnws9EViM= -github.com/formancehq/ledger/pkg/client v0.0.0-20241104151610-5314238836a3 h1:7Kyd9WIxBBRPk2DlBwhrPP5HM4l30y3zpk77Iss/jt0= -github.com/formancehq/ledger/pkg/client v0.0.0-20241104151610-5314238836a3/go.mod h1:BT02yUK6iBRyiodzWe7gyDtgKswtA/8tv824XqpuOcc= +github.com/formancehq/numscript v0.0.9-0.20241009144012-1150c14a1417 h1:LOd5hxnXDIBcehFrpW1OnXk+VSs0yJXeu1iAOO+Hji4= +github.com/formancehq/numscript v0.0.9-0.20241009144012-1150c14a1417/go.mod h1:btuSv05cYwi9BvLRxVs5zrunU+O1vTgigG1T6UsawcY= +github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/gkampitakis/ciinfo v0.3.0 h1:gWZlOC2+RYYttL0hBqcoQhM7h1qNkVqvRCV1fOvpAv8= +github.com/gkampitakis/ciinfo v0.3.0/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo= +github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZdC4M= +github.com/gkampitakis/go-diff v1.3.2/go.mod h1:LLgOrpqleQe26cte8s36HTWcTmMEur6OPYerdAAS9tk= +github.com/gkampitakis/go-snaps v0.5.4 h1:GX+dkKmVsRenz7SoTbdIEL4KQARZctkMiZ8ZKprRwT8= +github.com/gkampitakis/go-snaps v0.5.4/go.mod h1:ZABkO14uCuVxBHAXAfKG+bqNz+aa1bGPAg8jkI0Nk8Y= +github.com/go-chi/chi v4.1.2+incompatible h1:fGFk2Gmi/YKXk0OmGfBh0WgmN3XB8lVnEyNz34tQRec= +github.com/go-chi/chi v4.1.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= +github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw= +github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4= +github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58= +github.com/go-chi/render v1.0.3 h1:AsXqd2a1/INaIfUSKq3G5uA8weYx20FOsM7uSoCyyt4= +github.com/go-chi/render v1.0.3/go.mod h1:/gr3hVkmYR0YlEy3LxCuVRFzEu9Ruok+gFqbIofjao0= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/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-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +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-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 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/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20240910150728-a0b0bb1d4134 h1:c5FlPPgxOn7kJz3VoPLkQYQXGBS3EklQ4Zfi57uOuqQ= github.com/google/pprof v0.0.0-20240910150728-a0b0bb1d4134/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.2.0/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/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/gorilla/schema v1.4.1 h1:jUg5hUjCSDZpNGLuXQOgIWGdlgrIdYvgQ0wZtdK1M3E= +github.com/gorilla/schema v1.4.1/go.mod h1:Dg5SSm5PV60mhF2NFaTV1xuYYj8tV8NOPRo4FggUMnM= +github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= +github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA= +github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= +github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= +github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI= +github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.7.1 h1:x7SYsPBYDkHDksogeSmZZ5xzThcTgRz++I5E+ePFUcs= +github.com/jackc/pgx/v5 v5.7.1/go.mod h1:e7O26IywZZ+naJtWWos6i6fvWK+29etgITqrqHLfoZA= +github.com/jackc/pgxlisten v0.0.0-20241005155529-9d952acd6a6c h1:/u9tWJZ5d+RnlpVuvf352pGb+CzTrJP+r+ETy4JEHyo= +github.com/jackc/pgxlisten v0.0.0-20241005155529-9d952acd6a6c/go.mod h1:EqjCOzkITPCEI0My7BdE2xm3r0fZ7OZycVDP+ki1ASA= +github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= +github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= +github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= +github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= +github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= +github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= +github.com/jcmturner/gofork v1.7.6 h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVETg= +github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= +github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= +github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= +github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh687T8= +github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= +github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= +github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= +github.com/jeremija/gosubmit v0.2.7 h1:At0OhGCFGPXyjPYAsCchoBUhE099pcBXmsb4iZqROIc= +github.com/jeremija/gosubmit v0.2.7/go.mod h1:Ui+HS073lCFREXBbdfrJzMB57OI/bdxTiLtrDHHhFPI= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lithammer/shortuuid/v3 v3.0.7 h1:trX0KTHy4Pbwo/6ia8fscyHoGA+mf1jWbPJVuvyJQQ8= github.com/lithammer/shortuuid/v3 v3.0.7/go.mod h1:vMk8ke37EmiewwolSO1NLW8vP4ZaKlRuDIi8tWWmAts= +github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8= +github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 h1:7UMa6KCCMjZEMDtTVdcGu0B1GmmC7QJKiCCjyTAWQy0= +github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo= +github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -52,14 +235,70 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= 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/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= +github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/muhlemmer/gu v0.3.1 h1:7EAqmFrW7n3hETvuAdmFmn4hS8W+z3LgKtrnow+YzNM= +github.com/muhlemmer/gu v0.3.1/go.mod h1:YHtHR+gxM+bKEIIs7Hmi9sPT3ZDUvTN/i88wQpZkrdM= +github.com/muhlemmer/httpforwarded v0.1.0 h1:x4DLrzXdliq8mprgUMR0olDvHGkou5BJsK/vWUetyzY= +github.com/muhlemmer/httpforwarded v0.1.0/go.mod h1:yo9czKedo2pdZhoXe+yDkGVbU0TJ0q9oQ90BVoDEtw0= +github.com/nats-io/jwt/v2 v2.7.0 h1:J+ZnaaMGQi3xSB8iOhVM5ipiWCDrQvgEoitTwWFyOYw= +github.com/nats-io/jwt/v2 v2.7.0/go.mod h1:ZdWS1nZa6WMZfFwwgpEaqBV8EPGVgOTDHN/wTbz0Y5A= +github.com/nats-io/nats-server/v2 v2.10.21 h1:gfG6T06wBdI25XyY2IsauarOc2srWoFxxfsOKjrzoRA= +github.com/nats-io/nats-server/v2 v2.10.21/go.mod h1:I1YxSAEWbXCfy0bthwvNb5X43WwIWMz7gx5ZVPDr5Rc= +github.com/nats-io/nats.go v1.37.0 h1:07rauXbVnnJvv1gfIyghFEo6lUcYRY0WXc3x7x0vUxE= +github.com/nats-io/nats.go v1.37.0/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8= +github.com/nats-io/nkeys v0.4.7 h1:RwNJbbIdYCoClSDNY7QVKZlyb/wfT6ugvFCiKy6vDvI= +github.com/nats-io/nkeys v0.4.7/go.mod h1:kqXRgRDPlGy7nGaEDMuYzmiJCIAAWDK0IMBtDmGD0nc= +github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4= +github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag= +github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= +github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= +github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= +github.com/opencontainers/runc v1.1.14 h1:rgSuzbmgz5DUJjeSnw337TxDbRuqjs6iqQck/2weR6w= +github.com/opencontainers/runc v1.1.14/go.mod h1:E4C2z+7BxR7GHXp0hAY53mek+x49X1LjPNeMTfRGvOA= +github.com/ory/dockertest/v3 v3.11.0 h1:OiHcxKAvSDUwsEVh2BjxQQc/5EHz9n0va9awCtNGuyA= +github.com/ory/dockertest/v3 v3.11.0/go.mod h1:VIPxS1gwT9NpPOrfD3rACs8Y9Z7yhzO4SB194iUDnUI= +github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= +github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +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.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/puzpuzpuz/xsync/v3 v3.4.0 h1:DuVBAdXuGFHv8adVXjWWZ63pJq+NRXOWVXlKDBZ+mJ4= +github.com/puzpuzpuz/xsync/v3 v3.4.0/go.mod h1:VjzYrABPabuM4KyBh1Ftq6u8nhwY5tBPKP9jpmh0nnA= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/riandyrn/otelchi v0.10.1 h1:x86f8M0pGvjW3tJUxpva4cpdNtMydLPnarIXHssYUy4= +github.com/riandyrn/otelchi v0.10.1/go.mod h1:SWarhA5rdeiCNq+Ygc4p59ZGM5AtYCiyPU/3Q5rzT0M= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shirou/gopsutil/v4 v4.24.9 h1:KIV+/HaHD5ka5f570RZq+2SaeFsb/pq+fp2DGNWYoOI= +github.com/shirou/gopsutil/v4 v4.24.9/go.mod h1:3fkaHNeYsUFCGZ8+9vZVWtbyM1k2eRnlL+bWO8Bxa/Q= +github.com/shomali11/parallelizer v0.0.0-20220717173222-a6776fbf40a9/go.mod h1:QsLM53l8gzX0sQbOjVir85bzOUucuJEF8JgE39wD7w0= +github.com/shomali11/util v0.0.0-20180607005212-e0f70fd665ff/go.mod h1:WWE2GJM9B5UpdOiwH2val10w/pvJ2cUUQOOA/4LgOng= +github.com/shomali11/util v0.0.0-20220717175126-f0771b70947f h1:OM0LVaVycWC+/j5Qra7USyCg2sc+shg3KwygAA+pYvA= +github.com/shomali11/util v0.0.0-20220717175126-f0771b70947f/go.mod h1:9POpw/crb6YrseaYBOwraL0lAYy0aOW79eU3bvMxgbM= +github.com/shomali11/xsql v0.0.0-20190608141458-bf76292144df h1:SVCDTuzM3KEk8WBwSSw7RTPLw9ajzBaXDg39Bo6xIeU= +github.com/shomali11/xsql v0.0.0-20190608141458-bf76292144df/go.mod h1:K8jR5lDI2MGs9Ky+X2jIF4MwIslI0L8o8ijIlEq7/Vw= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= @@ -67,47 +306,193 @@ github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3k github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/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/testify v1.2.1/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.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +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/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U= +github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= +github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= +github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= +github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU= +github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY= +github.com/tklauser/numcpus v0.9.0 h1:lmyCHtANi8aRUgkckBgoDk1nHCux3n2cgkJLXdQGPDo= +github.com/tklauser/numcpus v0.9.0/go.mod h1:SN6Nq1O3VychhC1npsWostA+oW+VOQTxZrS604NSRyI= +github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= +github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= +github.com/uptrace/bun v1.2.5 h1:gSprL5xiBCp+tzcZHgENzJpXnmQwRM/A6s4HnBF85mc= +github.com/uptrace/bun v1.2.5/go.mod h1:vkQMS4NNs4VNZv92y53uBSHXRqYyJp4bGhMHgaNCQpY= +github.com/uptrace/bun/dialect/pgdialect v1.2.5 h1:dWLUxpjTdglzfBks2x+U2WIi+nRVjuh7Z3DLYVFswJk= +github.com/uptrace/bun/dialect/pgdialect v1.2.5/go.mod h1:stwnlE8/6x8cuQ2aXcZqwDK/d+6jxgO3iQewflJT6C4= +github.com/uptrace/bun/extra/bundebug v1.2.3 h1:2QBykz9/u4SkN9dnraImDcbrMk2fUhuq2gL6hkh9qSc= +github.com/uptrace/bun/extra/bundebug v1.2.3/go.mod h1:bihsYJxXxWZXwc1R3qALTHvp+npE0ElgaCvcjzyPPdw= +github.com/uptrace/bun/extra/bunotel v1.2.5 h1:kkuuTbrG9d5leYZuSBKhq2gtq346lIrxf98Mig2y128= +github.com/uptrace/bun/extra/bunotel v1.2.5/go.mod h1:rCHLszRZwppWE9cGDodO2FCI1qCrLwDjONp38KD3bA8= github.com/uptrace/opentelemetry-go-extra/otellogrus v0.3.2 h1:H8wwQwTe5sL6x30z71lUgNiwBdeCHQjrphCfLwqIHGo= github.com/uptrace/opentelemetry-go-extra/otellogrus v0.3.2/go.mod h1:/kR4beFhlz2g+V5ik8jW+3PMiMQAPt29y6K64NNY53c= +github.com/uptrace/opentelemetry-go-extra/otelsql v0.3.2 h1:ZjUj9BLYf9PEqBn8W/OapxhPjVRdC6CsXTdULHsyk5c= +github.com/uptrace/opentelemetry-go-extra/otelsql v0.3.2/go.mod h1:O8bHQfyinKwTXKkiKNGmLQS7vRsqRxIQTFZpYpHK3IQ= github.com/uptrace/opentelemetry-go-extra/otelutil v0.3.2 h1:3/aHKUq7qaFMWxyQV0W2ryNgg8x8rVeKVA20KJUkfS0= github.com/uptrace/opentelemetry-go-extra/otelutil v0.3.2/go.mod h1:Zit4b8AQXaXvA68+nzmbyDzqiyFRISyw1JiD5JqUBjw= +github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= +github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= +github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= +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/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xo/dburl v0.23.2 h1:Fl88cvayrgE56JA/sqhNMLljCW/b7RmG1mMkKMZUFgA= +github.com/xo/dburl v0.23.2/go.mod h1:uazlaAQxj4gkshhfuuYyvwCBouOmNnG2aDxTCFZpmL4= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/zitadel/oidc/v2 v2.12.2 h1:3kpckg4rurgw7w7aLJrq7yvRxb2pkNOtD08RH42vPEs= +github.com/zitadel/oidc/v2 v2.12.2/go.mod h1:vhP26g1g4YVntcTi0amMYW3tJuid70nxqxf+kb6XKgg= +go.opentelemetry.io/contrib/instrumentation/host v0.56.0 h1:bLJ0U2SVly7aCVAv4pSJ62I0yy3GHPMbK+74AXSwC40= +go.opentelemetry.io/contrib/instrumentation/host v0.56.0/go.mod h1:7XvO8DvjdcoYDOQs/1n3AuadI/30eE2R+H/pQQuZVN0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 h1:UP6IpuHFkUgOQL9FFQFrZ+5LiwhhYRbi7VZSIx6Nj5s= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0/go.mod h1:qxuZLtbq5QDtdeSHsS7bcf6EH6uO6jUAgk764zd3rhM= +go.opentelemetry.io/contrib/instrumentation/runtime v0.56.0 h1:s7wHG+t8bEoH7ibWk1nk682h7EoWLJ5/8j+TSO3bX/o= +go.opentelemetry.io/contrib/instrumentation/runtime v0.56.0/go.mod h1:Q8Hsv3d9DwryfIl+ebj4mY81IYVRSPy4QfxroVZwqLo= +go.opentelemetry.io/contrib/propagators/b3 v1.31.0 h1:PQPXYscmwbCp76QDvO4hMngF2j8Bx/OTV86laEl8uqo= +go.opentelemetry.io/contrib/propagators/b3 v1.31.0/go.mod h1:jbqfV8wDdqSDrAYxVpXQnpM0XFMq2FtDesblJ7blOwQ= go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0 h1:FZ6ei8GFW7kyPYdxJaV2rgI6M+4tvZzhYsQ2wgyVC08= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0/go.mod h1:MdEu/mC6j3D+tTEfvI15b5Ci2Fn7NneJ71YMoiS3tpI= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0 h1:ZsXq73BERAiNuuFXYqP4MR5hBrjXfMGSO+Cx7qoOZiM= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0/go.mod h1:hg1zaDMpyZJuUzjFxFsRYBoccE86tM9Uf4IqNMUxvrY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 h1:K0XaT3DwHAcV4nKLzcQvwAgSyisUghWoY20I7huthMk= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0/go.mod h1:B5Ki776z/MBnVha1Nzwp5arlzBbE3+1jk+pGmaP5HME= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0 h1:FFeLy03iVTXP6ffeN2iXrxfGsZGCjVx0/4KlizjyBwU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0/go.mod h1:TMu73/k1CP8nBUpDLc71Wj/Kf7ZS9FK5b53VapRsP9o= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0 h1:lUsI2TYsQw2r1IASwoROaCnjdj2cvC2+Jbxvk6nHnWU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0/go.mod h1:2HpZxxQurfGxJlJDblybejHB6RX6pmExPNe517hREw4= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0 h1:HZgBIps9wH0RDrwjrmNa3DVbNRW60HEhdzqZFyAp3fI= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0/go.mod h1:RDRhvt6TDG0eIXmonAx5bd9IcwpqCkziwkOClzWKwAQ= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.31.0 h1:UGZ1QwZWY67Z6BmckTU+9Rxn04m2bD3gD6Mk0OIOCPk= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.31.0/go.mod h1:fcwWuDuaObkkChiDlhEpSq9+X1C0omv+s5mBtToAQ64= go.opentelemetry.io/otel/log v0.7.0 h1:d1abJc0b1QQZADKvfe9JqqrfmPYQCz2tUSO+0XZmuV4= go.opentelemetry.io/otel/log v0.7.0/go.mod h1:2jf2z7uVfnzDNknKTO9G+ahcOAyWcp1fJmk/wJjULRo= go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= +go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw= +go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= +go.uber.org/fx v1.23.0 h1:lIr/gYWQGfTwGcSXWXu4vP5Ws6iqnNEIY+F/aFzCKTg= +go.uber.org/fx v1.23.0/go.mod h1:o/D9n+2mLP6v1EG+qsdT1O8wKopYAsqZasju97SDFCU= 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.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= +go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY= +golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +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.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/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.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/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.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= golang.org/x/sys v0.26.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/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.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.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-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/api v0.0.0-20241021214115-324edc3d5d38 h1:2oV8dfuIkM1Ti7DwXc0BJfnwr9csz4TDXI9EmiI+Rbw= +google.golang.org/genproto/googleapis/api v0.0.0-20241021214115-324edc3d5d38/go.mod h1:vuAjtvlwkDKF6L1GQ0SokiRLCGFfeBUXWr/aFFkHACc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38 h1:zciRKQ4kBpFgpfC5QQCVtnnNAcLIqweL7plyZRQHVpI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/go-jose/go-jose.v2 v2.6.3 h1:nt80fvSDlhKWQgSWyHyy5CfmlQr+asih51R8PTWNKKs= +gopkg.in/go-jose/go-jose.v2 v2.6.3/go.mod h1:zzZDPkNNw/c9IE7Z9jr11mBZQhKQTMzoEEIoEdZlFBI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=