sqlc

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmpSubInvoice

type AmpSubInvoice struct {
	SetID       []byte
	State       int16
	CreatedAt   time.Time
	SettledAt   sql.NullTime
	SettleIndex sql.NullInt64
	InvoiceID   int64
}

type AmpSubInvoiceHtlc

type AmpSubInvoiceHtlc struct {
	InvoiceID  int64
	SetID      []byte
	HtlcID     int64
	RootShare  []byte
	ChildIndex int64
	Hash       []byte
	Preimage   []byte
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteInvoiceParams

type DeleteInvoiceParams struct {
	AddIndex    sql.NullInt64
	Hash        []byte
	SettleIndex sql.NullInt64
	PaymentAddr []byte
}

type FetchAMPSubInvoiceHTLCsParams

type FetchAMPSubInvoiceHTLCsParams struct {
	InvoiceID int64
	SetID     []byte
}

type FetchAMPSubInvoiceHTLCsRow

type FetchAMPSubInvoiceHTLCsRow struct {
	SetID        []byte
	RootShare    []byte
	ChildIndex   int64
	Hash         []byte
	Preimage     []byte
	ID           int64
	ChanID       string
	HtlcID       int64
	AmountMsat   int64
	TotalMppMsat sql.NullInt64
	AcceptHeight int32
	AcceptTime   time.Time
	ExpiryHeight int32
	State        int16
	ResolveTime  sql.NullTime
	InvoiceID    int64
}

type FetchAMPSubInvoicesParams

type FetchAMPSubInvoicesParams struct {
	InvoiceID int64
	SetID     []byte
}

type FetchSettledAMPSubInvoicesParams

type FetchSettledAMPSubInvoicesParams struct {
	SettleIndexGet sql.NullInt64
	SettleIndexLet sql.NullInt64
}

type FetchSettledAMPSubInvoicesRow

type FetchSettledAMPSubInvoicesRow struct {
	SetID              []byte
	AmpSettleIndex     sql.NullInt64
	AmpSettledAt       sql.NullTime
	ID                 int64
	Hash               []byte
	Preimage           []byte
	SettleIndex        sql.NullInt64
	SettledAt          sql.NullTime
	Memo               sql.NullString
	AmountMsat         int64
	CltvDelta          sql.NullInt32
	Expiry             int32
	PaymentAddr        []byte
	PaymentRequest     sql.NullString
	PaymentRequestHash []byte
	State              int16
	AmountPaidMsat     int64
	IsAmp              bool
	IsHodl             bool
	IsKeysend          bool
	CreatedAt          time.Time
}

type FilterInvoicesParams

type FilterInvoicesParams struct {
	AddIndexGet    sql.NullInt64
	AddIndexLet    sql.NullInt64
	SettleIndexGet sql.NullInt64
	SettleIndexLet sql.NullInt64
	State          sql.NullInt16
	CreatedAfter   sql.NullTime
	CreatedBefore  sql.NullTime
	PendingOnly    interface{}
	Reverse        interface{}
	NumOffset      int32
	NumLimit       int32
}

type GetInvoiceHTLCCustomRecordsRow

type GetInvoiceHTLCCustomRecordsRow struct {
	HtlcID int64
	Key    int64
	Value  []byte
}

type GetInvoiceParams

type GetInvoiceParams struct {
	AddIndex    sql.NullInt64
	Hash        []byte
	Preimage    []byte
	PaymentAddr []byte
	SetID       []byte
}

type InsertAMPSubInvoiceHTLCParams

type InsertAMPSubInvoiceHTLCParams struct {
	InvoiceID  int64
	SetID      []byte
	HtlcID     int64
	RootShare  []byte
	ChildIndex int64
	Hash       []byte
	Preimage   []byte
}

type InsertInvoiceFeatureParams

type InsertInvoiceFeatureParams struct {
	InvoiceID int64
	Feature   int32
}

type InsertInvoiceHTLCCustomRecordParams

type InsertInvoiceHTLCCustomRecordParams struct {
	Key    int64
	Value  []byte
	HtlcID int64
}

type InsertInvoiceHTLCParams

type InsertInvoiceHTLCParams struct {
	HtlcID       int64
	ChanID       string
	AmountMsat   int64
	TotalMppMsat sql.NullInt64
	AcceptHeight int32
	AcceptTime   time.Time
	ExpiryHeight int32
	State        int16
	ResolveTime  sql.NullTime
	InvoiceID    int64
}

type InsertInvoiceParams

type InsertInvoiceParams struct {
	Hash               []byte
	Preimage           []byte
	Memo               sql.NullString
	AmountMsat         int64
	CltvDelta          sql.NullInt32
	Expiry             int32
	PaymentAddr        []byte
	PaymentRequest     sql.NullString
	PaymentRequestHash []byte
	State              int16
	AmountPaidMsat     int64
	IsAmp              bool
	IsHodl             bool
	IsKeysend          bool
	CreatedAt          time.Time
}

type Invoice

type Invoice struct {
	ID                 int64
	Hash               []byte
	Preimage           []byte
	SettleIndex        sql.NullInt64
	SettledAt          sql.NullTime
	Memo               sql.NullString
	AmountMsat         int64
	CltvDelta          sql.NullInt32
	Expiry             int32
	PaymentAddr        []byte
	PaymentRequest     sql.NullString
	PaymentRequestHash []byte
	State              int16
	AmountPaidMsat     int64
	IsAmp              bool
	IsHodl             bool
	IsKeysend          bool
	CreatedAt          time.Time
}

type InvoiceEvent

type InvoiceEvent struct {
	ID        int64
	AddedAt   time.Time
	EventType int32
	InvoiceID int64
	SetID     []byte
}

type InvoiceEventType

type InvoiceEventType struct {
	ID          int32
	Description string
}

type InvoiceFeature

type InvoiceFeature struct {
	Feature   int32
	InvoiceID int64
}

type InvoiceHtlc

type InvoiceHtlc struct {
	ID           int64
	ChanID       string
	HtlcID       int64
	AmountMsat   int64
	TotalMppMsat sql.NullInt64
	AcceptHeight int32
	AcceptTime   time.Time
	ExpiryHeight int32
	State        int16
	ResolveTime  sql.NullTime
	InvoiceID    int64
}

type InvoiceHtlcCustomRecord

type InvoiceHtlcCustomRecord struct {
	Key    int64
	Value  []byte
	HtlcID int64
}

type InvoiceSequence

type InvoiceSequence struct {
	Name         string
	CurrentValue int64
}

type OnAMPSubInvoiceCanceledParams

type OnAMPSubInvoiceCanceledParams struct {
	AddedAt   time.Time
	InvoiceID int64
	SetID     []byte
}

type OnAMPSubInvoiceCreatedParams

type OnAMPSubInvoiceCreatedParams struct {
	AddedAt   time.Time
	InvoiceID int64
	SetID     []byte
}

type OnAMPSubInvoiceSettledParams

type OnAMPSubInvoiceSettledParams struct {
	AddedAt   time.Time
	InvoiceID int64
	SetID     []byte
}

type OnInvoiceCanceledParams

type OnInvoiceCanceledParams struct {
	AddedAt   time.Time
	InvoiceID int64
}

type OnInvoiceCreatedParams

type OnInvoiceCreatedParams struct {
	AddedAt   time.Time
	InvoiceID int64
}

type OnInvoiceSettledParams

type OnInvoiceSettledParams struct {
	AddedAt   time.Time
	InvoiceID int64
}

type Querier

type Querier interface {
	DeleteCanceledInvoices(ctx context.Context) (sql.Result, error)
	DeleteInvoice(ctx context.Context, arg DeleteInvoiceParams) (sql.Result, error)
	FetchAMPSubInvoiceHTLCs(ctx context.Context, arg FetchAMPSubInvoiceHTLCsParams) ([]FetchAMPSubInvoiceHTLCsRow, error)
	FetchAMPSubInvoices(ctx context.Context, arg FetchAMPSubInvoicesParams) ([]AmpSubInvoice, error)
	FetchSettledAMPSubInvoices(ctx context.Context, arg FetchSettledAMPSubInvoicesParams) ([]FetchSettledAMPSubInvoicesRow, error)
	FilterInvoices(ctx context.Context, arg FilterInvoicesParams) ([]Invoice, error)
	GetAMPInvoiceID(ctx context.Context, setID []byte) (int64, error)
	// This method may return more than one invoice if filter using multiple fields
	// from different invoices. It is the caller's responsibility to ensure that
	// we bubble up an error in those cases.
	GetInvoice(ctx context.Context, arg GetInvoiceParams) ([]Invoice, error)
	GetInvoiceFeatures(ctx context.Context, invoiceID int64) ([]InvoiceFeature, error)
	GetInvoiceHTLCCustomRecords(ctx context.Context, invoiceID int64) ([]GetInvoiceHTLCCustomRecordsRow, error)
	GetInvoiceHTLCs(ctx context.Context, invoiceID int64) ([]InvoiceHtlc, error)
	InsertAMPSubInvoiceHTLC(ctx context.Context, arg InsertAMPSubInvoiceHTLCParams) error
	InsertInvoice(ctx context.Context, arg InsertInvoiceParams) (int64, error)
	InsertInvoiceFeature(ctx context.Context, arg InsertInvoiceFeatureParams) error
	InsertInvoiceHTLC(ctx context.Context, arg InsertInvoiceHTLCParams) (int64, error)
	InsertInvoiceHTLCCustomRecord(ctx context.Context, arg InsertInvoiceHTLCCustomRecordParams) error
	NextInvoiceSettleIndex(ctx context.Context) (int64, error)
	OnAMPSubInvoiceCanceled(ctx context.Context, arg OnAMPSubInvoiceCanceledParams) error
	OnAMPSubInvoiceCreated(ctx context.Context, arg OnAMPSubInvoiceCreatedParams) error
	OnAMPSubInvoiceSettled(ctx context.Context, arg OnAMPSubInvoiceSettledParams) error
	OnInvoiceCanceled(ctx context.Context, arg OnInvoiceCanceledParams) error
	OnInvoiceCreated(ctx context.Context, arg OnInvoiceCreatedParams) error
	OnInvoiceSettled(ctx context.Context, arg OnInvoiceSettledParams) error
	UpdateAMPSubInvoiceHTLCPreimage(ctx context.Context, arg UpdateAMPSubInvoiceHTLCPreimageParams) (sql.Result, error)
	UpdateAMPSubInvoiceState(ctx context.Context, arg UpdateAMPSubInvoiceStateParams) error
	UpdateInvoiceAmountPaid(ctx context.Context, arg UpdateInvoiceAmountPaidParams) (sql.Result, error)
	UpdateInvoiceHTLC(ctx context.Context, arg UpdateInvoiceHTLCParams) error
	UpdateInvoiceHTLCs(ctx context.Context, arg UpdateInvoiceHTLCsParams) error
	UpdateInvoiceState(ctx context.Context, arg UpdateInvoiceStateParams) (sql.Result, error)
	UpsertAMPSubInvoice(ctx context.Context, arg UpsertAMPSubInvoiceParams) (sql.Result, error)
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) DeleteCanceledInvoices

func (q *Queries) DeleteCanceledInvoices(ctx context.Context) (sql.Result, error)

func (*Queries) DeleteInvoice

func (q *Queries) DeleteInvoice(ctx context.Context, arg DeleteInvoiceParams) (sql.Result, error)

func (*Queries) FetchAMPSubInvoiceHTLCs

func (q *Queries) FetchAMPSubInvoiceHTLCs(ctx context.Context, arg FetchAMPSubInvoiceHTLCsParams) ([]FetchAMPSubInvoiceHTLCsRow, error)

func (*Queries) FetchAMPSubInvoices

func (q *Queries) FetchAMPSubInvoices(ctx context.Context, arg FetchAMPSubInvoicesParams) ([]AmpSubInvoice, error)

func (*Queries) FetchSettledAMPSubInvoices

func (q *Queries) FetchSettledAMPSubInvoices(ctx context.Context, arg FetchSettledAMPSubInvoicesParams) ([]FetchSettledAMPSubInvoicesRow, error)

func (*Queries) FilterInvoices

func (q *Queries) FilterInvoices(ctx context.Context, arg FilterInvoicesParams) ([]Invoice, error)

func (*Queries) GetAMPInvoiceID

func (q *Queries) GetAMPInvoiceID(ctx context.Context, setID []byte) (int64, error)

func (*Queries) GetInvoice

func (q *Queries) GetInvoice(ctx context.Context, arg GetInvoiceParams) ([]Invoice, error)

This method may return more than one invoice if filter using multiple fields from different invoices. It is the caller's responsibility to ensure that we bubble up an error in those cases.

func (*Queries) GetInvoiceFeatures

func (q *Queries) GetInvoiceFeatures(ctx context.Context, invoiceID int64) ([]InvoiceFeature, error)

func (*Queries) GetInvoiceHTLCCustomRecords

func (q *Queries) GetInvoiceHTLCCustomRecords(ctx context.Context, invoiceID int64) ([]GetInvoiceHTLCCustomRecordsRow, error)

func (*Queries) GetInvoiceHTLCs

func (q *Queries) GetInvoiceHTLCs(ctx context.Context, invoiceID int64) ([]InvoiceHtlc, error)

func (*Queries) InsertAMPSubInvoiceHTLC

func (q *Queries) InsertAMPSubInvoiceHTLC(ctx context.Context, arg InsertAMPSubInvoiceHTLCParams) error

func (*Queries) InsertInvoice

func (q *Queries) InsertInvoice(ctx context.Context, arg InsertInvoiceParams) (int64, error)

func (*Queries) InsertInvoiceFeature

func (q *Queries) InsertInvoiceFeature(ctx context.Context, arg InsertInvoiceFeatureParams) error

func (*Queries) InsertInvoiceHTLC

func (q *Queries) InsertInvoiceHTLC(ctx context.Context, arg InsertInvoiceHTLCParams) (int64, error)

func (*Queries) InsertInvoiceHTLCCustomRecord

func (q *Queries) InsertInvoiceHTLCCustomRecord(ctx context.Context, arg InsertInvoiceHTLCCustomRecordParams) error

func (*Queries) NextInvoiceSettleIndex

func (q *Queries) NextInvoiceSettleIndex(ctx context.Context) (int64, error)

func (*Queries) OnAMPSubInvoiceCanceled

func (q *Queries) OnAMPSubInvoiceCanceled(ctx context.Context, arg OnAMPSubInvoiceCanceledParams) error

func (*Queries) OnAMPSubInvoiceCreated

func (q *Queries) OnAMPSubInvoiceCreated(ctx context.Context, arg OnAMPSubInvoiceCreatedParams) error

func (*Queries) OnAMPSubInvoiceSettled

func (q *Queries) OnAMPSubInvoiceSettled(ctx context.Context, arg OnAMPSubInvoiceSettledParams) error

func (*Queries) OnInvoiceCanceled

func (q *Queries) OnInvoiceCanceled(ctx context.Context, arg OnInvoiceCanceledParams) error

func (*Queries) OnInvoiceCreated

func (q *Queries) OnInvoiceCreated(ctx context.Context, arg OnInvoiceCreatedParams) error

func (*Queries) OnInvoiceSettled

func (q *Queries) OnInvoiceSettled(ctx context.Context, arg OnInvoiceSettledParams) error

func (*Queries) UpdateAMPSubInvoiceHTLCPreimage

func (q *Queries) UpdateAMPSubInvoiceHTLCPreimage(ctx context.Context, arg UpdateAMPSubInvoiceHTLCPreimageParams) (sql.Result, error)

func (*Queries) UpdateAMPSubInvoiceState

func (q *Queries) UpdateAMPSubInvoiceState(ctx context.Context, arg UpdateAMPSubInvoiceStateParams) error

func (*Queries) UpdateInvoiceAmountPaid

func (q *Queries) UpdateInvoiceAmountPaid(ctx context.Context, arg UpdateInvoiceAmountPaidParams) (sql.Result, error)

func (*Queries) UpdateInvoiceHTLC

func (q *Queries) UpdateInvoiceHTLC(ctx context.Context, arg UpdateInvoiceHTLCParams) error

func (*Queries) UpdateInvoiceHTLCs

func (q *Queries) UpdateInvoiceHTLCs(ctx context.Context, arg UpdateInvoiceHTLCsParams) error

func (*Queries) UpdateInvoiceState

func (q *Queries) UpdateInvoiceState(ctx context.Context, arg UpdateInvoiceStateParams) (sql.Result, error)

func (*Queries) UpsertAMPSubInvoice

func (q *Queries) UpsertAMPSubInvoice(ctx context.Context, arg UpsertAMPSubInvoiceParams) (sql.Result, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type UpdateAMPSubInvoiceHTLCPreimageParams

type UpdateAMPSubInvoiceHTLCPreimageParams struct {
	InvoiceID int64
	SetID     []byte
	HtlcID    int64
	Preimage  []byte
}

type UpdateAMPSubInvoiceStateParams

type UpdateAMPSubInvoiceStateParams struct {
	SetID       []byte
	State       int16
	SettleIndex sql.NullInt64
	SettledAt   sql.NullTime
}

type UpdateInvoiceAmountPaidParams

type UpdateInvoiceAmountPaidParams struct {
	ID             int64
	AmountPaidMsat int64
}

type UpdateInvoiceHTLCParams

type UpdateInvoiceHTLCParams struct {
	HtlcID      int64
	ChanID      string
	InvoiceID   int64
	State       int16
	ResolveTime sql.NullTime
}

type UpdateInvoiceHTLCsParams

type UpdateInvoiceHTLCsParams struct {
	InvoiceID   int64
	State       int16
	ResolveTime sql.NullTime
}

type UpdateInvoiceStateParams

type UpdateInvoiceStateParams struct {
	ID          int64
	State       int16
	Preimage    []byte
	SettleIndex sql.NullInt64
	SettledAt   sql.NullTime
}

type UpsertAMPSubInvoiceParams

type UpsertAMPSubInvoiceParams struct {
	SetID     []byte
	State     int16
	CreatedAt time.Time
	InvoiceID int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL