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
↓ 410 callers
Method
Error
(args ...interface{})
transaction_test.go:4749
↓ 297 callers
Function
NewAPIError
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 callers
Method
Close
Close closes the underlying database connection pool.
database/db.go:44
↓ 182 callers
Method
GetBalanceByIDLite
Retrieves a balance by ID with additional data and queued status
database/repository.go:97
↓ 154 callers
Method
Start
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 callers
Method
Get
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 callers
Method
Error
(args ...interface{})
api/transaction_api_test.go:91
↓ 119 callers
Method
CreateBalance
(balance model.Balance)
database/repository.go:95
↓ 97 callers
Function
NewLedgerForge
NewLedgerForge initializes a new instance of LedgerForge with the provided database datasource. It fetches the configuration, initializes Redis client
ledgerforge.go:121
↓ 82 callers
Function
GenerateUUIDWithSuffix
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 callers
Method
Set
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 callers
Method
Info
(args ...interface{})
transaction_test.go:4741
↓ 57 callers
Method
Error
()
internal/lock/lock.go:40
↓ 52 callers
Method
QueueTransaction
QueueTransaction processes and queues a transaction for execution. It handles both single transactions and split transactions, preparing them for proc
transaction.go:1785
↓ 50 callers
Function
escapeHtml
(value)
tests/loadtest/tools/dashboard/app.js:1512
↓ 49 callers
Function
NewDataSource
NewDataSource initializes a new database connection.
database/db.go:52
↓ 49 callers
Function
newTestDataSource
()
ledger_test.go:40
↓ 49 callers
Function
parseBigInt
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 callers
Function
Fetch
()
config/config.go:257
↓ 37 callers
Method
GetTransactionByRef
Checks if a parent transaction is void
database/repository.go:51
↓ 36 callers
Function
setupRouter
(t *testing.T)
api/ledger_api_test.go:68
↓ 35 callers
Function
extractValueForSQL
(value interface{})
internal/filter/helpers.go:25
↓ 33 callers
Method
Unlock
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 callers
Method
Lock
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 callers
Function
SetUpTestRequest
(s TestRequest)
api/ledger_api_test.go:52
↓ 28 callers
Function
Int64ToBigInt
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 callers
Method
GetBalanceByID
Creates a new balance
database/repository.go:96
↓ 27 callers
Function
toNumber
(value)
tests/loadtest/tools/dashboard/app.js:1373
↓ 26 callers
Function
ToJsonReq
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 callers
Method
Warn
(args ...interface{})
transaction_test.go:4745
↓ 26 callers
Function
contains
Helper function to check if a slice contains a value.
database/balance.go:39
↓ 25 callers
Function
to_float
(value: Any)
tests/loadtest/tools/dashboard_parser.py:465
↓ 24 callers
Method
CommitInflightTransaction
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 callers
Method
Debug
(args ...interface{})
transaction_test.go:4737
↓ 23 callers
Method
Fatal
(args ...interface{})
transaction_test.go:4753
↓ 22 callers
Function
NotifyError
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 callers
Method
CreateLedger
(ledger model.Ledger)
database/repository.go:83
↓ 20 callers
Method
Stop
Stop gracefully stops the outbox processor. It signals the processor to stop and waits for pending work to complete.
lineage_worker.go:120
↓ 20 callers
Function
canProcessTransaction
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 callers
Function
ApplyPrecision
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 callers
Function
Build
(filters *QueryFilterSet, table string, alias string, startArgPos int)
internal/filter/sql_builder.go:11
↓ 15 callers
Method
calculateAllocation
calculateAllocation calculates fund allocations based on the specified strategy. Supported strategies are FIFO, LIFO, and PROPORTIONAL. Parameters: -
lineage.go:888
↓ 14 callers
Method
CreateIdentity
(identity model.Identity)
database/repository.go:139
↓ 14 callers
Function
ParseFromQuery
ParseFromQuery parses URL query parameters into a ParseResult. Returns errors for invalid params rather than silently dropping them.
internal/filter/parser.go:17
↓ 14 callers
Method
VoidInflightTransaction
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 callers
Function
pollForTransactionStatus
pollForTransactionStatus polls for a transaction until it reaches the expected status or a timeout occurs.
transaction_test.go:94
↓ 13 callers
Method
Config
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 callers
Function
NewTokenizationService
NewTokenizationService creates a new tokenization service. Parameters: - encryptionKey []byte: The encryption key used for tokenization. Returns: -
internal/tokenization/tokenization.go:62
↓ 13 callers
Function
ValidateSortByForTable
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 callers
Method
AddDependency
AddDependency adds a dependency item to the batch. Dependencies are indexed before the primary item.
internal/search/search.go:128
↓ 12 callers
Function
compare
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 callers
Function
emptyBlock
(text)
tests/loadtest/tools/dashboard/app.js:1395
↓ 12 callers
Function
exitf
(format string, args ...interface{})
tests/loadtest/tools/queue_benchmark.go:672
↓ 12 callers
Method
logAndRecordError
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 callers
Function
testRedisAddr
()
test_helpers_test.go:25
↓ 11 callers
Function
NewLineageOutboxProcessor
NewLineageOutboxProcessor creates a new outbox processor. Parameters: - ledgerforge *LedgerForge: The LedgerForge instance containing the datasource
lineage_worker.go:50
↓ 11 callers
Function
NewMultiLocker
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 callers
Function
compareMetricRow
(label, leftValue, rightValue, formatter)
tests/loadtest/tools/dashboard/app.js:1127
↓ 11 callers
Function
pollForLineageMappings
pollForLineageMappings polls the database until the expected number of lineage mappings appear
lineage_integration_test.go:18
↓ 11 callers
Method
updateHookStatus
(ctx context.Context, hook *Hook, success bool)
internal/hooks/client.go:213
↓ 10 callers
Method
Detokenize
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 callers
Method
Enqueue
Enqueue enqueues a transaction to the Redis queue. Parameters: - ctx context.Context: The context for the operation. - transaction *model.Transaction
queue.go:174
↓ 10 callers
Method
GetTransaction
(cxt context.Context, id string)
database/repository.go:49
↓ 10 callers
Method
GetTransactionsByParent
(ctx context.Context, parentID string, limit int, offset int64)
database/repository.go:66
↓ 10 callers
Method
InitializeBalanceFields
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 callers
Function
NewLocker
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 callers
Method
RecordTransaction
RecordTransaction records a transaction by validating, processing balances, and finalizing the transaction. It starts a tracing span, acquires a lock,
transaction.go:773
↓ 10 callers
Function
dth
(scn)
tests/loadtest/script.js:23
↓ 10 callers
Function
hasValue
(value)
tests/loadtest/tools/dashboard/app.js:1073
↓ 10 callers
Function
metricValues
(metrics, name)
tests/loadtest/tools/dashboard/app.js:1193
↓ 10 callers
Function
pollForBalance
pollForBalance polls until the balance reaches the expected value
lineage_integration_test.go:42
↓ 10 callers
Function
transformTransaction
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 callers
Method
IsFieldTokenized
(fieldName string)
model/identity.go:55
↓ 9 callers
Method
IsValid
IsValid checks if the API key is valid
model/api_key.go:50
↓ 9 callers
Method
ProcessTransactionInBatches
ProcessTransactionInBatches processes transactions in batches or streams them based on the provided mode. It starts a tracing span, initializes worker
transaction.go:488
↓ 9 callers
Method
SendWebhook
SendWebhook enqueues a webhook notification task using the LedgerForge instance's asynq client. Parameters: - newWebhook NewWebhook: The webhook noti
webhooks.go:133
↓ 9 callers
Method
TokenizeWithMode
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 callers
Method
WithPollInterval
WithPollInterval sets the interval between polls. Parameters: - interval time.Duration: The poll interval. Returns: - *LineageOutboxProcessor: The p
lineage_worker.go:79
↓ 9 callers
Method
computeBalance
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 callers
Function
createTestTransaction
createTestTransaction creates a test transaction
transaction_benchmark_test.go:78
↓ 9 callers
Function
formatCompact
(value)
tests/loadtest/tools/dashboard/app.js:1399
↓ 9 callers
Function
formatMs
(value)
tests/loadtest/tools/dashboard/app.js:1421
↓ 9 callers
Function
formatPercent
(value)
tests/loadtest/tools/dashboard/app.js:1417
↓ 9 callers
Method
getOrCreateBalanceByIndicator
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 callers
Function
metric_values
(metrics: dict[str, Any], name: str)
tests/loadtest/tools/dashboard_parser.py:391
↓ 9 callers
Function
summaryCard
(label, value)
tests/loadtest/tools/dashboard/app.js:1386
↓ 8 callers
Function
BuildConditionExpression
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 callers
Function
BuildWithOptions
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 callers
Method
Delete
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 callers
Method
Enabled
()
internal/hotpairs/hotpairs.go:66
↓ 8 callers
Method
GetIdentity
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 callers
Function
GetValidFieldsForTable
(table string)
internal/filter/validation.go:42
↓ 8 callers
Method
Keys
Keys returns the deduplicated and sorted keys that this MultiLocker manages.
internal/lock/lock.go:299
↓ 8 callers
Function
ParseFiltersFromBody
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 callers
Function
Validate
(filters *QueryFilterSet, table string)
internal/filter/validation.go:11
↓ 8 callers
Method
addError
(err string)
internal/search/reindex.go:84
↓ 8 callers
Function
createQueueCopy
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 callers
Function
getTransactionMock
(amount float64, overdraft bool)
balance_test.go:56
↓ 8 callers
Method
queueIndexData
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 callers
Function
toMap
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