Documentation ¶
Index ¶
- func CreateNewMigrationFile(name string, destination string) (string, error)
- func GetMigrationNameFromConfigName(filePath string) string
- type Config
- type ConfigLeaf
- type ConfigLeaves
- type Convert
- type Destroy
- type Down
- type EtcdMigrationTarget
- func (emt *EtcdMigrationTarget) Debug()
- func (emt *EtcdMigrationTarget) DeleteApplication() error
- func (emt *EtcdMigrationTarget) DeleteEnvironment() error
- func (emt *EtcdMigrationTarget) Get(path string) (string, error)
- func (emt *EtcdMigrationTarget) GetAll() map[string]string
- func (emt *EtcdMigrationTarget) GetApplication() string
- func (emt *EtcdMigrationTarget) GetEnvironment() string
- func (emt *EtcdMigrationTarget) GetLogger() ILogger
- func (emt *EtcdMigrationTarget) GetMigrationTip() (*Migration, error)
- func (emt *EtcdMigrationTarget) GetStatus() (*MigrationState, error)
- func (emt *EtcdMigrationTarget) IsPerformingFullMigration() bool
- func (emt *EtcdMigrationTarget) Set(path string, value string) error
- func (emt *EtcdMigrationTarget) SetStatus(state *MigrationState) error
- type ILogger
- type Migration
- func NewMigrationFromConfig(name string, config *Config) (*Migration, error)
- func NewMigrationFromConfigFile(filePath string, fileNameIsEnvironment bool, jsonEncode bool) (*Migration, error)
- func NewMigrationFromGull(name string, source string) (*Migration, error)
- func NewMigrationFromGullFile(filePath string) (*Migration, error)
- type MigrationState
- type MigrationTarget
- type Migrations
- func (m *Migrations) Add(migration *Migration) error
- func (m *Migrations) Apply(target MigrationTarget) error
- func (m *Migrations) First() (*Migration, error)
- func (m *Migrations) Get(id string) (*Migration, error)
- func (m *Migrations) Last() (*Migration, error)
- func (m *Migrations) Len() int
- func (m *Migrations) Less(i, j int) bool
- func (m *Migrations) Pop() (*Migration, error)
- func (m *Migrations) Sort()
- func (m *Migrations) Swap(i, j int)
- type MigrationsSerializable
- type MockMigrationTarget
- func (mmt *MockMigrationTarget) Debug()
- func (mmt *MockMigrationTarget) DeleteApplication() error
- func (mmt *MockMigrationTarget) DeleteEnvironment() error
- func (mmt *MockMigrationTarget) Get(path string) (string, error)
- func (mmt *MockMigrationTarget) GetAll() map[string]string
- func (mmt *MockMigrationTarget) GetApplication() string
- func (mmt *MockMigrationTarget) GetEnvironment() string
- func (mmt *MockMigrationTarget) GetLogger() ILogger
- func (mmt *MockMigrationTarget) GetMigrationTip() (*Migration, error)
- func (mmt *MockMigrationTarget) GetStatus() (*MigrationState, error)
- func (mmt *MockMigrationTarget) IsPerformingFullMigration() bool
- func (mmt *MockMigrationTarget) Set(path string, value string) error
- func (mmt *MockMigrationTarget) SetStatus(state *MigrationState) error
- type NullLogger
- type Status
- type Up
- type VerboseLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNewMigrationFile ¶
Types ¶
type Config ¶
type Config struct { Raw map[string]interface{} Leaves *ConfigLeaves }
type ConfigLeaf ¶
type ConfigLeaves ¶
type ConfigLeaves struct {
Entries []ConfigLeaf
}
func NewConfigLeaves ¶
func NewConfigLeaves() (*ConfigLeaves, error)
type Destroy ¶
type Destroy struct {
MigrationTarget MigrationTarget
}
func NewDestroy ¶
func NewDestroy(target MigrationTarget) *Destroy
type Down ¶
type Down struct { MigrationTarget MigrationTarget Migrations *Migrations }
func NewDown ¶
func NewDown(target MigrationTarget) *Down
type EtcdMigrationTarget ¶
type EtcdMigrationTarget struct { EtcdHostUrl string Application string Environment string FullMigration bool // contains filtered or unexported fields }
func NewEtcdMigrationTarget ¶
func (*EtcdMigrationTarget) Debug ¶
func (emt *EtcdMigrationTarget) Debug()
func (*EtcdMigrationTarget) DeleteApplication ¶
func (emt *EtcdMigrationTarget) DeleteApplication() error
func (*EtcdMigrationTarget) DeleteEnvironment ¶
func (emt *EtcdMigrationTarget) DeleteEnvironment() error
func (*EtcdMigrationTarget) GetAll ¶
func (emt *EtcdMigrationTarget) GetAll() map[string]string
func (*EtcdMigrationTarget) GetApplication ¶
func (emt *EtcdMigrationTarget) GetApplication() string
func (*EtcdMigrationTarget) GetEnvironment ¶
func (emt *EtcdMigrationTarget) GetEnvironment() string
func (*EtcdMigrationTarget) GetLogger ¶
func (emt *EtcdMigrationTarget) GetLogger() ILogger
func (*EtcdMigrationTarget) GetMigrationTip ¶
func (emt *EtcdMigrationTarget) GetMigrationTip() (*Migration, error)
func (*EtcdMigrationTarget) GetStatus ¶
func (emt *EtcdMigrationTarget) GetStatus() (*MigrationState, error)
func (*EtcdMigrationTarget) IsPerformingFullMigration ¶
func (emt *EtcdMigrationTarget) IsPerformingFullMigration() bool
func (*EtcdMigrationTarget) Set ¶
func (emt *EtcdMigrationTarget) Set(path string, value string) error
func (*EtcdMigrationTarget) SetStatus ¶
func (emt *EtcdMigrationTarget) SetStatus(state *MigrationState) error
type ILogger ¶
type ILogger interface { Info(message string, args ...interface{}) Debug(message string, args ...interface{}) }
func NewNullLogger ¶
func NewNullLogger() ILogger
func NewVerboseLogger ¶
func NewVerboseLogger() ILogger
type Migration ¶
type Migration struct { Content *ConfigLeaves Source string Id string NextId string PreviousId string Name string }
func NewMigrationFromConfig ¶
func NewMigrationFromGull ¶
func (*Migration) ConvertToYaml ¶
func (*Migration) WriteToFile ¶
type MigrationState ¶
type MigrationState struct { Created time.Time Migrations *Migrations }
func NewMigrationState ¶
func NewMigrationState(migrations *Migrations) *MigrationState
type MigrationTarget ¶
type MigrationTarget interface { Set(path string, value string) error Get(path string) (string, error) GetEnvironment() string GetApplication() string GetAll() map[string]string Debug() GetStatus() (*MigrationState, error) SetStatus(state *MigrationState) error DeleteEnvironment() error DeleteApplication() error IsPerformingFullMigration() bool GetMigrationTip() (*Migration, error) GetLogger() ILogger }
type Migrations ¶
func NewMigrations ¶
func NewMigrations() *Migrations
func (*Migrations) Add ¶
func (m *Migrations) Add(migration *Migration) error
func (*Migrations) Apply ¶
func (m *Migrations) Apply(target MigrationTarget) error
func (*Migrations) First ¶
func (m *Migrations) First() (*Migration, error)
func (*Migrations) Last ¶
func (m *Migrations) Last() (*Migration, error)
func (*Migrations) Less ¶
func (m *Migrations) Less(i, j int) bool
func (*Migrations) Pop ¶
func (m *Migrations) Pop() (*Migration, error)
func (*Migrations) Sort ¶
func (m *Migrations) Sort()
func (*Migrations) Swap ¶
func (m *Migrations) Swap(i, j int)
type MigrationsSerializable ¶
type MigrationsSerializable struct { }
type MockMigrationTarget ¶
type MockMigrationTarget struct { Storage map[string]string Application string Environment string MigrationState *MigrationState // contains filtered or unexported fields }
func NewMockMigrationTarget ¶
func NewMockMigrationTarget(application string, environment string, logger ILogger) *MockMigrationTarget
func (*MockMigrationTarget) Debug ¶
func (mmt *MockMigrationTarget) Debug()
func (*MockMigrationTarget) DeleteApplication ¶
func (mmt *MockMigrationTarget) DeleteApplication() error
func (*MockMigrationTarget) DeleteEnvironment ¶
func (mmt *MockMigrationTarget) DeleteEnvironment() error
func (*MockMigrationTarget) GetAll ¶
func (mmt *MockMigrationTarget) GetAll() map[string]string
func (*MockMigrationTarget) GetApplication ¶
func (mmt *MockMigrationTarget) GetApplication() string
func (*MockMigrationTarget) GetEnvironment ¶
func (mmt *MockMigrationTarget) GetEnvironment() string
func (*MockMigrationTarget) GetLogger ¶
func (mmt *MockMigrationTarget) GetLogger() ILogger
func (*MockMigrationTarget) GetMigrationTip ¶
func (mmt *MockMigrationTarget) GetMigrationTip() (*Migration, error)
func (*MockMigrationTarget) GetStatus ¶
func (mmt *MockMigrationTarget) GetStatus() (*MigrationState, error)
func (*MockMigrationTarget) IsPerformingFullMigration ¶
func (mmt *MockMigrationTarget) IsPerformingFullMigration() bool
func (*MockMigrationTarget) Set ¶
func (mmt *MockMigrationTarget) Set(path string, value string) error
func (*MockMigrationTarget) SetStatus ¶
func (mmt *MockMigrationTarget) SetStatus(state *MigrationState) error
type NullLogger ¶
type NullLogger struct{}
func (*NullLogger) Debug ¶
func (nl *NullLogger) Debug(message string, args ...interface{})
func (*NullLogger) Info ¶
func (nl *NullLogger) Info(message string, args ...interface{})
type Status ¶
type Status struct {
MigrationTarget MigrationTarget
}
func NewStatus ¶
func NewStatus(target MigrationTarget) *Status
type Up ¶
type Up struct { Environment string SourceDirectory string MigrateTarget MigrationTarget Migrations *Migrations }
func NewUp ¶
func NewUp(source string, target MigrationTarget) *Up
type VerboseLogger ¶
type VerboseLogger struct{}
func (*VerboseLogger) Debug ¶
func (vl *VerboseLogger) Debug(message string, args ...interface{})
func (*VerboseLogger) Info ¶
func (vl *VerboseLogger) Info(message string, args ...interface{})
Click to show internal directories.
Click to hide internal directories.