Documentation
¶
Index ¶
- type DBTX
- type FailAttemptParams
- type FailPaymentParams
- type FetchAllInflightAttemptsParams
- type FetchHopsForAttemptsRow
- type FetchHtlcAttemptResolutionsForPaymentsRow
- type FetchHtlcAttemptsForPaymentsRow
- type FetchPaymentRow
- type FetchPaymentsByIDsMigRow
- type FetchPaymentsByIDsRow
- type FilterPaymentsDescParams
- type FilterPaymentsDescRow
- type FilterPaymentsParams
- type FilterPaymentsRow
- type InsertHtlcAttemptParams
- type InsertPaymentAttemptFirstHopCustomRecordParams
- type InsertPaymentDuplicateMigParams
- type InsertPaymentFirstHopCustomRecordParams
- type InsertPaymentHopCustomRecordParams
- type InsertPaymentIntentParams
- type InsertPaymentMigParams
- type InsertPaymentParams
- type InsertRouteHopAmpParams
- type InsertRouteHopBlindedParams
- type InsertRouteHopMppParams
- type InsertRouteHopParams
- type Payment
- type PaymentAndIntent
- type PaymentAttemptFirstHopCustomRecord
- type PaymentDuplicate
- type PaymentFirstHopCustomRecord
- type PaymentHopCustomRecord
- type PaymentHtlcAttempt
- type PaymentHtlcAttemptResolution
- type PaymentIntent
- type PaymentRouteHop
- type PaymentRouteHopAmp
- type PaymentRouteHopBlinded
- type PaymentRouteHopMpp
- type Queries
- func (q *Queries) CountPayments(ctx context.Context) (int64, error)
- func (q *Queries) DeleteFailedAttempts(ctx context.Context, paymentID int64) error
- func (q *Queries) DeletePayment(ctx context.Context, id int64) error
- func (q *Queries) FailAttempt(ctx context.Context, arg FailAttemptParams) error
- func (q *Queries) FailPayment(ctx context.Context, arg FailPaymentParams) (sql.Result, error)
- func (q *Queries) FetchAllInflightAttempts(ctx context.Context, arg FetchAllInflightAttemptsParams) ([]PaymentHtlcAttempt, error)
- func (q *Queries) FetchHopLevelCustomRecords(ctx context.Context, hopIds []int64) ([]PaymentHopCustomRecord, error)
- func (q *Queries) FetchHopsForAttempts(ctx context.Context, htlcAttemptIndices []int64) ([]FetchHopsForAttemptsRow, error)
- func (q *Queries) FetchHtlcAttemptResolutionsForPayments(ctx context.Context, paymentIds []int64) ([]FetchHtlcAttemptResolutionsForPaymentsRow, error)
- func (q *Queries) FetchHtlcAttemptsForPayments(ctx context.Context, paymentIds []int64) ([]FetchHtlcAttemptsForPaymentsRow, error)
- func (q *Queries) FetchPayment(ctx context.Context, paymentIdentifier []byte) (FetchPaymentRow, error)
- func (q *Queries) FetchPaymentDuplicates(ctx context.Context, paymentID int64) ([]PaymentDuplicate, error)
- func (q *Queries) FetchPaymentLevelFirstHopCustomRecords(ctx context.Context, paymentIds []int64) ([]PaymentFirstHopCustomRecord, error)
- func (q *Queries) FetchPaymentsByIDs(ctx context.Context, paymentIds []int64) ([]FetchPaymentsByIDsRow, error)
- func (q *Queries) FetchPaymentsByIDsMig(ctx context.Context, paymentIds []int64) ([]FetchPaymentsByIDsMigRow, error)
- func (q *Queries) FetchRouteLevelFirstHopCustomRecords(ctx context.Context, htlcAttemptIndices []int64) ([]PaymentAttemptFirstHopCustomRecord, error)
- func (q *Queries) FilterPayments(ctx context.Context, arg FilterPaymentsParams) ([]FilterPaymentsRow, error)
- func (q *Queries) FilterPaymentsDesc(ctx context.Context, arg FilterPaymentsDescParams) ([]FilterPaymentsDescRow, error)
- func (q *Queries) GetTx() DBTX
- func (q *Queries) InsertHtlcAttempt(ctx context.Context, arg InsertHtlcAttemptParams) (int64, error)
- func (q *Queries) InsertPayment(ctx context.Context, arg InsertPaymentParams) (int64, error)
- func (q *Queries) InsertPaymentAttemptFirstHopCustomRecord(ctx context.Context, arg InsertPaymentAttemptFirstHopCustomRecordParams) error
- func (q *Queries) InsertPaymentDuplicateMig(ctx context.Context, arg InsertPaymentDuplicateMigParams) (int64, error)
- func (q *Queries) InsertPaymentFirstHopCustomRecord(ctx context.Context, arg InsertPaymentFirstHopCustomRecordParams) error
- func (q *Queries) InsertPaymentHopCustomRecord(ctx context.Context, arg InsertPaymentHopCustomRecordParams) error
- func (q *Queries) InsertPaymentIntent(ctx context.Context, arg InsertPaymentIntentParams) (int64, error)
- func (q *Queries) InsertPaymentMig(ctx context.Context, arg InsertPaymentMigParams) (int64, error)
- func (q *Queries) InsertRouteHop(ctx context.Context, arg InsertRouteHopParams) (int64, error)
- func (q *Queries) InsertRouteHopAmp(ctx context.Context, arg InsertRouteHopAmpParams) error
- func (q *Queries) InsertRouteHopBlinded(ctx context.Context, arg InsertRouteHopBlindedParams) error
- func (q *Queries) InsertRouteHopMpp(ctx context.Context, arg InsertRouteHopMppParams) error
- func (q *Queries) SettleAttempt(ctx context.Context, arg SettleAttemptParams) error
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type SettleAttemptParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FailAttemptParams ¶
type FailPaymentParams ¶
type FetchHopsForAttemptsRow ¶
type FetchHopsForAttemptsRow struct {
ID int64
HtlcAttemptIndex int64
HopIndex int32
PubKey []byte
Scid string
OutgoingTimeLock int32
AmtToForward int64
MetaData []byte
MppPaymentAddr []byte
MppTotalMsat sql.NullInt64
AmpSetID []byte
AmpChildIndex sql.NullInt32
EncryptedData []byte
BlindingPoint []byte
BlindedPathTotalAmt sql.NullInt64
}
type FetchHtlcAttemptsForPaymentsRow ¶
type FetchHtlcAttemptsForPaymentsRow struct {
ID int64
AttemptIndex int64
PaymentID int64
SessionKey []byte
AttemptTime time.Time
PaymentHash []byte
FirstHopAmountMsat int64
RouteTotalTimeLock int32
RouteTotalAmount int64
RouteSourceKey []byte
ResolutionType sql.NullInt32
ResolutionTime sql.NullTime
FailureSourceIndex sql.NullInt32
HtlcFailReason sql.NullInt32
FailureMsg []byte
SettlePreimage []byte
}
type FetchPaymentRow ¶
func (FetchPaymentRow) GetPayment ¶
func (r FetchPaymentRow) GetPayment() Payment
GetPayment returns the Payment associated with this interface.
NOTE: This method is part of the PaymentAndIntent interface.
func (FetchPaymentRow) GetPaymentIntent ¶
func (r FetchPaymentRow) GetPaymentIntent() PaymentIntent
GetPaymentIntent returns the PaymentIntent associated with this payment. If the payment has no intent (IntentType is NULL), this returns a zero-value PaymentIntent.
NOTE: This method is part of the PaymentAndIntent interface.
type FetchPaymentsByIDsRow ¶
type FetchPaymentsByIDsRow struct {
ID int64
AmountMsat int64
CreatedAt time.Time
PaymentIdentifier []byte
FailReason sql.NullInt32
IntentType sql.NullInt16
IntentPayload []byte
}
func (FetchPaymentsByIDsRow) GetPayment ¶
func (r FetchPaymentsByIDsRow) GetPayment() Payment
func (FetchPaymentsByIDsRow) GetPaymentIntent ¶
func (r FetchPaymentsByIDsRow) GetPaymentIntent() PaymentIntent
type FilterPaymentsDescRow ¶
type FilterPaymentsParams ¶
type FilterPaymentsRow ¶
func (FilterPaymentsRow) GetPayment ¶
func (r FilterPaymentsRow) GetPayment() Payment
GetPayment returns the Payment associated with this interface.
NOTE: This method is part of the PaymentAndIntent interface.
func (FilterPaymentsRow) GetPaymentIntent ¶
func (r FilterPaymentsRow) GetPaymentIntent() PaymentIntent
GetPaymentIntent returns the PaymentIntent associated with this payment. If the payment has no intent (IntentType is NULL), this returns a zero-value PaymentIntent.
NOTE: This method is part of the PaymentAndIntent interface.
type InsertHtlcAttemptParams ¶
type InsertPaymentMigParams ¶
type InsertPaymentParams ¶
type InsertRouteHopAmpParams ¶
type InsertRouteHopMppParams ¶
type InsertRouteHopParams ¶
type PaymentAndIntent ¶
type PaymentAndIntent interface {
// GetPayment returns the Payment associated with this interface.
GetPayment() Payment
// GetPaymentIntent returns the PaymentIntent associated with this
// payment.
GetPaymentIntent() PaymentIntent
}
PaymentAndIntent is an interface that provides access to a payment and its associated payment intent.
type PaymentDuplicate ¶
type PaymentHopCustomRecord ¶
type PaymentHtlcAttempt ¶
type PaymentIntent ¶
type PaymentRouteHop ¶
type PaymentRouteHopAmp ¶
type PaymentRouteHopBlinded ¶
type PaymentRouteHopMpp ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) DeleteFailedAttempts ¶
Delete all failed HTLC attempts for the given payment. Resolution type 2 indicates a failed attempt.
func (*Queries) DeletePayment ¶
func (*Queries) FailAttempt ¶
func (q *Queries) FailAttempt(ctx context.Context, arg FailAttemptParams) error
func (*Queries) FailPayment ¶
func (*Queries) FetchAllInflightAttempts ¶
func (q *Queries) FetchAllInflightAttempts(ctx context.Context, arg FetchAllInflightAttemptsParams) ([]PaymentHtlcAttempt, error)
Fetch all inflight attempts with their payment data using pagination. Returns attempt data joined with payment and intent data to avoid separate queries.
func (*Queries) FetchHopLevelCustomRecords ¶
func (*Queries) FetchHopsForAttempts ¶
func (*Queries) FetchHtlcAttemptResolutionsForPayments ¶
func (q *Queries) FetchHtlcAttemptResolutionsForPayments(ctx context.Context, paymentIds []int64) ([]FetchHtlcAttemptResolutionsForPaymentsRow, error)
Batch query to fetch only HTLC resolution status for multiple payments. We don't need to order by payment_id and attempt_time because we will group the resolutions by payment_id in the background.
func (*Queries) FetchHtlcAttemptsForPayments ¶
func (*Queries) FetchPayment ¶
func (*Queries) FetchPaymentDuplicates ¶
func (q *Queries) FetchPaymentDuplicates(ctx context.Context, paymentID int64) ([]PaymentDuplicate, error)
Fetch all duplicate payment records from the payment_duplicates table for a given payment ID.
func (*Queries) FetchPaymentLevelFirstHopCustomRecords ¶
func (*Queries) FetchPaymentsByIDs ¶
func (q *Queries) FetchPaymentsByIDs(ctx context.Context, paymentIds []int64) ([]FetchPaymentsByIDsRow, error)
Batch fetch payment and intent data for a set of payment IDs. Used to avoid fetching redundant payment data when processing multiple attempts for the same payment.
func (*Queries) FetchPaymentsByIDsMig ¶
func (q *Queries) FetchPaymentsByIDsMig(ctx context.Context, paymentIds []int64) ([]FetchPaymentsByIDsMigRow, error)
Migration-specific batch fetch that returns payment data along with HTLC attempt counts for structural validation during KV to SQL migration.
func (*Queries) FetchRouteLevelFirstHopCustomRecords ¶
func (*Queries) FilterPayments ¶
func (q *Queries) FilterPayments(ctx context.Context, arg FilterPaymentsParams) ([]FilterPaymentsRow, error)
func (*Queries) FilterPaymentsDesc ¶
func (q *Queries) FilterPaymentsDesc(ctx context.Context, arg FilterPaymentsDescParams) ([]FilterPaymentsDescRow, error)
func (*Queries) GetTx ¶
GetTx returns the underlying DBTX (either *sql.DB or *sql.Tx) used by the Queries struct.
func (*Queries) InsertHtlcAttempt ¶
func (*Queries) InsertPayment ¶
Insert a new payment and return its ID. When creating a payment we don't have a fail reason because we start the payment process.
func (*Queries) InsertPaymentAttemptFirstHopCustomRecord ¶
func (q *Queries) InsertPaymentAttemptFirstHopCustomRecord(ctx context.Context, arg InsertPaymentAttemptFirstHopCustomRecordParams) error
func (*Queries) InsertPaymentDuplicateMig ¶
func (q *Queries) InsertPaymentDuplicateMig(ctx context.Context, arg InsertPaymentDuplicateMigParams) (int64, error)
Insert a duplicate payment record into the payment_duplicates table and return its ID.
func (*Queries) InsertPaymentFirstHopCustomRecord ¶
func (q *Queries) InsertPaymentFirstHopCustomRecord(ctx context.Context, arg InsertPaymentFirstHopCustomRecordParams) error
func (*Queries) InsertPaymentHopCustomRecord ¶
func (q *Queries) InsertPaymentHopCustomRecord(ctx context.Context, arg InsertPaymentHopCustomRecordParams) error
func (*Queries) InsertPaymentIntent ¶
func (q *Queries) InsertPaymentIntent(ctx context.Context, arg InsertPaymentIntentParams) (int64, error)
Insert a payment intent for a given payment and return its ID.
func (*Queries) InsertPaymentMig ¶
Migration-specific payment insert that allows setting fail_reason. Normal InsertPayment forces fail_reason to NULL since new payments aren't failed yet. During migration, we're inserting historical data that may already be failed.
func (*Queries) InsertRouteHop ¶
func (*Queries) InsertRouteHopAmp ¶
func (q *Queries) InsertRouteHopAmp(ctx context.Context, arg InsertRouteHopAmpParams) error
func (*Queries) InsertRouteHopBlinded ¶
func (q *Queries) InsertRouteHopBlinded(ctx context.Context, arg InsertRouteHopBlindedParams) error
func (*Queries) InsertRouteHopMpp ¶
func (q *Queries) InsertRouteHopMpp(ctx context.Context, arg InsertRouteHopMppParams) error
func (*Queries) SettleAttempt ¶
func (q *Queries) SettleAttempt(ctx context.Context, arg SettleAttemptParams) error