Documentation
¶
Index ¶
- Constants
- func IsPostgresURI(uri string) bool
- func MigrateDB(from, to *gorm.DB) error
- func NewDB(uri string, logDBQueries bool) (*gorm.DB, error)
- func NewDBWithConfig(cfg *Config) (*gorm.DB, error)
- func Stop(db *gorm.DB) error
- type App
- type AppPermission
- type Config
- type Forward
- type RequestEvent
- type ResponseEvent
- type Swap
- type Transaction
- type UserConfig
Constants ¶
View Source
const ( REQUEST_EVENT_STATE_HANDLER_EXECUTING = "executing" REQUEST_EVENT_STATE_HANDLER_EXECUTED = "executed" REQUEST_EVENT_STATE_HANDLER_ERROR = "error" )
View Source
const ( RESPONSE_EVENT_STATE_PUBLISH_CONFIRMED = "confirmed" RESPONSE_EVENT_STATE_PUBLISH_FAILED = "failed" RESPONSE_EVENT_STATE_PUBLISH_UNCONFIRMED = "unconfirmed" )
Variables ¶
This section is empty.
Functions ¶
func IsPostgresURI ¶ added in v1.14.0
func MigrateDB ¶ added in v1.24.0
MigrateDB copies all rows from one database to another. Both databases must have an up-to-date schema (they are checked against expectedTables). Orphaned request and response events are deleted from the source database before copying, as they would violate foreign key constraints in the destination database.
Types ¶
type AppPermission ¶
type RequestEvent ¶
type ResponseEvent ¶
type Swap ¶ added in v1.18.0
type Swap struct {
ID uint
SwapId string `validate:"required"`
Type string
State string
Invoice string
SendAmountSat uint64 `gorm:"column:send_amount"`
ReceiveAmountSat uint64 `gorm:"column:receive_amount"`
Preimage string
PaymentHash string
DestinationAddress string
RefundAddress string
LockupAddress string
LockupTxId string
ClaimTxId string
AutoSwap bool
UsedXpub bool
TimeoutBlockHeight uint32
BoltzPubkey string
SwapTree datatypes.JSON
CreatedAt time.Time
UpdatedAt time.Time
}
type Transaction ¶ added in v1.2.0
type Transaction struct {
ID uint
AppId *uint
App *App
RequestEventId *uint
RequestEvent *RequestEvent
Type string
State string
AmountMsat uint64
FeeMsat uint64
FeeReserveMsat uint64
PaymentRequest string
PaymentHash string
Description string
DescriptionHash string
Preimage *string
CreatedAt time.Time
ExpiresAt *time.Time
UpdatedAt time.Time
SettledAt *time.Time
Metadata datatypes.JSON
SelfPayment bool
Boostagram datatypes.JSON
FailureReason string
Hold bool
SettleDeadline *uint32 // block number for accepted hold invoices
}
Click to show internal directories.
Click to hide internal directories.