Documentation
¶
Index ¶
- Variables
- type Invoice
- type InvoiceCreationData
- type InvoiceState
- type PostgresPersister
- func (p *PostgresPersister) Close() error
- func (p *PostgresPersister) Get(ctx context.Context, hash lntypes.Hash) (*Invoice, map[types.HtlcKey]int64, error)
- func (p *PostgresPersister) GetInvoices(ctx context.Context, maxInvoicesCount, sequenceStart int) ([]*Invoice, error)
- func (p *PostgresPersister) MarkHtlcSettled(ctx context.Context, key types.HtlcKey) (bool, error)
- func (p *PostgresPersister) Ping(ctx context.Context) error
- func (p *PostgresPersister) RequestSettle(ctx context.Context, invoice *InvoiceCreationData, ...) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrHtlcAlreadySettled = errors.New("htlc already settled")
Functions ¶
This section is empty.
Types ¶
type InvoiceCreationData ¶
type InvoiceCreationData struct {
types.InvoiceCreationData
}
type InvoiceState ¶
type InvoiceState int
const ( InvoiceStateAccepted InvoiceState = iota InvoiceStateSettleRequested )
type PostgresPersister ¶
type PostgresPersister struct {
// contains filtered or unexported fields
}
PostgresPersister persists items to Postgres
func NewPostgresPersisterFromDSN ¶
func NewPostgresPersisterFromDSN(dsn string, logger *zap.SugaredLogger) ( *PostgresPersister, error)
NewPostgresPersisterFromDSN creates a new PostgresPersister using the dsn provided
func NewPostgresPersisterFromOptions ¶
func NewPostgresPersisterFromOptions(options *pg.Options, logger *zap.SugaredLogger) *PostgresPersister
NewPostgresPersisterFromOptions creates a new PostgresPersister using the options provided
func (*PostgresPersister) Close ¶
func (p *PostgresPersister) Close() error
func (*PostgresPersister) GetInvoices ¶
func (*PostgresPersister) MarkHtlcSettled ¶
func (*PostgresPersister) Ping ¶
func (p *PostgresPersister) Ping(ctx context.Context) error
Ping pings the database connection to ensure it is available
func (*PostgresPersister) RequestSettle ¶
func (p *PostgresPersister) RequestSettle(ctx context.Context, invoice *InvoiceCreationData, htlcs map[types.HtlcKey]int64) error
Click to show internal directories.
Click to hide internal directories.