Documentation
¶
Index ¶
- func BackfillIntentTxid(ctx context.Context, dbh *sql.DB) error
- func BackfillVtxoMarkers(ctx context.Context, dbh *sql.DB) (err error)
- func NewAssetRepository(config ...interface{}) (domain.AssetRepository, error)
- func NewConvictionRepository(config ...interface{}) (domain.ConvictionRepository, error)
- func NewEventRepository(config ...interface{}) (domain.EventRepository, error)
- func NewMarkerRepository(config ...interface{}) (domain.MarkerRepository, error)
- func NewOffchainTxRepository(config ...interface{}) (domain.OffchainTxRepository, error)
- func NewRoundRepository(config ...interface{}) (domain.RoundRepository, error)
- func NewSettingsRepository(config ...interface{}) (domain.SettingsRepository, error)
- func NewVtxoRepository(config ...interface{}) (domain.VtxoRepository, error)
- func OpenDb(dsn string, autoCreate bool, opts ...Option) (*sql.DB, error)
- func SeedSettings(ctx context.Context, db *sql.DB, defaults domain.Settings) (err error)
- type ConnectionConfig
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackfillIntentTxid ¶ added in v0.9.0
func BackfillVtxoMarkers ¶ added in v0.9.14
BackfillVtxoMarkers rebuilds the vtxo marker DAG (real BFS depths + boundary markers) in a single transaction. It preserves swept status by copying every currently-swept outpoint into swept_vtxo before clearing and rebuilding the markers, and verifies the swept count is unchanged (before == after) else rolls back the whole thing. The data guard makes it idempotent: a completed run is a no-op, an interrupted (rolled-back) run re-runs.
func NewAssetRepository ¶ added in v0.9.0
func NewAssetRepository(config ...interface{}) (domain.AssetRepository, error)
func NewConvictionRepository ¶ added in v0.8.0
func NewConvictionRepository(config ...interface{}) (domain.ConvictionRepository, error)
func NewEventRepository ¶
func NewEventRepository(config ...interface{}) (domain.EventRepository, error)
func NewMarkerRepository ¶ added in v0.9.14
func NewMarkerRepository(config ...interface{}) (domain.MarkerRepository, error)
func NewOffchainTxRepository ¶
func NewOffchainTxRepository(config ...interface{}) (domain.OffchainTxRepository, error)
func NewRoundRepository ¶
func NewRoundRepository(config ...interface{}) (domain.RoundRepository, error)
func NewSettingsRepository ¶ added in v0.9.9
func NewSettingsRepository(config ...interface{}) (domain.SettingsRepository, error)
func NewVtxoRepository ¶
func NewVtxoRepository(config ...interface{}) (domain.VtxoRepository, error)
func OpenDb ¶
OpenDb opens a connection with the DB.
By default, it uses sensible connection pool settings. These can be optionally overridden by providing a WithConnectionConfig option.
If the operation fails when trying to establish a connection and the `autoCreate` flag is set to true, OpenDb will try to create the database specified in the DSN.
func SeedSettings ¶ added in v0.9.9
SeedSettings seeds the singleton settings row from the config-built defaults on first boot, carrying over any legacy intent_fees / scheduled_session rows, then deletes those legacy rows. It runs at most once: after the settings row exists it returns immediately without touching anything (so it never clobbers admin changes).
Everything runs in one raw transaction so a crash rolls back cleanly, leaving the legacy data intact for the next boot. The write goes through the generated UpsertSettings (not the repo's public Upsert) to deliberately bypass the repo's update dispatch and settings_history audit — this is init, not a user change.
Types ¶
type ConnectionConfig ¶ added in v0.9.4
type Option ¶ added in v0.9.4
type Option func(*ConnectionConfig)
func WithConnectionConfig ¶ added in v0.9.4
func WithConnectionConfig(cfg ConnectionConfig) Option