Documentation ¶
Overview ¶
Package dbmigrator is a generated GoMock package.
Index ¶
- type Database
- type DbMigration
- type DbMigrator
- type DbPlan
- type MockDatabase
- func (m *MockDatabase) DeleteMigrationState(arg0 context.Context, arg1 *DbMigration) error
- func (m *MockDatabase) EXPECT() *MockDatabaseMockRecorder
- func (m *MockDatabase) GetAppliedMigrations(arg0 context.Context) ([]DbMigration, error)
- func (m *MockDatabase) InsertMigrationState(arg0 context.Context, arg1 *DbMigration) error
- func (m *MockDatabase) RunCommands(arg0 context.Context, arg1 []primitive.D) error
- type MockDatabaseMockRecorder
- func (mr *MockDatabaseMockRecorder) DeleteMigrationState(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDatabaseMockRecorder) GetAppliedMigrations(arg0 interface{}) *gomock.Call
- func (mr *MockDatabaseMockRecorder) InsertMigrationState(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDatabaseMockRecorder) RunCommands(arg0, arg1 interface{}) *gomock.Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type DbMigration ¶
type DbMigration struct { Name string `bson:"name"` UpScript []bson.D `bson:"up"` DownScript []bson.D `bson:"down"` }
func GetDbMigrationsFromFs ¶
func GetDbMigrationsFromFs(fsys fs.FS) ([]DbMigration, error)
type DbMigrator ¶
type DbMigrator struct {
// contains filtered or unexported fields
}
func NewDbMigrator ¶
func NewDbMigrator(db Database, list []DbMigration) *DbMigrator
func (*DbMigrator) GetApplied ¶
func (d *DbMigrator) GetApplied(ctx context.Context) (results []DbMigration, err error)
type DbPlan ¶
type DbPlan struct { Ups []DbMigration Downs []DbMigration Total int }
type MockDatabase ¶
type MockDatabase struct {
// contains filtered or unexported fields
}
MockDatabase is a mock of Database interface.
func NewMockDatabase ¶
func NewMockDatabase(ctrl *gomock.Controller) *MockDatabase
NewMockDatabase creates a new mock instance.
func (*MockDatabase) DeleteMigrationState ¶
func (m *MockDatabase) DeleteMigrationState(arg0 context.Context, arg1 *DbMigration) error
DeleteMigrationState mocks base method.
func (*MockDatabase) EXPECT ¶
func (m *MockDatabase) EXPECT() *MockDatabaseMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDatabase) GetAppliedMigrations ¶
func (m *MockDatabase) GetAppliedMigrations(arg0 context.Context) ([]DbMigration, error)
GetAppliedMigrations mocks base method.
func (*MockDatabase) InsertMigrationState ¶
func (m *MockDatabase) InsertMigrationState(arg0 context.Context, arg1 *DbMigration) error
InsertMigrationState mocks base method.
func (*MockDatabase) RunCommands ¶
RunCommands mocks base method.
type MockDatabaseMockRecorder ¶
type MockDatabaseMockRecorder struct {
// contains filtered or unexported fields
}
MockDatabaseMockRecorder is the mock recorder for MockDatabase.
func (*MockDatabaseMockRecorder) DeleteMigrationState ¶
func (mr *MockDatabaseMockRecorder) DeleteMigrationState(arg0, arg1 interface{}) *gomock.Call
DeleteMigrationState indicates an expected call of DeleteMigrationState.
func (*MockDatabaseMockRecorder) GetAppliedMigrations ¶
func (mr *MockDatabaseMockRecorder) GetAppliedMigrations(arg0 interface{}) *gomock.Call
GetAppliedMigrations indicates an expected call of GetAppliedMigrations.
func (*MockDatabaseMockRecorder) InsertMigrationState ¶
func (mr *MockDatabaseMockRecorder) InsertMigrationState(arg0, arg1 interface{}) *gomock.Call
InsertMigrationState indicates an expected call of InsertMigrationState.
func (*MockDatabaseMockRecorder) RunCommands ¶
func (mr *MockDatabaseMockRecorder) RunCommands(arg0, arg1 interface{}) *gomock.Call
RunCommands indicates an expected call of RunCommands.