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
↓ 8 callers
Method
validateAndAddDefaults
()
config/config.go:266
↓ 7 callers
Method
CheckCondition
CheckCondition checks if a balance meets the condition specified by a BalanceMonitor. It compares various balance fields (e.g., debit balance, credit
model/model.go:454
↓ 7 callers
Method
Client
Client returns the Redis universal client. It can be used directly for Redis operations like Get, Set, or Publish. Returns: - redis.UniversalClient:
internal/redis-db/redisdb.go:201
↓ 7 callers
Method
CreateAPIKey
(ctx context.Context, name, ownerID string, scopes []string, expiresAt time.Time)
database/repository.go:174
↓ 7 callers
Function
GetDBConnection
GetDBConnection ensures a single database connection instance.
database/db.go:66
↓ 7 callers
Method
HandleNotification
HandleNotification processes incoming notifications and updates Typesense collections based on the table and data. It ensures the required fields exis
internal/search/search.go:231
↓ 7 callers
Function
NewIndexBatch
NewIndexBatch creates a new IndexBatch with the given ID.
internal/search/search.go:118
↓ 7 callers
Function
contains
contains checks whether a slice contains a specific string. Parameters: - slice: The slice to check. - item: The item to look for in the slice. Return
reconciliation.go:81
↓ 7 callers
Function
newMockCache
()
database/transactions_test.go:44
↓ 7 callers
Function
startTestAsynqWorker
startTestAsynqWorker sets up and starts an Asynq server for testing purposes. It takes the testing object, configuration, LedgerForge instance, and th
transaction_test.go:4760
↓ 7 callers
Method
updateProgress
(phase string, processed int64, total int64)
internal/search/reindex.go:76
↓ 6 callers
Method
GetBalanceLineage
GetBalanceLineage retrieves the fund lineage for a balance. It returns a breakdown of funds by provider, showing how much was received and spent from
lineage.go:1054
↓ 6 callers
Method
GetState
(ctx context.Context, pairKey string)
internal/hotpairs/hotpairs.go:81
↓ 6 callers
Function
HasFilters
HasFilters checks if the request contains any filter parameters. It returns true if filters were provided, false otherwise.
api/filter_helper.go:59
↓ 6 callers
Method
HashTxn
HashTxn generates a SHA-256 hash of a transaction's relevant fields. This ensures the integrity of the transaction by creating a unique hash from its
model/model.go:43
↓ 6 callers
Function
IsLockContentionError
(err error)
internal/hotpairs/router.go:165
↓ 6 callers
Function
NewQueuedTransactionRecoveryProcessor
NewQueuedTransactionRecoveryProcessor creates the stuck queued-transaction recovery loop with conservative single-worker defaults to avoid recovery-in
queue_recovery.go:47
↓ 6 callers
Method
PairKey
(source, destination, currency string)
internal/hotpairs/hotpairs.go:77
↓ 6 callers
Method
RecordContention
(ctx context.Context, pairKey string)
internal/hotpairs/hotpairs.go:102
↓ 6 callers
Method
RecordTransaction
(cxt context.Context, txn *model.Transaction)
database/repository.go:44
↓ 6 callers
Method
RefundTransaction
RefundTransaction processes a refund for a given transaction by its ID. It starts a tracing span, retrieves the original transaction, validates its st
transaction.go:2347
↓ 6 callers
Function
RegisterWebhookSender
RegisterWebhookSender registers a function to handle webhook sending.
internal/notification/notification.go:107
↓ 6 callers
Method
RejectTransaction
RejectTransaction rejects a transaction by updating its status and recording the rejection reason. It starts a tracing span, updates the transaction s
transaction.go:1681
↓ 6 callers
Method
Tokenize
Tokenize converts a PII value to a token using the default standard mode. Parameters: - value string: The original PII value to be tokenized. Return
internal/tokenization/tokenization.go:79
↓ 6 callers
Function
UpdateBalances
UpdateBalances updates the balances for both the source and destination based on the transaction details. It ensures precision is applied and checks f
model/model.go:421
↓ 6 callers
Function
compareSummaryCard
(label, leftName, leftRaw, rightName, rightRaw, formatter, delta)
tests/loadtest/tools/dashboard/app.js:1141
↓ 6 callers
Function
createTestBalance
createTestBalance creates a test balance with the given ID and amount
transaction_benchmark_test.go:60
↓ 6 callers
Function
describeDelta
(leftValue, rightValue, formatter)
tests/loadtest/tools/dashboard/app.js:1479
↓ 6 callers
Method
failWithError
(err error, phase string)
internal/search/reindex.go:152
↓ 6 callers
Function
getRequiredField
(record []string, columnMap map[string]int, field string)
internal/files/files.go:448
↓ 6 callers
Function
hasSeries
(run, key)
tests/loadtest/tools/dashboard/app.js:1069
↓ 6 callers
Function
injectAPIKeyToMetadata
injectAPIKeyToMetadata modifies the request body to include the API key ID in the meta_data. This function reads the request body, adds or updates the
api/middleware/auth.go:115
↓ 6 callers
Function
newMockCacheRecon
()
database/reconciliation_test.go:38
↓ 6 callers
Method
normalizeTimeFields
normalizeTimeFields converts time fields to Unix timestamps
internal/search/search.go:372
↓ 6 callers
Function
percentile
(values, pct)
tests/loadtest/tools/dashboard/app.js:1311
↓ 6 callers
Function
renderDashboard
(run)
tests/loadtest/tools/dashboard/app.js:531
↓ 6 callers
Function
renderRunList
()
tests/loadtest/tools/dashboard/app.js:231
↓ 6 callers
Function
setTransactionMetadata
setTransactionMetadata initializes and sets the required metadata for a transaction. calculates the transaction hash, and sets the precise amount base
transaction.go:2023
↓ 6 callers
Function
setupBenchmarkConfig
setupBenchmarkConfig creates and stores a test configuration
transaction_benchmark_test.go:34
↓ 6 callers
Function
updateBalance
updateBalance updates a balance entry in the database. This function handles the logic of updating all balance-related fields while ensuring data cons
database/balance.go:881
↓ 5 callers
Method
BackupToDisk
BackupToDisk creates a backup of the PostgreSQL database and stores it locally on disk. It creates a directory based on the current date and stores th
internal/pg-backups/pg-backup-drive.go:92
↓ 5 callers
Function
Call
Call makes an HTTP request using the provided request object and decodes the response into the specified structure. It automatically sets the request
internal/request/request.go:57
↓ 5 callers
Method
CreateBulkTransactions
CreateBulkTransactions handles the creation of multiple transactions in a batch. If atomic is true: Any failure will cause all transactions to be roll
transaction.go:2519
↓ 5 callers
Method
CreateMonitor
(monitor model.BalanceMonitor)
database/repository.go:129
↓ 5 callers
Method
GetBalanceByID
GetBalanceByID retrieves a balance by its ID. It starts a tracing span, fetches the balance, and records relevant events. Parameters: - ctx context.C
balance.go:257
↓ 5 callers
Method
GetBalanceByID
GetBalanceByID retrieves a balance by its ID from the database, along with optional related data such as identity or ledger, based on the `include` pa
database/balance.go:304
↓ 5 callers
Method
GetIdentityByID
Creates a new identity
database/repository.go:140
↓ 5 callers
Method
GetQueuedAmounts
GetQueuedAmounts retrieves the total queued debit and credit amounts for a given balance ID. It only includes transactions with status 'QUEUED' that d
database/transaction.go:1319
↓ 5 callers
Method
GetTransaction
GetTransaction retrieves a transaction by its ID from the datasource. It starts a tracing span, fetches the transaction, and records relevant events a
transaction.go:2125
↓ 5 callers
Method
GetTransactionsByShadowFor
(ctx context.Context, parentTransactionID string)
database/repository.go:69
↓ 5 callers
Method
Lock
Lock attempts to acquire all locks in deterministic order. If any lock acquisition fails, all previously acquired locks are released (rollback). Param
internal/lock/lock.go:216
↓ 5 callers
Function
MockConfig
MockConfig sets a mock configuration for testing purposes.
config/config.go:483
↓ 5 callers
Function
NewManager
(client redis.UniversalClient, cfg Config)
internal/hotpairs/hotpairs.go:41
↓ 5 callers
Function
NewQueue
NewQueue initializes a new Queue instance with the provided configuration. Parameters: - conf *config.Configuration: The configuration for the queue.
queue.go:58
↓ 5 callers
Function
ParseFiltersFromContext
ParseFiltersFromContext parses query parameters into a QueryFilterSet using the filter package. It handles all filter parameters in the format: field_
api/filter_helper.go:52
↓ 5 callers
Method
TokenizeIdentityField
TokenizeIdentityField tokenizes a specific field in an identity. Parameters: - identityID string: The ID of the identity. - fieldName string: The nam
identity.go:151
↓ 5 callers
Method
UpdateBalances
UpdateBalances updates both the source and destination balances in a single transaction. The function begins a database transaction, updates the balan
database/balance.go:835
↓ 5 callers
Method
UpdateMetadata
UpdateMetadata updates the metadata for a given entity ID. It first determines the entity type, retrieves current metadata, merges it with new metadat
metadata.go:50
↓ 5 callers
Method
UpdateReconciliationStatus
Retrieves a reconciliation by ID
database/repository.go:155
↓ 5 callers
Function
ValidateSortField
ValidateSortField validates that the sort field is allowed for the table.
internal/filter/validation.go:164
↓ 5 callers
Function
buildCompareTone
(leftValue, rightValue, formatter = (value) => String(value))
tests/loadtest/tools/dashboard/app.js:1086
↓ 5 callers
Function
build_stats
(overview: dict[str, Any], series: list[dict[str, Any]])
tests/loadtest/tools/dashboard_parser.py:368
↓ 5 callers
Function
clamp01
(value)
tests/loadtest/tools/dashboard/app.js:1369
↓ 5 callers
Function
compareSchemas
compareSchemas compares the old schema with the new schema and returns: - newFields: fields present in new schema but not in old schema - removedField
internal/search/search.go:479
↓ 5 callers
Function
format_compact
(value: float | None)
tests/loadtest/tools/dashboard_parser.py:474
↓ 5 callers
Function
format_ms
(value: float | None)
tests/loadtest/tools/dashboard_parser.py:498
↓ 5 callers
Method
getIdentityIdentifier
getIdentityIdentifier generates a unique identifier string for an identity. It uses the identity's name (first/last or organization) combined with a p
lineage.go:807
↓ 5 callers
Function
getKeyPrefix
getKeyPrefix extracts the first 16 characters of the key for efficient lookup.
database/api_key.go:38
↓ 5 callers
Function
getTypeKey
getTypeKey returns the Redis key for a specific hook type set. Parameters: - hookType: The type of hook. Returns: - string: The Redis key for the ho
internal/hooks/manager.go:386
↓ 5 callers
Function
handleTransactionRejection
(ctx context.Context, b *ledgerforgeInstance, txn *model.Transaction, err error)
cmd/workers.go:160
↓ 5 callers
Function
maxInt
(a, b int)
tests/loadtest/tools/queue_benchmark.go:665
↓ 5 callers
Function
pollForTransactionStatus
pollForTransactionStatus polls for a transaction until it reaches the expected status or a timeout occurs.
api/transaction_api_test.go:44
↓ 5 callers
Function
postTxn
(source, destination)
tests/loadtest/script.js:222
↓ 5 callers
Function
renderCompareButton
()
tests/loadtest/tools/dashboard/app.js:193
↓ 5 callers
Method
stateKey
(pairKey string)
internal/hotpairs/hotpairs.go:180
↓ 5 callers
Method
updateEntityMetadata
updateEntityMetadata updates the metadata for a specific entity. It routes the update operation to the appropriate datasource method based on the enti
metadata.go:208
↓ 4 callers
Method
DetokenizeWithMode
DetokenizeWithMode converts a token back to the original PII value using the specified mode. Parameters: - token string: The token to be converted ba
internal/tokenization/tokenization.go:154
↓ 4 callers
Method
EnsureCollectionsExist
EnsureCollectionsExist ensures that all the necessary collections exist in the Typesense schema. If a collection doesn't exist, it will create the col
internal/search/search.go:175
↓ 4 callers
Method
GetAllBalances
Retrieves multiple balances by IDs with minimal data (batch query)
database/repository.go:99
↓ 4 callers
Method
GetAllLedgers
Creates a new ledger
database/repository.go:84
↓ 4 callers
Method
GetAllLedgers
GetAllLedgers retrieves a paginated list of ledger records from the database, unmarshaling their metadata from JSON format. This method supports pagin
database/ledger.go:84
↓ 4 callers
Method
GetAllTransactions
Updates the status of a transaction
database/repository.go:55
↓ 4 callers
Method
GetBalanceAtTime
GetBalanceAtTime retrieves the balance state at a specific point in time. It finds the most recent snapshot before the target time and applies any sub
database/balance.go:1606
↓ 4 callers
Method
GetBalanceByIndicator
Updates a balance
database/repository.go:101
↓ 4 callers
Method
GetLedgerByID
GetLedgerByID retrieves a ledger record from the database by its ID. It handles cases where the ledger is not found and unmarshals the metadata from J
database/ledger.go:140
↓ 4 callers
Method
GetMonitorByID
Creates a new balance monitor
database/repository.go:130
↓ 4 callers
Method
GetTransactionLineage
GetTransactionLineage retrieves the lineage information for a transaction. It returns the fund allocation details and any shadow transactions created
lineage.go:1161
↓ 4 callers
Method
HasScope
HasScope checks if the API key has the required scope
model/api_key.go:56
↓ 4 callers
Function
IsInflightTransaction
IsInflightTransaction checks whether a transaction is considered "inflight" based on its status and metadata. A transaction is considered inflight if:
inflight_transaction.go:79
↓ 4 callers
Method
ListAPIKeys
ListAPIKeys retrieves all API keys belonging to a specific owner from the database. The results are ordered by creation date in descending order (newe
database/api_key.go:295
↓ 4 callers
Method
MarkFieldAsTokenized
(fieldName string)
model/identity.go:89
↓ 4 callers
Function
NewCache
NewCache creates a new instance of RedisCache by establishing a connection to Redis. It fetches the configuration, initializes Redis, and returns a Ca
internal/cache/cache.go:66
↓ 4 callers
Function
NewTypesenseClient
NewTypesenseClient initializes and returns a new Typesense client instance.
internal/search/search.go:161
↓ 4 callers
Function
QueueLaneFromMetadata
(meta map[string]interface{})
internal/hotpairs/router.go:126
↓ 4 callers
Method
RecordTransactionWithBalances
RecordTransactionWithBalances atomically records a transaction and updates both source and destination balances within a single database transaction.
database/transaction.go:211
↓ 4 callers
Method
ToTransaction
()
api/model/model.go:234
↓ 4 callers
Method
TryRecordQueuedTransactionBatch
TryRecordQueuedTransactionBatch opportunistically coalesces multiple QUEUED transactions that share the same contention shape into a single balance co
transaction.go:855
↓ 4 callers
Method
UpdateBalanceIdentity
UpdateBalanceIdentity updates only the identity_id associated with a balance. It validates that both the balance and the identity exist before applyin
balance.go:644
↓ 4 callers
Method
UpdateIdentity
UpdateIdentity updates a specific identity record in the database. It marshals the identity metadata, constructs an SQL update query, and checks the r
database/identity.go:182
↓ 4 callers
Method
WaitLock
WaitLock tries to acquire the lock within a specified waiting period. It will attempt to acquire the lock with exponential backoff if the lock is held
internal/lock/lock.go:147
← previous
next →
101–200 of 1,908, ranked by callers