postgresql

package
v0.0.0-...-fd58d5e Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(databaseUrl string) error

func PgConnect

func PgConnect(databaseUrl string) (*pgxpool.Pool, error)

Types

type ExportedForward

type ExportedForward struct {
	Token          string
	NodeId         []byte
	ExternalNodeId []byte
	ResolvedTime   time.Time
	// Direction is 'send' if the client associated to the token sent a payment.
	// Direction is 'receive' if the client associated to the token sent a payment.
	Direction string
	// The amount forwarded to/from the external node
	AmountMsat uint64
}

type HistoryStore

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

func NewHistoryStore

func NewHistoryStore(pool *pgxpool.Pool) *HistoryStore

func (*HistoryStore) AddOpenChannelHtlc

func (s *HistoryStore) AddOpenChannelHtlc(ctx context.Context, htlc *history.OpenChannelHtlc) error

func (*HistoryStore) FetchClnForwardOffsets

func (s *HistoryStore) FetchClnForwardOffsets(
	ctx context.Context,
	nodeId []byte,
) (uint64, uint64, error)

func (*HistoryStore) FetchLndForwardOffset

func (s *HistoryStore) FetchLndForwardOffset(
	ctx context.Context,
	nodeId []byte,
) (*time.Time, error)

func (*HistoryStore) InsertForwards

func (s *HistoryStore) InsertForwards(
	ctx context.Context,
	forwards []*history.Forward,
	nodeid []byte,
) error

func (*HistoryStore) SetClnForwardOffsets

func (s *HistoryStore) SetClnForwardOffsets(
	ctx context.Context,
	nodeId []byte,
	created uint64,
	updated uint64,
) error

func (*HistoryStore) UpdateChannels

func (s *HistoryStore) UpdateChannels(
	ctx context.Context,
	updates []*history.ChannelUpdate,
) error

func (*HistoryStore) UpdateForwards

func (s *HistoryStore) UpdateForwards(
	ctx context.Context,
	forwards []*history.Forward,
	nodeid []byte,
) error

type Lsps2Store

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

func NewLsps2Store

func NewLsps2Store(pool *pgxpool.Pool) *Lsps2Store

func (*Lsps2Store) GetBuyRegistration

func (s *Lsps2Store) GetBuyRegistration(ctx context.Context, scid lightning.ShortChannelID) (*lsps2.BuyRegistration, error)

func (*Lsps2Store) RegisterBuy

func (s *Lsps2Store) RegisterBuy(
	ctx context.Context,
	req *lsps2.RegisterBuy,
) error

func (*Lsps2Store) RemoveUnusedExpired

func (s *Lsps2Store) RemoveUnusedExpired(
	ctx context.Context,
	before time.Time,
) error

func (*Lsps2Store) SavePromises

func (s *Lsps2Store) SavePromises(
	ctx context.Context,
	req *lsps2.SavePromises,
) error

func (*Lsps2Store) SetChannelOpened

func (s *Lsps2Store) SetChannelOpened(ctx context.Context, channelOpened *lsps2.ChannelOpened) error

func (*Lsps2Store) SetCompleted

func (s *Lsps2Store) SetCompleted(ctx context.Context, registrationId uuid7.UUID) error

type MigrationLogger

type MigrationLogger struct {
}

func (*MigrationLogger) Printf

func (l *MigrationLogger) Printf(format string, v ...interface{})

func (*MigrationLogger) Verbose

func (l *MigrationLogger) Verbose() bool

Verbose should return true when verbose logging output is wanted

type NotificationsStore

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

func NewNotificationsStore

func NewNotificationsStore(pool *pgxpool.Pool) *NotificationsStore

func (*NotificationsStore) GetRegistrations

func (s *NotificationsStore) GetRegistrations(
	ctx context.Context,
	pubkey string,
) ([]string, error)

func (*NotificationsStore) Register

func (s *NotificationsStore) Register(
	ctx context.Context,
	pubkey string,
	url string,
) error

func (*NotificationsStore) RemoveExpired

func (s *NotificationsStore) RemoveExpired(
	ctx context.Context,
	before time.Time,
) error

func (*NotificationsStore) Unsubscribe

func (s *NotificationsStore) Unsubscribe(
	ctx context.Context,
	pubkey string,
	url string,
) error

type OpenChannelHtlc

type OpenChannelHtlc struct {
	Nodeid             []byte
	Peerid             []byte
	ForwardAmountMsat  uint64
	OriginalAmountMsat uint64
	IncomingAmountMsat uint64
	ChannelPoint       *wire.OutPoint
}

type PostgresInterceptStore

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

func NewPostgresInterceptStore

func NewPostgresInterceptStore(pool *pgxpool.Pool) *PostgresInterceptStore

func (*PostgresInterceptStore) PaymentInfo

func (s *PostgresInterceptStore) PaymentInfo(htlcPaymentHash []byte) (string, *common.OpeningFeeParams, []byte, []byte, []byte, int64, int64, *wire.OutPoint, *string, error)

func (*PostgresInterceptStore) RegisterPayment

func (s *PostgresInterceptStore) RegisterPayment(token string, params *common.OpeningFeeParams, destination, paymentHash, paymentSecret []byte, incomingAmountMsat, outgoingAmountMsat int64, tag string) error

func (*PostgresInterceptStore) SetFundingTx

func (s *PostgresInterceptStore) SetFundingTx(paymentHash []byte, channelPoint *wire.OutPoint) error

type PostgresOpeningStore

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

func NewPostgresOpeningStore

func NewPostgresOpeningStore(pool *pgxpool.Pool) *PostgresOpeningStore

func (*PostgresOpeningStore) GetFeeParamsSettings

func (s *PostgresOpeningStore) GetFeeParamsSettings(token string) ([]*common.OpeningFeeParamsSetting, error)

type RevenueCliStore

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

func NewCliStore

func NewCliStore(pool *pgxpool.Pool) *RevenueCliStore

func (*RevenueCliStore) ExportTokenForwardsForExternalNode

func (s *RevenueCliStore) ExportTokenForwardsForExternalNode(
	ctx context.Context,
	startNs uint64,
	endNs uint64,
	node []byte,
	externalNode []byte,
) ([]*ExportedForward, error)

func (*RevenueCliStore) GetForwards

func (s *RevenueCliStore) GetForwards(
	ctx context.Context,
	startNs uint64,
	endNs uint64,
) ([]*RevenueForward, error)

Gets all settled forwards in the defined time range. Ordered by nodeid, peerid_in, amt_msat_in, resolved_time

func (*RevenueCliStore) GetOpenChannelHtlcs

func (s *RevenueCliStore) GetOpenChannelHtlcs(
	ctx context.Context,
	startNs uint64,
	endNs uint64,
) ([]*OpenChannelHtlc, error)

type RevenueForward

type RevenueForward struct {
	Identifier      string
	Nodeid          []byte
	PeeridIn        []byte
	PeeridOut       []byte
	AmtMsatIn       uint64
	AmtMsatOut      uint64
	ResolvedTime    uint64
	ChannelPointIn  wire.OutPoint
	ChannelPointOut wire.OutPoint
	SendToken       *string
	ReceiveToken    *string
	OpenChannelHtlc *OpenChannelHtlc
}

Jump to

Keyboard shortcuts

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