Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyMigrations ¶
ApplyMigrations does the necessary work to actualize state. It will manipulate the objects available in baseEnv, and use the migrations table in db.
func BlockUntil ¶
BlockUntil blocks until state is actualized. It makes no attempt to perform migrations, hopefully another process is working on that by calling ApplyMigrations. If the cluster ever enters a state newer than the state passed to BlockUntil, it errors.
Types ¶
type Env ¶
type Env struct { // TODO: etcd ObjectClient obj.Client Tx *pachsql.Tx EtcdClient *clientv3.Client }
Env contains all the objects that can be manipulated during a migration. The Tx field will be overwritten with the transaction that the migration should be performed in.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State represents a state of the cluster, including all the steps taken to get there.
func InitialState ¶
func InitialState() State
InitialState returns a cluster that has no migrations. The initial state contains a change which is just to create the migration table.