MCPcopy Create free account

hub / github.com/devaccuracy/ledgerforge / functions

Functions1,908 in github.com/devaccuracy/ledgerforge

↓ 2 callersMethodGetReconciliation
Records a new reconciliation
database/repository.go:154
↓ 2 callersMethodGetReconciliation
GetReconciliation fetches a reconciliation record from the database based on its ID. Parameters: - ctx: Context for managing request and tracing. - id
database/reconciliation.go:65
↓ 2 callersMethodGetSourceDestination
GetSourceDestination retrieves balances for both the source and destination by their IDs. It queries the database using a stored procedure `ledgerforg
database/balance.go:767
↓ 2 callersMethodGetTransaction
GetTransaction retrieves a transaction by its ID from the database. It logs the transaction retrieval using OpenTelemetry tracing. Parameters: - ctx:
database/transaction.go:383
↓ 2 callersMethodGetTransactionByRef
GetTransactionByRef retrieves a transaction by its reference from the datasource. It starts a tracing span, fetches the transaction by reference, and
transaction.go:2212
↓ 2 callersMethodGetTransactionFromQueue
GetTransactionFromQueue retrieves a transaction from the queue by its ID. Parameters: - transactionID string: The ID of the transaction to retrieve.
queue.go:275
↓ 2 callersMethodGetTransactionsByCriteria
GetTransactionsByCriteria retrieves transactions based on specified criteria (amount range, currency, date range). It supports pagination via limit an
database/transaction.go:1544
↓ 2 callersMethodGetTransactionsPaginated
GetTransactionsPaginated retrieves a batch of transactions from the database with pagination support and caches the result. If the data is found in ca
database/transaction.go:796
↓ 2 callersMethodGroupTransactions
GroupTransactions retrieves and groups transactions from the database based on a specified column (groupCriteria). It supports pagination and caches t
database/transaction.go:905
↓ 2 callersFunctionHasPermission
HasPermission checks if a set of scopes has permission for a given resource and HTTP method
api/middleware/scope.go:77
↓ 2 callersMethodHasRecentContention
(ctx context.Context, pairKey string)
internal/hotpairs/hotpairs.go:136
↓ 2 callersFunctionInitConfig
(configFile string)
config/config.go:252
↓ 2 callersMethodListAPIKeys
ListAPIKeys retrieves all API keys for a specific owner Parameters: - ctx: The context for the operation - ownerID: ID of the key owner Returns: - [
apikey.go:35
↓ 2 callersMethodListAPIKeys
Revokes an API key
database/repository.go:177
↓ 2 callersMethodListHooks
(ctx context.Context, hookType HookType)
internal/hooks/types.go:70
↓ 2 callersMethodListHooks
ListHooks retrieves all hooks of a specific type or all hooks if type is empty. If hookType is provided, it fetches hooks from that specific set. If h
internal/hooks/manager.go:219
↓ 2 callersFunctionMetricsHandler
MetricsHandler returns the Prometheus HTTP handler for serving the /metrics endpoint. Returns nil if SetupOTelSDK has not been called or metrics are n
internal/traces/otel.go:49
↓ 2 callersFunctionNewAPI
NewAPI creates a new Api instance with the provided LedgerForge service and sets up the router. Parameters: - b: The LedgerForge service used to inte
api/api.go:153
↓ 2 callersFunctionNewAPIKey
NewAPIKey creates a new API key instance
model/api_key.go:32
↓ 2 callersFunctionNewAuthMiddleware
NewAuthMiddleware creates a new instance of AuthMiddleware. Parameters: - ledgerforge: The LedgerForge service used to validate API keys. Returns: -
api/middleware/auth.go:65
↓ 2 callersFunctionNewCacheWithClient
NewCacheWithClient creates a new RedisCache using an existing Redis client. No error is returned because no I/O occurs — the client is already validat
internal/cache/cache.go:83
↓ 2 callersFunctionNewRedisClient
NewRedisClient creates a new Redis client connection based on the provided list of addresses. It automatically detects if the connection is for a sing
internal/redis-db/redisdb.go:115
↓ 2 callersFunctionNewReindexService
NewReindexService creates a new ReindexService instance.
internal/search/reindex.go:55
↓ 2 callersFunctionParseScope
ParseScope parses a scope string into resource and action
api/middleware/scope.go:68
↓ 2 callersMethodPrepareLineageOutbox
PrepareLineageOutbox creates a LineageOutbox entry for atomic insertion with the transaction. This ensures lineage processing intent is captured in th
lineage.go:1387
↓ 2 callersFunctionRecordContention
(ctx context.Context, manager *Manager, source, destination, currency string, err error)
internal/hotpairs/router.go:137
↓ 2 callersMethodRecordExternalTransaction
RecordExternalTransaction inserts a new external transaction into the database. It associates the transaction with an upload ID and records its detail
database/reconciliation.go:349
↓ 2 callersMethodRecordMatch
RecordMatch inserts a single match into the database. It is used to record the match between external and internal transactions during reconciliation.
database/reconciliation.go:279
↓ 2 callersMethodRecordMatches
RecordMatches batches the saving of match records associated with a specific reconciliation ID. It uses a database transaction to ensure atomicity and
database/reconciliation.go:180
↓ 2 callersMethodRecordMatchingRule
RecordMatchingRule saves a new matching rule to the database. Parameters: - ctx: Context for managing the request and tracing. - rule: A pointer to th
database/reconciliation.go:414
↓ 2 callersMethodRecordReconciliation
(ctx context.Context, rec *model.Reconciliation)
database/repository.go:153
↓ 2 callersMethodRecordReconciliation
RecordReconciliation saves a reconciliation record to the database. Parameters: - ctx: Context for managing request and tracing. - rec: The reconcilia
database/reconciliation.go:40
↓ 2 callersMethodRecordTransaction
RecordTransaction records a new transaction in the database. It logs the transaction details using OpenTelemetry tracing. Parameters: - ctx: Context f
database/transaction.go:49
↓ 2 callersMethodRecordTransactionsWithBalanceSetAndOutboxes
RecordTransactionsWithBalanceSetAndOutboxes atomically records multiple transactions, updates all changed balances, and inserts any lineage outbox ent
database/transaction.go:333
↓ 2 callersMethodRecordUnmatched
RecordUnmatched batches the saving of unmatched external transactions related to a specific reconciliation. It uses a database transaction to ensure a
database/reconciliation.go:217
↓ 2 callersMethodRefundWorker
RefundWorker processes refund transactions from the jobs channel and sends the results to the results channel. It starts a tracing span, processes eac
transaction.go:736
↓ 2 callersFunctionResolveOperator
(s string)
internal/filter/operators.go:5
↓ 2 callersMethodRevokeAPIKey
RevokeAPIKey revokes an API key if it belongs to the specified owner Parameters: - ctx: The context for the operation - id: ID of the API key to revo
apikey.go:48
↓ 2 callersMethodRollbackInflightCredit
RollbackInflightCredit rolls back (decreases) the inflight credit balance by the specified amount.
model/model.go:214
↓ 2 callersMethodRollbackInflightDebit
RollbackInflightDebit rolls back (decreases) the inflight debit balance by the specified amount.
model/model.go:223
↓ 2 callersMethodRouter
Router sets up the routes for the API and returns the router instance. Responses: - 200 OK: When the router is successfully set up.
api/api.go:42
↓ 2 callersMethodSaveReconciliationProgress
SaveReconciliationProgress saves the progress of a reconciliation process to the database. If a record with the given reconciliation ID already exists
database/reconciliation.go:677
↓ 2 callersMethodSetPrimary
SetPrimary sets the primary item to be indexed after all dependencies.
internal/search/search.go:137
↓ 2 callersMethodSplitTransactionPrecise
Function to integrate the new CalculateDistributionsPrecise into SplitTransaction
model/transaction.go:409
↓ 2 callersMethodStartCoolingDown
(ctx context.Context, pairKey string)
internal/hotpairs/hotpairs.go:156
↓ 2 callersMethodStartReindex
StartReindex performs a complete reindex of all data. It drops all collections, recreates them, and indexes data in order: ledgers -> identities -> ba
internal/search/reindex.go:93
↓ 2 callersFunctionStartTestAsynqWorker
StartTestAsynqWorker sets up and starts an Asynq server for testing purposes. It takes the testing object, configuration, LedgerForge instance, and th
api/transaction_api_test.go:102
↓ 2 callersMethodStop
Stop shuts down the background recovery loop and waits for the worker goroutine to exit.
queue_recovery.go:81
↓ 2 callersMethodTakeBalanceSnapshots
Retrieves balances between source and destination
database/repository.go:104
↓ 2 callersMethodTakeBalanceSnapshots
TakeBalanceSnapshots creates daily snapshots of balances in batches. It uses the PostgreSQL function to process balances in chunks to avoid memory iss
database/balance.go:1396
↓ 2 callersMethodToAccount
()
api/model/model.go:230
↓ 2 callersMethodToBalance
()
api/model/model.go:213
↓ 2 callersMethodToBalanceMonitor
()
api/model/model.go:221
↓ 2 callersMethodToLedger
()
api/model/model.go:209
↓ 2 callersMethodTransactionExistsByRef
Retrieves a transaction by reference
database/repository.go:52
↓ 2 callersMethodTransactionExistsByRef
TransactionExistsByRef checks if a transaction with a given reference exists in the database. It uses OpenTelemetry to trace the operation and returns
database/transaction.go:479
↓ 2 callersMethodTryRecordQueuedTransactionBatchForHotLane
(ctx context.Context, transaction *model.Transaction)
transaction.go:859
↓ 2 callersMethodUpdateAccount
UpdateAccount updates a specific account in the database. It updates the account's name, number, bank name, and metadata based on the account ID. Para
database/account.go:333
↓ 2 callersMethodUpdateBalanceIdentity
Retrieves a balance at a specific time
database/repository.go:106
↓ 2 callersMethodUpdateIdentity
UpdateIdentity updates an existing identity in the database. Parameters: - identity *model.Identity: A pointer to the Identity model to be updated.
identity.go:128
↓ 2 callersMethodUpdateIdentity
Retrieves identities with pagination (legacy)
database/repository.go:143
↓ 2 callersMethodUpdateLastUsed
UpdateLastUsed updates the last used timestamp of an API key Parameters: - ctx: The context for the operation - id: ID of the API key to update Retu
apikey.go:73
↓ 2 callersMethodUpdateLastUsed
Lists all API keys for a specific owner
database/repository.go:178
↓ 2 callersMethodUpdateLastUsed
UpdateLastUsed updates the last_used_at timestamp for an API key to the current time. This function is typically called during authentication to track
database/api_key.go:272
↓ 2 callersMethodUpdateLedger
UpdateLedger updates an existing ledger's name. It calls postLedgerActions after a successful update to handle indexing and webhooks. Parameters: - i
ledger.go:135
↓ 2 callersMethodUpdateLedger
Retrieves a ledger by ID
database/repository.go:86
↓ 2 callersMethodUpdateMatchingRule
Retrieves a matching rule by ID
database/repository.go:164
↓ 2 callersMethodUpdateMatchingRule
UpdateMatchingRule updates a specific matching rule in the database. Parameters: - ctx: Context for managing the request and tracing. - rule: The matc
database/reconciliation.go:495
↓ 2 callersMethodUpdateMonitor
Retrieves monitors for a specific balance
database/repository.go:133
↓ 2 callersMethodUpdateMonitor
UpdateMonitor updates an existing balance monitor in the database. It updates fields such as `balance_id`, `field`, `operator`, `value`, `description`
database/balance.go:1323
↓ 2 callersMethodUpdateTransactionStatus
UpdateTransactionStatus updates the status of a transaction by its ID in the datasource. It starts a tracing span, updates the transaction status, and
transaction.go:2237
↓ 2 callersMethodUpsertLineageMapping
(ctx context.Context, mapping model.LineageMapping)
database/repository.go:183
↓ 2 callersMethodValidateCreateAccount
()
api/model/model.go:189
↓ 2 callersMethodValidateCreateBalance
()
api/model/model.go:85
↓ 2 callersMethodValidateCreateBalanceMonitor
()
api/model/model.go:99
↓ 2 callersMethodValidateCreateLedger
()
api/model/model.go:65
↓ 2 callersMethodValidateMonitorCondition
()
api/model/model.go:115
↓ 2 callersMethodValidateUpdateLedger
()
api/model/model.go:71
↓ 2 callersMethodVoidWorker
VoidWorker processes void transactions from the jobs channel and sends the results to the results channel. It starts a tracing span, processes each tr
inflight_transaction.go:127
↓ 2 callersMethodWaitLock
WaitLock tries to acquire all locks within a specified waiting period. It will attempt to acquire locks with exponential backoff if any lock is held.
internal/lock/lock.go:240
↓ 2 callersMethodacquireLineageLocks
acquireLineageLocks acquires distributed locks for multiple shadow balances using MultiLocker. MultiLocker handles sorting (prevents deadlock) and ded
lineage.go:506
↓ 2 callersMethodaddCredit
addCredit adds the specified amount to the credit balances (either inflight or regular). inflight indicates whether the credit is inflight or not.
model/model.go:96
↓ 2 callersMethodaddDebit
addDebit adds the specified amount to the debit balances (either inflight or regular). inflight indicates whether the debit is inflight or not.
model/model.go:108
↓ 2 callersFunctionapplyPrecisionLogic
applyPrecisionLogic contains the core logic for converting amounts based on precision. It assumes transaction.Precision has been set appropriately bef
model/model.go:244
↓ 2 callersFunctionboolCount
(ok bool)
tests/loadtest/tools/queue_benchmark.go:651
↓ 2 callersFunctionboolInt
(ok bool)
tests/loadtest/tools/queue_benchmark.go:658
↓ 2 callersFunctionbucketedName
(base, buckets)
tests/loadtest/script.js:213
↓ 2 callersMethodbuildGroupMap
buildGroupMap creates a map for tracking unprocessed transaction groups. Parameters: - groupedTxns: The grouped transactions. Returns: - map[string]bo
reconciliation.go:931
↓ 2 callersMethodbuildTransactionExecutionWork
buildTransactionExecutionWork converts an in-memory-applied transaction into the shared persistence and post-commit work shape used by both single and
transaction.go:1259
↓ 2 callersMethodcalculateRemainingAmount
calculateRemainingAmount calculates the remaining amount for an inflight transaction by subtracting the committed amount from the precise amount. It s
inflight_transaction.go:539
↓ 2 callersFunctioncategorizeRejectionReason
categorizeRejectionReason maps a free-text rejection reason to a bounded set of metric labels to keep Prometheus cardinality under control.
transaction.go:1731
↓ 2 callersFunctioncollectIntSeries
(samples []snapshot, pick func(snapshot) int)
tests/loadtest/tools/queue_benchmark.go:554
↓ 2 callersMethodcommitShadowTransactions
commitShadowTransactions commits all inflight shadow transactions for a parent transaction. It attempts to commit all shadows and returns an error if
lineage.go:1227
↓ 2 callersFunctionconvertPreciseToDecimal
convertPreciseToDecimal converts the precise integer amount to a decimal value by dividing by precision, storing the exact string representation
model/model.go:347
↓ 2 callersFunctioncounterRate
(count int, durationMs float64)
tests/loadtest/tools/queue_benchmark.go:637
↓ 2 callersFunctiondestinationOrDestinationsValidation
(t *RecordTransaction)
api/model/model.go:56
↓ 2 callersFunctiondiscover_runs
(root: Path)
tests/loadtest/tools/dashboard_parser.py:17
↓ 2 callersFunctionenqueueTransactions
enqueueTransactions enqueues the original transaction or its split transactions into the provided queue. It starts by determining which transactions t
transaction.go:2098
↓ 2 callersMethodexecuteHook
executeHook performs the actual HTTP request for the webhook. It handles marshalling the payload, creating the request, and processing the response. R
internal/hooks/client.go:52
↓ 2 callersMethodexecuteTransactionPlan
executeTransactionPlan runs the selected internal execution mode and fails open from queued batching back to the single-transaction path when batching
transaction.go:674
← previousnext →401–500 of 1,908, ranked by callers