Documentation
¶
Overview ¶
Package deprecatedmigration contains the legacy migration system.
Deprecated: This package is deprecated and will be removed in a future version. Use the migration package instead for new migrations.
Index ¶
- Variables
- func MigrateIfNeeded(ctx context.Context, targetDB db.KeyValueStore, network *utils.Network, ...) error
- func SchemaMetadata(log utils.SimpleLogger, targetDB db.KeyValueStore) (schemaMetadata, error)
- type BucketMigrator
- func (m *BucketMigrator) Before(_ []byte) error
- func (m *BucketMigrator) Migrate(ctx context.Context, database db.KeyValueStore, network *utils.Network, ...) ([]byte, error)
- func (m *BucketMigrator) WithBatchSize(batchSize uint) *BucketMigrator
- func (m *BucketMigrator) WithBefore(before func()) *BucketMigrator
- func (m *BucketMigrator) WithKeyFilter(keyFilter BucketMigratorKeyFilter) *BucketMigrator
- type BucketMigratorDoFunc
- type BucketMigratorKeyFilter
- type HTTPConfig
- type Migration
- type MigrationFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCallWithNewTransaction = errors.New("call with new transaction")
Functions ¶
func MigrateIfNeeded ¶
func MigrateIfNeeded( ctx context.Context, targetDB db.KeyValueStore, network *utils.Network, log utils.SimpleLogger, ) error
func SchemaMetadata ¶
func SchemaMetadata(log utils.SimpleLogger, targetDB db.KeyValueStore) (schemaMetadata, error)
SchemaMetadata retrieves metadata about a database schema from the given database.
Types ¶
type BucketMigrator ¶
type BucketMigrator struct {
// contains filtered or unexported fields
}
func NewBucketMigrator ¶
func NewBucketMigrator(target db.Bucket, do BucketMigratorDoFunc) *BucketMigrator
func NewBucketMover ¶
func NewBucketMover(source, destination db.Bucket) *BucketMigrator
func (*BucketMigrator) Before ¶
func (m *BucketMigrator) Before(_ []byte) error
func (*BucketMigrator) Migrate ¶
func (m *BucketMigrator) Migrate( ctx context.Context, database db.KeyValueStore, network *utils.Network, log utils.SimpleLogger, ) ([]byte, error)
func (*BucketMigrator) WithBatchSize ¶
func (m *BucketMigrator) WithBatchSize(batchSize uint) *BucketMigrator
func (*BucketMigrator) WithBefore ¶
func (m *BucketMigrator) WithBefore(before func()) *BucketMigrator
func (*BucketMigrator) WithKeyFilter ¶
func (m *BucketMigrator) WithKeyFilter(keyFilter BucketMigratorKeyFilter) *BucketMigrator
type BucketMigratorDoFunc ¶
type BucketMigratorKeyFilter ¶
type HTTPConfig ¶
type MigrationFunc ¶
type MigrationFunc func(db.IndexedBatch, *utils.Network) error
func (MigrationFunc) Migrate ¶
func (f MigrationFunc) Migrate(_ context.Context, database db.KeyValueStore, network *utils.Network, _ utils.SimpleLogger) ([]byte, error)
Migrate returns f(txn).
Click to show internal directories.
Click to hide internal directories.