Previously we had db and application logic mixed on the db level. We now move the config option KeepFailedPaymentAttempts to the ChannelRouter level and move it out of the db level.
27 lines
667 B
Go
27 lines
667 B
Go
package paymentsdb
|
|
|
|
// StoreOptions holds parameters for the KVStore.
|
|
type StoreOptions struct {
|
|
// NoMigration allows to open the database in readonly mode
|
|
NoMigration bool
|
|
}
|
|
|
|
// DefaultOptions returns a StoreOptions populated with default values.
|
|
func DefaultOptions() *StoreOptions {
|
|
return &StoreOptions{
|
|
NoMigration: false,
|
|
}
|
|
}
|
|
|
|
// OptionModifier is a function signature for modifying the default
|
|
// StoreOptions.
|
|
type OptionModifier func(*StoreOptions)
|
|
|
|
// WithNoMigration allows the database to be opened in read only mode by
|
|
// disabling migrations.
|
|
func WithNoMigration(b bool) OptionModifier {
|
|
return func(o *StoreOptions) {
|
|
o.NoMigration = b
|
|
}
|
|
}
|