Documentation
¶
Index ¶
- Variables
- func CreateConnections() error
- func DoCheckMigrate()
- func DoCleanup(didCheckmigrateFail bool)
- func DoFlagValidation(cmd *cobra.Command)
- func DoInit(cmd *cobra.Command)
- func DoSetup() error
- func DoTeardown()
- func FlagChanged(flagName string) bool
- func GetShouldScrapeDatabaseNames() bool
- func GetSourceConnection() *dbconn.DBConn
- func GetTargetConnection() *dbconn.DBConn
- func GetVersion() string
- func MustGetFlagBool(flagName string) bool
- func MustGetFlagString(flagName string) string
- func ResetGlobalState()
- func SetCmdFlags(flagSet *pflag.FlagSet)
- func SetCreateDBConn(f func(dbName, username, host string, port int) *dbconn.DBConn)
- func SetLoggerVerbosity()
- func SetVersion(v string)
- func ValidateFlagCombinations(flags *pflag.FlagSet)
Constants ¶
This section is empty.
Variables ¶
var ( // Used for synchronizing DoCleanup. In DoInit() we increment the group // and then wait for at least one DoCleanup to finish, either in DoTeardown // or the signal handler. CleanupGroup *sync.WaitGroup )
Non-flag variables
Functions ¶
func CreateConnections ¶
func CreateConnections() error
We kind of replicate NewDBConnFromEnvironment(), but as we have host/port/user flags we need to do their checking and assignment here.
func DoCheckMigrate ¶
func DoCheckMigrate()
func DoFlagValidation ¶
This function handles argument parsing and validation, e.g. checking that a passed filename exists. It should only validate; initialization with any sort of side effects should go in DoInit or DoSetup.
func DoSetup ¶
func DoSetup() error
This function handles setup that must be done after parsing flags.
func DoTeardown ¶
func DoTeardown()
func FlagChanged ¶
Util functions to enable ease of access to global flag values
func GetShouldScrapeDatabaseNames ¶
func GetShouldScrapeDatabaseNames() bool
func GetSourceConnection ¶
func GetTargetConnection ¶
func MustGetFlagBool ¶
func MustGetFlagString ¶
func ResetGlobalState ¶
func ResetGlobalState()
ResetGlobalState() clears the global variables before each test
func SetCreateDBConn ¶
func SetLoggerVerbosity ¶
func SetLoggerVerbosity()
func SetVersion ¶
func SetVersion(v string)
Types ¶
This section is empty.