Documentation
¶
Index ¶
- Variables
- func BatchExists(ctx context.Context, db dbtx, name string) (_ bool, _err error)
- func CreateBatch(ctx context.Context, db dbtx, object migration.Batch) (_ int64, _err error)
- func CreateBatchMigrationWindows(ctx context.Context, db tx, objects []BatchMigrationWindow) (_err error)
- func CreateInstance(ctx context.Context, db dbtx, object migration.Instance) (_ int64, _err error)
- func CreateInstanceBatches(ctx context.Context, db tx, objects []InstanceBatch) (_err error)
- func CreateMigrationWindow(ctx context.Context, db dbtx, object migration.MigrationWindow) (_ int64, _err error)
- func CreateNetwork(ctx context.Context, db dbtx, object migration.Network) (_ int64, _err error)
- func CreateQueueEntry(ctx context.Context, db dbtx, object migration.QueueEntry) (_ int64, _err error)
- func CreateSource(ctx context.Context, db dbtx, object migration.Source) (_ int64, _err error)
- func CreateTarget(ctx context.Context, db dbtx, object migration.Target) (_ int64, _err error)
- func DeleteBatch(ctx context.Context, db dbtx, name string) (_err error)
- func DeleteBatchMigrationWindows(ctx context.Context, db tx, batchID int) (_err error)
- func DeleteInstance(ctx context.Context, db dbtx, uuid uuid.UUID) (_err error)
- func DeleteInstanceBatch(ctx context.Context, db tx, instanceID int, batchID int) (_err error)
- func DeleteInstanceBatches(ctx context.Context, db tx, instanceID int) (_err error)
- func DeleteMigrationWindow(ctx context.Context, db dbtx, start time.Time, end time.Time, ...) (_err error)
- func DeleteNetwork(ctx context.Context, db dbtx, identifier string, source string) (_err error)
- func DeleteQueueEntries(ctx context.Context, db dbtx, batchName string) (_err error)
- func DeleteQueueEntry(ctx context.Context, db dbtx, instanceUUID uuid.UUID) (_err error)
- func DeleteSource(ctx context.Context, db dbtx, name string) (_err error)
- func DeleteTarget(ctx context.Context, db dbtx, name string) (_err error)
- func GetAssignedInstances(ctx context.Context, tx dbtx) (migration.Instances, error)
- func GetBatch(ctx context.Context, db dbtx, name string) (_ *migration.Batch, _err error)
- func GetBatchID(ctx context.Context, db tx, name string) (_ int64, _err error)
- func GetBatchInstances(ctx context.Context, db tx, batchID int) (_ []migration.Instance, _err error)
- func GetBatchNames(ctx context.Context, db dbtx, filters ...BatchFilter) (_ []string, _err error)
- func GetBatches(ctx context.Context, db dbtx, filters ...BatchFilter) (_ []migration.Batch, _err error)
- func GetBatchesByInstance(ctx context.Context, tx dbtx, instanceUUID *uuid.UUID) (migration.Batches, error)
- func GetInstance(ctx context.Context, db dbtx, uuid uuid.UUID) (_ *migration.Instance, _err error)
- func GetInstanceBatches(ctx context.Context, db tx, instanceID int) (_ []migration.Batch, _err error)
- func GetInstanceID(ctx context.Context, db tx, uuid uuid.UUID) (_ int64, _err error)
- func GetInstanceNames(ctx context.Context, db dbtx, filters ...InstanceFilter) (_ []uuid.UUID, _err error)
- func GetInstances(ctx context.Context, db dbtx, filters ...InstanceFilter) (_ []migration.Instance, _err error)
- func GetInstancesByBatch(ctx context.Context, tx dbtx, batchName *string) (migration.Instances, error)
- func GetMigrationWindow(ctx context.Context, db dbtx, start time.Time, end time.Time, ...) (_ *migration.MigrationWindow, _err error)
- func GetMigrationWindowID(ctx context.Context, db tx, start time.Time, end time.Time, lockout time.Time) (_ int64, _err error)
- func GetMigrationWindows(ctx context.Context, db dbtx, filters ...MigrationWindowFilter) (_ []migration.MigrationWindow, _err error)
- func GetMigrationWindowsByBatch(ctx context.Context, tx dbtx, batchName *string) ([]migration.MigrationWindow, error)
- func GetNetwork(ctx context.Context, db dbtx, identifier string, source string) (_ *migration.Network, _err error)
- func GetNetworkID(ctx context.Context, db tx, identifier string, source string) (_ int64, _err error)
- func GetNetworks(ctx context.Context, db dbtx, filters ...NetworkFilter) (_ []migration.Network, _err error)
- func GetQueueEntries(ctx context.Context, db dbtx, filters ...QueueEntryFilter) (_ []migration.QueueEntry, _err error)
- func GetQueueEntry(ctx context.Context, db dbtx, instanceUUID uuid.UUID) (_ *migration.QueueEntry, _err error)
- func GetQueueEntryID(ctx context.Context, db tx, instanceUUID uuid.UUID) (_ int64, _err error)
- func GetSource(ctx context.Context, db dbtx, name string) (_ *migration.Source, _err error)
- func GetSourceID(ctx context.Context, db tx, name string) (_ int64, _err error)
- func GetSourceNames(ctx context.Context, db dbtx, filters ...SourceFilter) (_ []string, _err error)
- func GetSources(ctx context.Context, db dbtx, filters ...SourceFilter) (_ []migration.Source, _err error)
- func GetTarget(ctx context.Context, db dbtx, name string) (_ *migration.Target, _err error)
- func GetTargetID(ctx context.Context, db tx, name string) (_ int64, _err error)
- func GetTargetNames(ctx context.Context, db dbtx, filters ...TargetFilter) (_ []string, _err error)
- func GetTargets(ctx context.Context, db dbtx, filters ...TargetFilter) (_ []migration.Target, _err error)
- func NetworkExists(ctx context.Context, db dbtx, identifier string, source string) (_ bool, _err error)
- func PrepareStmts(db preparer, skipErrors bool) (map[int]*sql.Stmt, error)
- func RegisterStmt(sqlStmt string) int
- func RenameBatch(ctx context.Context, db dbtx, name string, to string) (_err error)
- func RenameSource(ctx context.Context, db dbtx, name string, to string) (_err error)
- func RenameTarget(ctx context.Context, db dbtx, name string, to string) (_err error)
- func SourceExists(ctx context.Context, db dbtx, name string) (_ bool, _err error)
- func Stmt(db dbtx, code int) (*sql.Stmt, error)
- func StmtString(code int) (string, error)
- func TargetExists(ctx context.Context, db dbtx, name string) (_ bool, _err error)
- func UpdateBatch(ctx context.Context, db tx, name string, object migration.Batch) (_err error)
- func UpdateInstance(ctx context.Context, db tx, uuid uuid.UUID, object migration.Instance) (_err error)
- func UpdateMigrationWindow(ctx context.Context, db tx, start time.Time, end time.Time, lockout time.Time, ...) (_err error)
- func UpdateNetwork(ctx context.Context, db tx, identifier string, source string, ...) (_err error)
- func UpdateQueueEntry(ctx context.Context, db tx, instanceUUID uuid.UUID, ...) (_err error)
- func UpdateSource(ctx context.Context, db tx, name string, object migration.Source) (_err error)
- func UpdateTarget(ctx context.Context, db tx, name string, object migration.Target) (_err error)
- type BatchFilter
- type BatchMigrationWindow
- type BatchMigrationWindowFilter
- type InstanceBatch
- type InstanceBatchFilter
- type InstanceFilter
- type Marshaler
- type MigrationWindowFilter
- type NetworkFilter
- type QueueEntryFilter
- type SourceFilter
- type TargetFilter
- type Unmarshaler
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is the error returned, if the entity is not found in the DB. ErrNotFound = errors.New("Not found") // ErrConflict is the error returned, if the adding or updating an entity // causes a conflict with an existing entity. ErrConflict = errors.New("Conflict") )
var PreparedStmts = map[int]*sql.Stmt{}
PreparedStmts is a placeholder for transitioning to package-scoped transaction functions.
Functions ¶
func BatchExists ¶
BatchExists checks if a batch with the given key exists. generator: batch Exists
func CreateBatch ¶
CreateBatch adds a new batch to the database. generator: batch Create
func CreateBatchMigrationWindows ¶
func CreateBatchMigrationWindows(ctx context.Context, db tx, objects []BatchMigrationWindow) (_err error)
CreateBatchMigrationWindows adds a new batch_migration_window to the database. generator: batch_migration_window Create
func CreateInstance ¶
CreateInstance adds a new instance to the database. generator: instance Create
func CreateInstanceBatches ¶
func CreateInstanceBatches(ctx context.Context, db tx, objects []InstanceBatch) (_err error)
CreateInstanceBatches adds a new instance_batch to the database. generator: instance_batch Create
func CreateMigrationWindow ¶
func CreateMigrationWindow(ctx context.Context, db dbtx, object migration.MigrationWindow) (_ int64, _err error)
CreateMigrationWindow adds a new migration_window to the database. generator: migration_window Create
func CreateNetwork ¶
CreateNetwork adds a new network to the database. generator: network Create
func CreateQueueEntry ¶
func CreateQueueEntry(ctx context.Context, db dbtx, object migration.QueueEntry) (_ int64, _err error)
CreateQueueEntry adds a new queue_entry to the database. generator: queue_entry Create
func CreateSource ¶
CreateSource adds a new source to the database. generator: source Create
func CreateTarget ¶
CreateTarget adds a new target to the database. generator: target Create
func DeleteBatch ¶
DeleteBatch deletes the batch matching the given key parameters. generator: batch DeleteOne-by-Name
func DeleteBatchMigrationWindows ¶
DeleteBatchMigrationWindows deletes the batch_migration_window matching the given key parameters. generator: batch_migration_window DeleteMany
func DeleteInstance ¶
DeleteInstance deletes the instance matching the given key parameters. generator: instance DeleteOne-by-UUID
func DeleteInstanceBatch ¶
DeleteInstanceBatch deletes the instance_batch matching the given key parameters.
func DeleteInstanceBatches ¶
DeleteInstanceBatches deletes the instance_batch matching the given key parameters. generator: instance_batch DeleteMany
func DeleteMigrationWindow ¶
func DeleteMigrationWindow(ctx context.Context, db dbtx, start time.Time, end time.Time, lockout time.Time) (_err error)
DeleteMigrationWindow deletes the migration_window matching the given key parameters. generator: migration_window DeleteOne-by-Start-and-End-and-Lockout
func DeleteNetwork ¶
DeleteNetwork deletes the network matching the given key parameters. generator: network DeleteOne-by-Identifier-and-Source
func DeleteQueueEntries ¶
DeleteQueueEntries deletes the queue_entry matching the given key parameters. generator: queue_entry DeleteMany-by-BatchName
func DeleteQueueEntry ¶
DeleteQueueEntry deletes the queue_entry matching the given key parameters. generator: queue_entry DeleteOne-by-InstanceUUID
func DeleteSource ¶
DeleteSource deletes the source matching the given key parameters. generator: source DeleteOne-by-Name
func DeleteTarget ¶
DeleteTarget deletes the target matching the given key parameters. generator: target DeleteOne-by-Name
func GetAssignedInstances ¶
func GetBatchID ¶
GetBatchID return the ID of the batch with the given key. generator: batch ID
func GetBatchInstances ¶
func GetBatchInstances(ctx context.Context, db tx, batchID int) (_ []migration.Instance, _err error)
GetBatchInstances returns all available Instances for the Batch. generator: instance_batch GetMany
func GetBatchNames ¶
func GetBatchNames(ctx context.Context, db dbtx, filters ...BatchFilter) (_ []string, _err error)
GetBatchNames returns the identifying field of batch. generator: batch GetNames
func GetBatches ¶
func GetBatches(ctx context.Context, db dbtx, filters ...BatchFilter) (_ []migration.Batch, _err error)
GetBatches returns all available batches. generator: batch GetMany
func GetBatchesByInstance ¶
func GetInstance ¶
GetInstance returns the instance with the given key. generator: instance GetOne
func GetInstanceBatches ¶
func GetInstanceBatches(ctx context.Context, db tx, instanceID int) (_ []migration.Batch, _err error)
GetInstanceBatches returns all available Batches for the Instance. generator: instance_batch GetMany
func GetInstanceID ¶
GetInstanceID return the ID of the instance with the given key. generator: instance ID
func GetInstanceNames ¶
func GetInstanceNames(ctx context.Context, db dbtx, filters ...InstanceFilter) (_ []uuid.UUID, _err error)
GetInstanceNames returns the identifying field of instance. generator: instance GetNames
func GetInstances ¶
func GetInstances(ctx context.Context, db dbtx, filters ...InstanceFilter) (_ []migration.Instance, _err error)
GetInstances returns all available instances. generator: instance GetMany
func GetInstancesByBatch ¶
func GetMigrationWindow ¶
func GetMigrationWindow(ctx context.Context, db dbtx, start time.Time, end time.Time, lockout time.Time) (_ *migration.MigrationWindow, _err error)
GetMigrationWindow returns the migration_window with the given key. generator: migration_window GetOne
func GetMigrationWindowID ¶
func GetMigrationWindowID(ctx context.Context, db tx, start time.Time, end time.Time, lockout time.Time) (_ int64, _err error)
GetMigrationWindowID return the ID of the migration_window with the given key. generator: migration_window ID
func GetMigrationWindows ¶
func GetMigrationWindows(ctx context.Context, db dbtx, filters ...MigrationWindowFilter) (_ []migration.MigrationWindow, _err error)
GetMigrationWindows returns all available migration_windows. generator: migration_window GetMany
func GetMigrationWindowsByBatch ¶
func GetMigrationWindowsByBatch(ctx context.Context, tx dbtx, batchName *string) ([]migration.MigrationWindow, error)
GetMigrationWindowsByBatch returns all MigrationWindows for the given batch name. If the batch name is nil, it will return all MigrationWindows for which there is no assigned batch.
func GetNetwork ¶
func GetNetwork(ctx context.Context, db dbtx, identifier string, source string) (_ *migration.Network, _err error)
GetNetwork returns the network with the given key. generator: network GetOne
func GetNetworkID ¶
func GetNetworkID(ctx context.Context, db tx, identifier string, source string) (_ int64, _err error)
GetNetworkID return the ID of the network with the given key. generator: network ID
func GetNetworks ¶
func GetNetworks(ctx context.Context, db dbtx, filters ...NetworkFilter) (_ []migration.Network, _err error)
GetNetworks returns all available networks. generator: network GetMany
func GetQueueEntries ¶
func GetQueueEntries(ctx context.Context, db dbtx, filters ...QueueEntryFilter) (_ []migration.QueueEntry, _err error)
GetQueueEntries returns all available queue_entries. generator: queue_entry GetMany
func GetQueueEntry ¶
func GetQueueEntry(ctx context.Context, db dbtx, instanceUUID uuid.UUID) (_ *migration.QueueEntry, _err error)
GetQueueEntry returns the queue_entry with the given key. generator: queue_entry GetOne
func GetQueueEntryID ¶
GetQueueEntryID return the ID of the queue_entry with the given key. generator: queue_entry ID
func GetSourceID ¶
GetSourceID return the ID of the source with the given key. generator: source ID
func GetSourceNames ¶
func GetSourceNames(ctx context.Context, db dbtx, filters ...SourceFilter) (_ []string, _err error)
GetSourceNames returns the identifying field of source. generator: source GetNames
func GetSources ¶
func GetSources(ctx context.Context, db dbtx, filters ...SourceFilter) (_ []migration.Source, _err error)
GetSources returns all available sources. generator: source GetMany
func GetTargetID ¶
GetTargetID return the ID of the target with the given key. generator: target ID
func GetTargetNames ¶
func GetTargetNames(ctx context.Context, db dbtx, filters ...TargetFilter) (_ []string, _err error)
GetTargetNames returns the identifying field of target. generator: target GetNames
func GetTargets ¶
func GetTargets(ctx context.Context, db dbtx, filters ...TargetFilter) (_ []migration.Target, _err error)
GetTargets returns all available targets. generator: target GetMany
func NetworkExists ¶
func NetworkExists(ctx context.Context, db dbtx, identifier string, source string) (_ bool, _err error)
NetworkExists checks if a network with the given key exists. generator: network Exists
func PrepareStmts ¶
PrepareStmts prepares all registered statements and returns an index from statement code to prepared statement object.
func RegisterStmt ¶
RegisterStmt register a SQL statement.
Registered statements will be prepared upfront and reused, to speed up execution.
Return a unique registration code.
func RenameBatch ¶
RenameBatch renames the batch matching the given key parameters. generator: batch Rename
func RenameSource ¶
RenameSource renames the source matching the given key parameters. generator: source Rename
func RenameTarget ¶
RenameTarget renames the target matching the given key parameters. generator: target Rename
func SourceExists ¶
SourceExists checks if a source with the given key exists. generator: source Exists
func StmtString ¶
StmtString returns the in-memory query string with the given code.
func TargetExists ¶
TargetExists checks if a target with the given key exists. generator: target Exists
func UpdateBatch ¶
UpdateBatch updates the batch matching the given key parameters. generator: batch Update
func UpdateInstance ¶
func UpdateInstance(ctx context.Context, db tx, uuid uuid.UUID, object migration.Instance) (_err error)
UpdateInstance updates the instance matching the given key parameters. generator: instance Update
func UpdateMigrationWindow ¶
func UpdateMigrationWindow(ctx context.Context, db tx, start time.Time, end time.Time, lockout time.Time, object migration.MigrationWindow) (_err error)
UpdateMigrationWindow updates the migration_window matching the given key parameters. generator: migration_window Update
func UpdateNetwork ¶
func UpdateNetwork(ctx context.Context, db tx, identifier string, source string, object migration.Network) (_err error)
UpdateNetwork updates the network matching the given key parameters. generator: network Update
func UpdateQueueEntry ¶
func UpdateQueueEntry(ctx context.Context, db tx, instanceUUID uuid.UUID, object migration.QueueEntry) (_err error)
UpdateQueueEntry updates the queue_entry matching the given key parameters. generator: queue_entry Update
func UpdateSource ¶
UpdateSource updates the source matching the given key parameters. generator: source Update
Types ¶
type BatchFilter ¶
type BatchFilter struct { ID *int64 Name *string Status *api.BatchStatusType }
type BatchMigrationWindow ¶
type InstanceBatch ¶
type InstanceBatchFilter ¶
type Marshaler ¶
Marshaler is the interface that wraps the MarshalDB method, which converts the underlying type into a string representation suitable for persistence in the database.
type MigrationWindowFilter ¶
type NetworkFilter ¶
type QueueEntryFilter ¶
type SourceFilter ¶
type SourceFilter struct { SourceType *api.SourceType Name *string }
type TargetFilter ¶
type TargetFilter struct {
Name *string
}
type Unmarshaler ¶
Unmarshaler is the interface that wraps the UnmarshalDB method, which converts a string representation retrieved from the database into the underlying type.
Source Files
¶
- batch.go
- batch.mapper.go
- batch_migration_window.go
- batch_migration_window.mapper.go
- entities.go
- instance.go
- instance.mapper.go
- instance_batch.go
- instance_batch.mapper.go
- mapper_boilerplate.go
- mapper_errors.go
- migration_window.go
- migration_window.mapper.go
- network.go
- network.mapper.go
- queue.go
- queue.mapper.go
- source.go
- source.mapper.go
- target.go
- target.mapper.go