Documentation ¶
Index ¶
- Constants
- func RunSyncProcess(sourceEnvironment Environment, targetEnvironment Environment, ...) error
- func Shellout(command string) (error, string, string)
- func SyncCleanUp(environment Environment, syncer Syncer, dryRun bool) error
- func SyncRunSourceCommand(remoteEnvironment Environment, syncer Syncer, dryRun bool) error
- func SyncRunTargetCommand(targetEnvironment Environment, syncer Syncer, dryRun bool) error
- func SyncRunTransfer(sourceEnvironment Environment, targetEnvironment Environment, syncer Syncer, ...) error
- type BaseDrupalconfigSync
- type BaseFilesSync
- type BaseMariaDbSync
- type BasePostgresSync
- type DrupalconfigSyncLocal
- type DrupalconfigSyncRoot
- func (m DrupalconfigSyncRoot) GetLocalCommand(environment Environment) SyncCommand
- func (root DrupalconfigSyncRoot) GetOutputDirectory() string
- func (root DrupalconfigSyncRoot) GetRemoteCommand(environment Environment) SyncCommand
- func (m DrupalconfigSyncRoot) GetTransferResource(environment Environment) SyncerTransferResource
- func (root DrupalconfigSyncRoot) PrepareSyncer() (Syncer, error)
- type Environment
- type FilesSyncLocal
- type FilesSyncRoot
- func (m FilesSyncRoot) GetLocalCommand(environment Environment) SyncCommand
- func (root FilesSyncRoot) GetRemoteCommand(environment Environment) SyncCommand
- func (m FilesSyncRoot) GetTransferResource(environment Environment) SyncerTransferResource
- func (root FilesSyncRoot) PrepareSyncer() (Syncer, error)
- type LagoonSync
- type MariadbSyncLocal
- type MariadbSyncRoot
- func (m MariadbSyncRoot) GetLocalCommand(targetEnvironment Environment) SyncCommand
- func (root MariadbSyncRoot) GetOutputDirectory() string
- func (root MariadbSyncRoot) GetRemoteCommand(sourceEnvironment Environment) SyncCommand
- func (m MariadbSyncRoot) GetTransferResource(environment Environment) SyncerTransferResource
- func (root MariadbSyncRoot) PrepareSyncer() (Syncer, error)
- type PostgresSyncLocal
- type PostgresSyncRoot
- func (m PostgresSyncRoot) GetLocalCommand(environment Environment) SyncCommand
- func (root PostgresSyncRoot) GetOutputDirectory() string
- func (root PostgresSyncRoot) GetRemoteCommand(environment Environment) SyncCommand
- func (m PostgresSyncRoot) GetTransferResource(environment Environment) SyncerTransferResource
- func (root PostgresSyncRoot) PrepareSyncer() (Syncer, error)
- type SyncCommand
- type Syncer
- type SyncerTransferResource
- type SyncherConfigRoot
Constants ¶
View Source
const LOCAL_ENVIRONMENT_NAME = "local"
View Source
const ShellToUse = "bash"
Variables ¶
This section is empty.
Functions ¶
func RunSyncProcess ¶
func RunSyncProcess(sourceEnvironment Environment, targetEnvironment Environment, lagoonSyncer Syncer, dryRun bool) error
func SyncCleanUp ¶
func SyncCleanUp(environment Environment, syncer Syncer, dryRun bool) error
func SyncRunSourceCommand ¶
func SyncRunSourceCommand(remoteEnvironment Environment, syncer Syncer, dryRun bool) error
func SyncRunTargetCommand ¶
func SyncRunTargetCommand(targetEnvironment Environment, syncer Syncer, dryRun bool) error
func SyncRunTransfer ¶
func SyncRunTransfer(sourceEnvironment Environment, targetEnvironment Environment, syncer Syncer, dryRun bool) error
Types ¶
type BaseDrupalconfigSync ¶
type BaseFilesSync ¶
type BaseMariaDbSync ¶
type BaseMariaDbSync struct { DbHostname string `yaml:"hostname"` DbUsername string `yaml:"username"` DbPassword string `yaml:"password"` DbPort string `yaml:"port"` DbDatabase string `yaml:"database"` IgnoreTable []string `yaml:"ignore-table"` IgnoreTableData []string `yaml:"ignore-table-data"` OutputDirectory string }
type BasePostgresSync ¶
type BasePostgresSync struct { DbHostname string `yaml:"hostname"` DbUsername string `yaml:"username"` DbPassword string `yaml:"password"` DbPort string `yaml:"port"` DbDatabase string `yaml:"database"` ExcludeTable []string `yaml:"exclude-table"` ExcludeTableData []string `yaml:"exclude-table-data"` OutputDirectory string }
type DrupalconfigSyncLocal ¶
type DrupalconfigSyncLocal struct {
Config BaseDrupalconfigSync
}
type DrupalconfigSyncRoot ¶
type DrupalconfigSyncRoot struct { Config BaseDrupalconfigSync LocalOverrides DrupalconfigSyncLocal `yaml:"local"` TransferId string }
func (DrupalconfigSyncRoot) GetLocalCommand ¶
func (m DrupalconfigSyncRoot) GetLocalCommand(environment Environment) SyncCommand
func (DrupalconfigSyncRoot) GetOutputDirectory ¶
func (root DrupalconfigSyncRoot) GetOutputDirectory() string
func (DrupalconfigSyncRoot) GetRemoteCommand ¶
func (root DrupalconfigSyncRoot) GetRemoteCommand(environment Environment) SyncCommand
func (DrupalconfigSyncRoot) GetTransferResource ¶
func (m DrupalconfigSyncRoot) GetTransferResource(environment Environment) SyncerTransferResource
func (DrupalconfigSyncRoot) PrepareSyncer ¶
func (root DrupalconfigSyncRoot) PrepareSyncer() (Syncer, error)
type Environment ¶
type FilesSyncLocal ¶
type FilesSyncLocal struct {
Config BaseFilesSync
}
type FilesSyncRoot ¶
type FilesSyncRoot struct { Config BaseFilesSync LocalOverrides FilesSyncLocal `yaml:"local"` TransferId string }
func (FilesSyncRoot) GetLocalCommand ¶
func (m FilesSyncRoot) GetLocalCommand(environment Environment) SyncCommand
func (FilesSyncRoot) GetRemoteCommand ¶
func (root FilesSyncRoot) GetRemoteCommand(environment Environment) SyncCommand
func (FilesSyncRoot) GetTransferResource ¶
func (m FilesSyncRoot) GetTransferResource(environment Environment) SyncerTransferResource
func (FilesSyncRoot) PrepareSyncer ¶
func (root FilesSyncRoot) PrepareSyncer() (Syncer, error)
type LagoonSync ¶
type LagoonSync struct { Mariadb MariadbSyncRoot `yaml:"mariadb"` Postgres PostgresSyncRoot `yaml:"postgres"` Drupalconfig DrupalconfigSyncRoot `yaml:"drupalconfig"` Filesconfig FilesSyncRoot `yaml:"files"` TransferId string // a unique id which can be used to identify this entire transaction }
The following is the root structure for unmarshalling yaml configurations Each syncer must register its structure here
type MariadbSyncLocal ¶
type MariadbSyncLocal struct {
Config BaseMariaDbSync
}
type MariadbSyncRoot ¶
type MariadbSyncRoot struct { Config BaseMariaDbSync LocalOverrides MariadbSyncLocal `yaml:"local"` TransferId string }
func (MariadbSyncRoot) GetLocalCommand ¶
func (m MariadbSyncRoot) GetLocalCommand(targetEnvironment Environment) SyncCommand
func (MariadbSyncRoot) GetOutputDirectory ¶
func (root MariadbSyncRoot) GetOutputDirectory() string
func (MariadbSyncRoot) GetRemoteCommand ¶
func (root MariadbSyncRoot) GetRemoteCommand(sourceEnvironment Environment) SyncCommand
func (MariadbSyncRoot) GetTransferResource ¶
func (m MariadbSyncRoot) GetTransferResource(environment Environment) SyncerTransferResource
func (MariadbSyncRoot) PrepareSyncer ¶
func (root MariadbSyncRoot) PrepareSyncer() (Syncer, error)
type PostgresSyncLocal ¶
type PostgresSyncLocal struct {
Config BasePostgresSync
}
type PostgresSyncRoot ¶
type PostgresSyncRoot struct { Config BasePostgresSync `yaml:"config"` LocalOverrides PostgresSyncLocal `yaml:"local"` TransferId string }
func (PostgresSyncRoot) GetLocalCommand ¶
func (m PostgresSyncRoot) GetLocalCommand(environment Environment) SyncCommand
func (PostgresSyncRoot) GetOutputDirectory ¶
func (root PostgresSyncRoot) GetOutputDirectory() string
func (PostgresSyncRoot) GetRemoteCommand ¶
func (root PostgresSyncRoot) GetRemoteCommand(environment Environment) SyncCommand
func (PostgresSyncRoot) GetTransferResource ¶
func (m PostgresSyncRoot) GetTransferResource(environment Environment) SyncerTransferResource
func (PostgresSyncRoot) PrepareSyncer ¶
func (root PostgresSyncRoot) PrepareSyncer() (Syncer, error)
type SyncCommand ¶
type SyncCommand struct { NoOp bool // NoOp can be set to true if this command performs no operation (in situations like file transfers) // contains filtered or unexported fields }
func (SyncCommand) GetCommand ¶
func (c SyncCommand) GetCommand() (string, error)
type Syncer ¶
type Syncer interface { // GetRemoteCommand will return the command to be run on the source system GetRemoteCommand(environment Environment) SyncCommand // GetLocalCommand will return the command to be run on the target system GetLocalCommand(environment Environment) SyncCommand GetTransferResource(environment Environment) SyncerTransferResource // PrepareSyncer does any preparations required on a Syncer before it is used PrepareSyncer() (Syncer, error) }
type SyncerTransferResource ¶
type SyncerTransferResource struct { Name string IsDirectory bool ExcludeResources []string // ExcludeResources is a string list of any resources that aren't to be included in the transfer SkipCleanup bool }
SyncerTransferResource describes what it is the is produced by the actions of GetRemoteCommand()
type SyncherConfigRoot ¶
type SyncherConfigRoot struct { Project string LagoonSync LagoonSync `yaml:"lagoon-sync"` }
SyncherConfigRoot is used to unmarshall yaml config details generally
func UnmarshallLagoonYamlToLagoonSyncStructure ¶
func UnmarshallLagoonYamlToLagoonSyncStructure(data []byte) (SyncherConfigRoot, error)
UnmarshallLagoonYamlToLagoonSyncStructure will take a bytestream and return a fully parsed lagoon sync config structure
Click to show internal directories.
Click to hide internal directories.