Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/devaccuracy/ledgerforge
/ functions
Functions
1,908 in github.com/devaccuracy/ledgerforge
⨍
Functions
1,908
◇
Types & classes
159
↓ 2 callers
Method
GetReconciliation
Records a new reconciliation
database/repository.go:154
↓ 2 callers
Method
GetReconciliation
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 callers
Method
GetSourceDestination
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 callers
Method
GetTransaction
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 callers
Method
GetTransactionByRef
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 callers
Method
GetTransactionFromQueue
GetTransactionFromQueue retrieves a transaction from the queue by its ID. Parameters: - transactionID string: The ID of the transaction to retrieve.
queue.go:275
↓ 2 callers
Method
GetTransactionsByCriteria
GetTransactionsByCriteria retrieves transactions based on specified criteria (amount range, currency, date range). It supports pagination via limit an
database/transaction.go:1544
↓ 2 callers
Method
GetTransactionsPaginated
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 callers
Method
GroupTransactions
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 callers
Function
HasPermission
HasPermission checks if a set of scopes has permission for a given resource and HTTP method
api/middleware/scope.go:77
↓ 2 callers
Method
HasRecentContention
(ctx context.Context, pairKey string)
internal/hotpairs/hotpairs.go:136
↓ 2 callers
Function
InitConfig
(configFile string)
config/config.go:252
↓ 2 callers
Method
ListAPIKeys
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 callers
Method
ListAPIKeys
Revokes an API key
database/repository.go:177
↓ 2 callers
Method
ListHooks
(ctx context.Context, hookType HookType)
internal/hooks/types.go:70
↓ 2 callers
Method
ListHooks
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 callers
Function
MetricsHandler
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 callers
Function
NewAPI
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 callers
Function
NewAPIKey
NewAPIKey creates a new API key instance
model/api_key.go:32
↓ 2 callers
Function
NewAuthMiddleware
NewAuthMiddleware creates a new instance of AuthMiddleware. Parameters: - ledgerforge: The LedgerForge service used to validate API keys. Returns: -
api/middleware/auth.go:65
↓ 2 callers
Function
NewCacheWithClient
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 callers
Function
NewRedisClient
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 callers
Function
NewReindexService
NewReindexService creates a new ReindexService instance.
internal/search/reindex.go:55
↓ 2 callers
Function
ParseScope
ParseScope parses a scope string into resource and action
api/middleware/scope.go:68
↓ 2 callers
Method
PrepareLineageOutbox
PrepareLineageOutbox creates a LineageOutbox entry for atomic insertion with the transaction. This ensures lineage processing intent is captured in th
lineage.go:1387
↓ 2 callers
Function
RecordContention
(ctx context.Context, manager *Manager, source, destination, currency string, err error)
internal/hotpairs/router.go:137
↓ 2 callers
Method
RecordExternalTransaction
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 callers
Method
RecordMatch
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 callers
Method
RecordMatches
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 callers
Method
RecordMatchingRule
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 callers
Method
RecordReconciliation
(ctx context.Context, rec *model.Reconciliation)
database/repository.go:153
↓ 2 callers
Method
RecordReconciliation
RecordReconciliation saves a reconciliation record to the database. Parameters: - ctx: Context for managing request and tracing. - rec: The reconcilia
database/reconciliation.go:40
↓ 2 callers
Method
RecordTransaction
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 callers
Method
RecordTransactionsWithBalanceSetAndOutboxes
RecordTransactionsWithBalanceSetAndOutboxes atomically records multiple transactions, updates all changed balances, and inserts any lineage outbox ent
database/transaction.go:333
↓ 2 callers
Method
RecordUnmatched
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 callers
Method
RefundWorker
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 callers
Function
ResolveOperator
(s string)
internal/filter/operators.go:5
↓ 2 callers
Method
RevokeAPIKey
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 callers
Method
RollbackInflightCredit
RollbackInflightCredit rolls back (decreases) the inflight credit balance by the specified amount.
model/model.go:214
↓ 2 callers
Method
RollbackInflightDebit
RollbackInflightDebit rolls back (decreases) the inflight debit balance by the specified amount.
model/model.go:223
↓ 2 callers
Method
Router
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 callers
Method
SaveReconciliationProgress
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 callers
Method
SetPrimary
SetPrimary sets the primary item to be indexed after all dependencies.
internal/search/search.go:137
↓ 2 callers
Method
SplitTransactionPrecise
Function to integrate the new CalculateDistributionsPrecise into SplitTransaction
model/transaction.go:409
↓ 2 callers
Method
StartCoolingDown
(ctx context.Context, pairKey string)
internal/hotpairs/hotpairs.go:156
↓ 2 callers
Method
StartReindex
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 callers
Function
StartTestAsynqWorker
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 callers
Method
Stop
Stop shuts down the background recovery loop and waits for the worker goroutine to exit.
queue_recovery.go:81
↓ 2 callers
Method
TakeBalanceSnapshots
Retrieves balances between source and destination
database/repository.go:104
↓ 2 callers
Method
TakeBalanceSnapshots
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 callers
Method
ToAccount
()
api/model/model.go:230
↓ 2 callers
Method
ToBalance
()
api/model/model.go:213
↓ 2 callers
Method
ToBalanceMonitor
()
api/model/model.go:221
↓ 2 callers
Method
ToLedger
()
api/model/model.go:209
↓ 2 callers
Method
TransactionExistsByRef
Retrieves a transaction by reference
database/repository.go:52
↓ 2 callers
Method
TransactionExistsByRef
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 callers
Method
TryRecordQueuedTransactionBatchForHotLane
(ctx context.Context, transaction *model.Transaction)
transaction.go:859
↓ 2 callers
Method
UpdateAccount
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 callers
Method
UpdateBalanceIdentity
Retrieves a balance at a specific time
database/repository.go:106
↓ 2 callers
Method
UpdateIdentity
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 callers
Method
UpdateIdentity
Retrieves identities with pagination (legacy)
database/repository.go:143
↓ 2 callers
Method
UpdateLastUsed
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 callers
Method
UpdateLastUsed
Lists all API keys for a specific owner
database/repository.go:178
↓ 2 callers
Method
UpdateLastUsed
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 callers
Method
UpdateLedger
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 callers
Method
UpdateLedger
Retrieves a ledger by ID
database/repository.go:86
↓ 2 callers
Method
UpdateMatchingRule
Retrieves a matching rule by ID
database/repository.go:164
↓ 2 callers
Method
UpdateMatchingRule
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 callers
Method
UpdateMonitor
Retrieves monitors for a specific balance
database/repository.go:133
↓ 2 callers
Method
UpdateMonitor
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 callers
Method
UpdateTransactionStatus
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 callers
Method
UpsertLineageMapping
(ctx context.Context, mapping model.LineageMapping)
database/repository.go:183
↓ 2 callers
Method
ValidateCreateAccount
()
api/model/model.go:189
↓ 2 callers
Method
ValidateCreateBalance
()
api/model/model.go:85
↓ 2 callers
Method
ValidateCreateBalanceMonitor
()
api/model/model.go:99
↓ 2 callers
Method
ValidateCreateLedger
()
api/model/model.go:65
↓ 2 callers
Method
ValidateMonitorCondition
()
api/model/model.go:115
↓ 2 callers
Method
ValidateUpdateLedger
()
api/model/model.go:71
↓ 2 callers
Method
VoidWorker
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 callers
Method
WaitLock
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 callers
Method
acquireLineageLocks
acquireLineageLocks acquires distributed locks for multiple shadow balances using MultiLocker. MultiLocker handles sorting (prevents deadlock) and ded
lineage.go:506
↓ 2 callers
Method
addCredit
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 callers
Method
addDebit
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 callers
Function
applyPrecisionLogic
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 callers
Function
boolCount
(ok bool)
tests/loadtest/tools/queue_benchmark.go:651
↓ 2 callers
Function
boolInt
(ok bool)
tests/loadtest/tools/queue_benchmark.go:658
↓ 2 callers
Function
bucketedName
(base, buckets)
tests/loadtest/script.js:213
↓ 2 callers
Method
buildGroupMap
buildGroupMap creates a map for tracking unprocessed transaction groups. Parameters: - groupedTxns: The grouped transactions. Returns: - map[string]bo
reconciliation.go:931
↓ 2 callers
Method
buildTransactionExecutionWork
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 callers
Method
calculateRemainingAmount
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 callers
Function
categorizeRejectionReason
categorizeRejectionReason maps a free-text rejection reason to a bounded set of metric labels to keep Prometheus cardinality under control.
transaction.go:1731
↓ 2 callers
Function
collectIntSeries
(samples []snapshot, pick func(snapshot) int)
tests/loadtest/tools/queue_benchmark.go:554
↓ 2 callers
Method
commitShadowTransactions
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 callers
Function
convertPreciseToDecimal
convertPreciseToDecimal converts the precise integer amount to a decimal value by dividing by precision, storing the exact string representation
model/model.go:347
↓ 2 callers
Function
counterRate
(count int, durationMs float64)
tests/loadtest/tools/queue_benchmark.go:637
↓ 2 callers
Function
destinationOrDestinationsValidation
(t *RecordTransaction)
api/model/model.go:56
↓ 2 callers
Function
discover_runs
(root: Path)
tests/loadtest/tools/dashboard_parser.py:17
↓ 2 callers
Function
enqueueTransactions
enqueueTransactions enqueues the original transaction or its split transactions into the provided queue. It starts by determining which transactions t
transaction.go:2098
↓ 2 callers
Method
executeHook
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 callers
Method
executeTransactionPlan
executeTransactionPlan runs the selected internal execution mode and fails open from queued batching back to the single-transaction path when batching
transaction.go:674
← previous
next →
401–500 of 1,908, ranked by callers