Documentation
¶
Overview ¶
Package driver provides the MigrationDriver adapter and in-process registry.
Index ¶
- type Adapter
- func (a *Adapter) Down(ctx context.Context, req Request) (Result, error)
- func (a *Adapter) Goto(ctx context.Context, req Request, target string) (Result, error)
- func (a *Adapter) Name() string
- func (a *Adapter) Status(ctx context.Context, req Request) (Status, error)
- func (a *Adapter) Up(ctx context.Context, req Request) (Result, error)
- type Driver
- type Options
- type Registry
- type Request
- type Result
- type Source
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter wraps any MigrationDriver and adds optional pre/post hooks.
func NewAdapter ¶
NewAdapter wraps a MigrationDriver in an Adapter.
type Driver ¶
type Driver = interfaces.MigrationDriver
Driver is a thin alias so callers can import from this package without directly depending on the interfaces package.
type Options ¶
type Options = interfaces.MigrationOptions
Options is an alias for interfaces.MigrationOptions.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a thread-safe in-process registry of named MigrationDrivers.
func (*Registry) MustRegister ¶
MustRegister is like Register but panics on error.
type Request ¶
type Request = interfaces.MigrationRequest
Request is an alias for interfaces.MigrationRequest.
type Result ¶
type Result = interfaces.MigrationResult
Result is an alias for interfaces.MigrationResult.
type Source ¶
type Source = interfaces.MigrationSource
Source is an alias for interfaces.MigrationSource.
type Status ¶
type Status = interfaces.MigrationStatus
Status is an alias for interfaces.MigrationStatus.