Documentation ¶
Index ¶
- Constants
- type Change
- type ChangeFile
- type ChangeLog
- type ChangeSet
- type ChangeSetApplyStrategy
- type ChangeSetFile
- type ChangeSetProcessor
- type ChangeSetSource
- type DocumentApplier
- type DummyMigration
- type LimitCounter
- type Migration
- type MigrationExtractor
- type MigrationFile
- type MultipleMigration
- type SimpleMigration
- type SimulatedTransaction
- type Transaction
- type TransactionFactory
- func NewDummyTransactionFactory(log logs.Logger) TransactionFactory
- func NewRollbackSimulatedTransactionFactory(dbChanger DocumentApplier, transactionRecFactory TransactionRecordFactory, ...) (TransactionFactory, custom_error.CustomError)
- func NewSimulatedTransactionFactory(dbChanger DocumentApplier, transactionRecFactory TransactionRecordFactory, ...) (TransactionFactory, custom_error.CustomError)
- type TransactionRecordFactory
Constants ¶
View Source
const (
COLLECTION_NAME_MIGRATIONS_LOG = "mongol_migrations_3710611845fe4161b74d2ec5eafe9124"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Change ¶
func NewChange ¶
func NewChange(c *ChangeFile, workingDir string, changelogPath string, id string) (*Change, custom_error.CustomError)
type ChangeFile ¶
type ChangeFile struct { Forward []*MigrationFile `json:"migration"` Backward []*MigrationFile `json:"rollback,omitempty"` }
func (*ChangeFile) UnmarshalJSON ¶ added in v0.2.2
func (c *ChangeFile) UnmarshalJSON(data []byte) error
type ChangeLog ¶
type ChangeLog interface { GetConnectionString() string GetDBName() string GetChangeSets() []*ChangeSet GetChangeSetSource() ChangeSetSource Apply(processor ChangeSetProcessor) custom_error.CustomError }
func NewChangeLog ¶
func NewChangeLog(path string) (ChangeLog, custom_error.CustomError)
func NewRollbackChangeLog ¶
func NewRollbackChangeLog(path string) (ChangeLog, custom_error.CustomError)
type ChangeSetApplyStrategy ¶
type ChangeSetApplyStrategy func(sets []*ChangeSet, processor ChangeSetProcessor) custom_error.CustomError
type ChangeSetFile ¶
type ChangeSetFile struct { ID string `json:"id"` Changes []ChangeFile `json:"changes,omitempty"` }
type ChangeSetProcessor ¶
type ChangeSetProcessor interface {
Process(changeSet *ChangeSet) custom_error.CustomError
}
func NewChangeSetApplier ¶
func NewChangeSetApplier(startTransaction TransactionFactory) (ChangeSetProcessor, custom_error.CustomError)
func NewRollbackChangeSetApplier ¶
func NewRollbackChangeSetApplier(startTransaction TransactionFactory) (ChangeSetProcessor, custom_error.CustomError)
type ChangeSetSource ¶
type ChangeSetSource interface {
Apply(processor ChangeSetProcessor) custom_error.CustomError
}
func NewArrayChangeLog ¶
func NewArrayChangeLog(changeSets []*ChangeSet) (ChangeSetSource, custom_error.CustomError)
type DocumentApplier ¶
type DocumentApplier interface {
Apply(value interface{}) custom_error.CustomError
}
type DummyMigration ¶
type DummyMigration struct { }
func (*DummyMigration) Apply ¶
func (d *DummyMigration) Apply(visitor DocumentApplier) custom_error.CustomError
type LimitCounter ¶
type LimitCounter interface { Get() int64 Dec() }
type Migration ¶
type Migration interface {
Apply(visitor DocumentApplier) custom_error.CustomError
}
func NewMigration ¶
func NewMigration(m *MigrationFile, workingDir string, changelogPath string, hash hash.Hash) (Migration, custom_error.CustomError)
func NewMultiMigration ¶ added in v0.2.2
func NewMultiMigration(m []*MigrationFile, workingDir string, changelogPath string, hash hash.Hash) (Migration, custom_error.CustomError)
type MigrationExtractor ¶
type MigrationFile ¶
type MultipleMigration ¶ added in v0.2.2
type MultipleMigration struct {
// contains filtered or unexported fields
}
func (*MultipleMigration) Apply ¶ added in v0.2.2
func (s *MultipleMigration) Apply(visitor DocumentApplier) custom_error.CustomError
type SimpleMigration ¶
type SimpleMigration struct {
// contains filtered or unexported fields
}
func (*SimpleMigration) Apply ¶
func (s *SimpleMigration) Apply(visitor DocumentApplier) custom_error.CustomError
type SimulatedTransaction ¶
type SimulatedTransaction struct {
// contains filtered or unexported fields
}
func (*SimulatedTransaction) Apply ¶
func (t *SimulatedTransaction) Apply(change *Change) custom_error.CustomError
func (*SimulatedTransaction) Commit ¶
func (t *SimulatedTransaction) Commit() custom_error.CustomError
func (*SimulatedTransaction) Rollback ¶
func (t *SimulatedTransaction) Rollback() custom_error.CustomError
type Transaction ¶
type Transaction interface { Commit() custom_error.CustomError Apply(changeSet *Change) custom_error.CustomError Rollback() custom_error.CustomError }
type TransactionFactory ¶
type TransactionFactory func(changeID string) (Transaction, custom_error.CustomError)
func NewDummyTransactionFactory ¶
func NewDummyTransactionFactory(log logs.Logger) TransactionFactory
func NewRollbackSimulatedTransactionFactory ¶
func NewRollbackSimulatedTransactionFactory(dbChanger DocumentApplier, transactionRecFactory TransactionRecordFactory, appliedChanges map[string]struct{}, maxChanges int64, log logs.Logger) (TransactionFactory, custom_error.CustomError)
func NewSimulatedTransactionFactory ¶
func NewSimulatedTransactionFactory(dbChanger DocumentApplier, transactionRecFactory TransactionRecordFactory, appliedChanges map[string]struct{}, maxChanges int64, log logs.Logger) (TransactionFactory, custom_error.CustomError)
type TransactionRecordFactory ¶
type TransactionRecordFactory func(changeID string, hashValue string) (interface{}, custom_error.CustomError)
func NewRollbackTransactionRecordFactory ¶
func NewRollbackTransactionRecordFactory(collectionName string) TransactionRecordFactory
func NewTransactionRecordFactory ¶
func NewTransactionRecordFactory(collectionName string) TransactionRecordFactory
Source Files ¶
Click to show internal directories.
Click to hide internal directories.