MCPcopy Create free account

hub / github.com/devaccuracy/ledgerforge / functions

Functions1,908 in github.com/devaccuracy/ledgerforge

↓ 410 callersMethodError
(args ...interface{})
transaction_test.go:4749
↓ 297 callersFunctionNewAPIError
NewAPIError creates a new APIError instance. It logs the error details and returns the error object with the provided code, message, and additional de
internal/apierror/apierror.go:55
↓ 289 callersMethodClose
Close closes the underlying database connection pool.
database/db.go:44
↓ 182 callersMethodGetBalanceByIDLite
Retrieves a balance by ID with additional data and queued status
database/repository.go:97
↓ 154 callersMethodStart
Start begins processing outbox entries in the background. The processor will poll for pending entries at the configured interval. Parameters: - ctx c
lineage_worker.go:101
↓ 152 callersMethodGet
Get retrieves a value from the cache using a given key. Parameters: - ctx: The context for managing the request lifecycle. - key: The cache key to fet
internal/cache/cache.go:47
↓ 146 callersMethodError
(args ...interface{})
api/transaction_api_test.go:91
↓ 119 callersMethodCreateBalance
(balance model.Balance)
database/repository.go:95
↓ 97 callersFunctionNewLedgerForge
NewLedgerForge initializes a new instance of LedgerForge with the provided database datasource. It fetches the configuration, initializes Redis client
ledgerforge.go:121
↓ 82 callersFunctionGenerateUUIDWithSuffix
GenerateUUIDWithSuffix generates a UUID with a given module name as a suffix. This is useful for creating unique identifiers with context-specific pre
model/model.go:28
↓ 71 callersMethodSet
Set stores a value in the cache with a specified time-to-live (TTL). Parameters: - ctx: The context for managing the request lifecycle. - key: The cac
internal/cache/cache.go:39
↓ 59 callersMethodInfo
(args ...interface{})
transaction_test.go:4741
↓ 57 callersMethodError
()
internal/lock/lock.go:40
↓ 52 callersMethodQueueTransaction
QueueTransaction processes and queues a transaction for execution. It handles both single transactions and split transactions, preparing them for proc
transaction.go:1785
↓ 50 callersFunctionescapeHtml
(value)
tests/loadtest/tools/dashboard/app.js:1512
↓ 49 callersFunctionNewDataSource
NewDataSource initializes a new database connection.
database/db.go:52
↓ 49 callersFunctionnewTestDataSource
()
ledger_test.go:40
↓ 49 callersFunctionparseBigInt
parseBigInt parses a string into a *big.Int, returning an error if parsing fails. This ensures we don't silently get nil values when database returns
database/balance.go:50
↓ 41 callersFunctionFetch
()
config/config.go:257
↓ 37 callersMethodGetTransactionByRef
Checks if a parent transaction is void
database/repository.go:51
↓ 36 callersFunctionsetupRouter
(t *testing.T)
api/ledger_api_test.go:68
↓ 35 callersFunctionextractValueForSQL
(value interface{})
internal/filter/helpers.go:25
↓ 33 callersMethodUnlock
Unlock releases the lock if the calling instance is the lock holder (based on the value). The operation is atomic, ensuring only the holder of the loc
internal/lock/lock.go:107
↓ 30 callersMethodLock
Lock attempts to acquire the lock for the specified key with a timeout. If the lock is already held, it returns an error indicating the lock is unavai
internal/lock/lock.go:87
↓ 29 callersFunctionSetUpTestRequest
(s TestRequest)
api/ledger_api_test.go:52
↓ 28 callersFunctionInt64ToBigInt
Int64ToBigInt converts an int64 value to a *big.Int. This is useful for handling large numbers in computations such as financial transactions.
model/model.go:37
↓ 27 callersMethodGetBalanceByID
Creates a new balance
database/repository.go:96
↓ 27 callersFunctiontoNumber
(value)
tests/loadtest/tools/dashboard/app.js:1373
↓ 26 callersFunctionToJsonReq
ToJsonReq converts a Go object to a JSON-encoded HTTP request payload. It serializes the provided payload to JSON format and wraps it in a buffer for
internal/request/request.go:35
↓ 26 callersMethodWarn
(args ...interface{})
transaction_test.go:4745
↓ 26 callersFunctioncontains
Helper function to check if a slice contains a value.
database/balance.go:39
↓ 25 callersFunctionto_float
(value: Any)
tests/loadtest/tools/dashboard_parser.py:465
↓ 24 callersMethodCommitInflightTransaction
CommitInflightTransaction commits an inflight transaction by validating and updating its amount, and finalizing the commitment. It starts a tracing sp
inflight_transaction.go:178
↓ 24 callersMethodDebug
(args ...interface{})
transaction_test.go:4737
↓ 23 callersMethodFatal
(args ...interface{})
transaction_test.go:4753
↓ 22 callersFunctionNotifyError
NotifyError sends an error notification through the configured notification system. It logs the error locally and sends a notification via Slack (if c
internal/notification/notification.go:118
↓ 20 callersMethodCreateLedger
(ledger model.Ledger)
database/repository.go:83
↓ 20 callersMethodStop
Stop gracefully stops the outbox processor. It signals the processor to stop and waits for pending work to complete.
lineage_worker.go:120
↓ 20 callersFunctioncanProcessTransaction
canProcessTransaction checks if a transaction can be processed given the source balance. It returns an error if the balance is insufficient and overdr
model/model.go:132
↓ 19 callersFunctionApplyPrecision
ApplyPrecision handles both operations involving precision: 1. If PreciseAmount exists: converts it to a decimal Amount 2. If Amount exists: converts
model/model.go:235
↓ 19 callersFunctionBuild
(filters *QueryFilterSet, table string, alias string, startArgPos int)
internal/filter/sql_builder.go:11
↓ 15 callersMethodcalculateAllocation
calculateAllocation calculates fund allocations based on the specified strategy. Supported strategies are FIFO, LIFO, and PROPORTIONAL. Parameters: -
lineage.go:888
↓ 14 callersMethodCreateIdentity
(identity model.Identity)
database/repository.go:139
↓ 14 callersFunctionParseFromQuery
ParseFromQuery parses URL query parameters into a ParseResult. Returns errors for invalid params rather than silently dropping them.
internal/filter/parser.go:17
↓ 14 callersMethodVoidInflightTransaction
VoidInflightTransaction voids an inflight transaction by validating it, calculating the remaining amount, and finalizing the void. It starts a tracing
inflight_transaction.go:423
↓ 14 callersFunctionpollForTransactionStatus
pollForTransactionStatus polls for a transaction until it reaches the expected status or a timeout occurs.
transaction_test.go:94
↓ 13 callersMethodConfig
Config returns the cached configuration for the LedgerForge instance. Falls back to config.Fetch() if not initialized (for backward compatibility with
ledgerforge.go:182
↓ 13 callersFunctionNewTokenizationService
NewTokenizationService creates a new tokenization service. Parameters: - encryptionKey []byte: The encryption key used for tokenization. Returns: -
internal/tokenization/tokenization.go:62
↓ 13 callersFunctionValidateSortByForTable
ValidateSortByForTable validates opts.SortBy against the table's allowed sort fields. Normalizes SortBy (lowercase, trim) and returns an error if inva
internal/filter/validation.go:189
↓ 12 callersMethodAddDependency
AddDependency adds a dependency item to the batch. Dependencies are indexed before the primary item.
internal/search/search.go:128
↓ 12 callersFunctioncompare
compare compares two *big.Int values based on the provided condition (e.g., >, <, ==). Returns true if the condition holds, otherwise false.
model/model.go:52
↓ 12 callersFunctionemptyBlock
(text)
tests/loadtest/tools/dashboard/app.js:1395
↓ 12 callersFunctionexitf
(format string, args ...interface{})
tests/loadtest/tools/queue_benchmark.go:672
↓ 12 callersMethodlogAndRecordError
logAndRecordError logs an error message and records the error in the tracing span. It returns a formatted error message combining the provided message
transaction.go:1664
↓ 12 callersFunctiontestRedisAddr
()
test_helpers_test.go:25
↓ 11 callersFunctionNewLineageOutboxProcessor
NewLineageOutboxProcessor creates a new outbox processor. Parameters: - ledgerforge *LedgerForge: The LedgerForge instance containing the datasource
lineage_worker.go:50
↓ 11 callersFunctionNewMultiLocker
NewMultiLocker creates a new MultiLocker instance that manages locks for multiple keys. Keys are deduplicated and sorted lexicographically to ensure c
internal/lock/lock.go:182
↓ 11 callersFunctioncompareMetricRow
(label, leftValue, rightValue, formatter)
tests/loadtest/tools/dashboard/app.js:1127
↓ 11 callersFunctionpollForLineageMappings
pollForLineageMappings polls the database until the expected number of lineage mappings appear
lineage_integration_test.go:18
↓ 11 callersMethodupdateHookStatus
(ctx context.Context, hook *Hook, success bool)
internal/hooks/client.go:213
↓ 10 callersMethodDetokenize
Detokenize converts a token back to the original PII value using automatic mode detection. Parameters: - token string: The token to be converted back
internal/tokenization/tokenization.go:134
↓ 10 callersMethodEnqueue
Enqueue enqueues a transaction to the Redis queue. Parameters: - ctx context.Context: The context for the operation. - transaction *model.Transaction
queue.go:174
↓ 10 callersMethodGetTransaction
(cxt context.Context, id string)
database/repository.go:49
↓ 10 callersMethodGetTransactionsByParent
(ctx context.Context, parentID string, limit int, offset int64)
database/repository.go:66
↓ 10 callersMethodInitializeBalanceFields
InitializeBalanceFields initializes all the fields of the Balance struct that might be nil. This ensures that all balance-related fields have valid *b
model/model.go:73
↓ 10 callersFunctionNewLocker
NewLocker initializes a new Locker instance with a Redis client, a key, and a value. Parameters: - client: A Redis universal client to interact with R
internal/lock/lock.go:73
↓ 10 callersMethodRecordTransaction
RecordTransaction records a transaction by validating, processing balances, and finalizing the transaction. It starts a tracing span, acquires a lock,
transaction.go:773
↓ 10 callersFunctiondth
(scn)
tests/loadtest/script.js:23
↓ 10 callersFunctionhasValue
(value)
tests/loadtest/tools/dashboard/app.js:1073
↓ 10 callersFunctionmetricValues
(metrics, name)
tests/loadtest/tools/dashboard/app.js:1193
↓ 10 callersFunctionpollForBalance
pollForBalance polls until the balance reaches the expected value
lineage_integration_test.go:42
↓ 10 callersFunctiontransformTransaction
transformTransaction prepares a transaction for API response by ensuring that metadata fields are properly represented as first-class fields. This mai
api/transactions.go:39
↓ 9 callersMethodIsFieldTokenized
(fieldName string)
model/identity.go:55
↓ 9 callersMethodIsValid
IsValid checks if the API key is valid
model/api_key.go:50
↓ 9 callersMethodProcessTransactionInBatches
ProcessTransactionInBatches processes transactions in batches or streams them based on the provided mode. It starts a tracing span, initializes worker
transaction.go:488
↓ 9 callersMethodSendWebhook
SendWebhook enqueues a webhook notification task using the LedgerForge instance's asynq client. Parameters: - newWebhook NewWebhook: The webhook noti
webhooks.go:133
↓ 9 callersMethodTokenizeWithMode
TokenizeWithMode converts a PII value to a token using the specified mode. Parameters: - value string: The original PII value to be tokenized. - mode
internal/tokenization/tokenization.go:92
↓ 9 callersMethodWithPollInterval
WithPollInterval sets the interval between polls. Parameters: - interval time.Duration: The poll interval. Returns: - *LineageOutboxProcessor: The p
lineage_worker.go:79
↓ 9 callersMethodcomputeBalance
computeBalance computes the overall balance for inflight and normal balances. inflight indicates whether the inflight balance or regular balance shoul
model/model.go:119
↓ 9 callersFunctioncreateTestTransaction
createTestTransaction creates a test transaction
transaction_benchmark_test.go:78
↓ 9 callersFunctionformatCompact
(value)
tests/loadtest/tools/dashboard/app.js:1399
↓ 9 callersFunctionformatMs
(value)
tests/loadtest/tools/dashboard/app.js:1421
↓ 9 callersFunctionformatPercent
(value)
tests/loadtest/tools/dashboard/app.js:1417
↓ 9 callersMethodgetOrCreateBalanceByIndicator
getOrCreateBalanceByIndicator retrieves a balance by its indicator and currency. If the balance does not exist, it creates a new one. It starts a trac
balance.go:136
↓ 9 callersFunctionmetric_values
(metrics: dict[str, Any], name: str)
tests/loadtest/tools/dashboard_parser.py:391
↓ 9 callersFunctionsummaryCard
(label, value)
tests/loadtest/tools/dashboard/app.js:1386
↓ 8 callersFunctionBuildConditionExpression
BuildConditionExpression joins individual condition fragments with the requested logical operator. Defaults to AND when no operator is specified.
internal/filter/sql_builder.go:90
↓ 8 callersFunctionBuildWithOptions
BuildWithOptions builds filter conditions and includes sorting options. It validates both filters and sort options, returning an error if either is in
internal/filter/sql_builder.go:219
↓ 8 callersMethodDelete
Delete removes a value from the cache based on the provided key. Parameters: - ctx: The context for managing the request lifecycle. - key: The cache k
internal/cache/cache.go:54
↓ 8 callersMethodEnabled
()
internal/hotpairs/hotpairs.go:66
↓ 8 callersMethodGetIdentity
GetIdentity retrieves an identity by its ID. Parameters: - id string: The ID of the identity to retrieve. Returns: - *model.Identity: A pointer to t
identity.go:76
↓ 8 callersFunctionGetValidFieldsForTable
(table string)
internal/filter/validation.go:42
↓ 8 callersMethodKeys
Keys returns the deduplicated and sorted keys that this MultiLocker manages.
internal/lock/lock.go:299
↓ 8 callersFunctionParseFiltersFromBody
ParseFiltersFromBody parses filters from a JSON request body. The table parameter is used to validate sort fields against the allowed fields for that
api/filter_helper.go:85
↓ 8 callersFunctionValidate
(filters *QueryFilterSet, table string)
internal/filter/validation.go:11
↓ 8 callersMethodaddError
(err string)
internal/search/reindex.go:84
↓ 8 callersFunctioncreateQueueCopy
createQueueCopy creates a new copy of a transaction specifically for queueing. It generates new identifiers and maintains the relationship with the or
transaction.go:2064
↓ 8 callersFunctiongetTransactionMock
(amount float64, overdraft bool)
balance_test.go:56
↓ 8 callersMethodqueueIndexData
queueIndexData enqueues a task to index data in a specified collection. Parameters: - id string: The ID of the data to index. - collection string: Th
queue.go:140
↓ 8 callersFunctiontoMap
toMap converts an interface{} to map[string]interface{} via JSON marshaling.
internal/search/search.go:282
next →1–100 of 1,908, ranked by callers