commanders

package
v0.0.0-...-31509f8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ApplyDataMigrationScriptSubDir

func ApplyDataMigrationScriptSubDir(gphome string, port int, scriptDirFS fs.FS, scriptDir string, bar *mpb.Bar) ([]byte, error)

func ApplyDataMigrationScripts

func ApplyDataMigrationScripts(streams step.OutStreams, nonInteractive bool, gphome string, port int, logDir string, currentScriptDirFS fs.FS, currentScriptDir string, phase idl.Step) error

func ApplyDataMigrationScriptsPrompt

func ApplyDataMigrationScriptsPrompt(nonInteractive bool, reader *bufio.Reader, currentScriptDir string, currentScriptDirFS fs.FS, phase idl.Step) ([]string, error)

func ApplySQLFile

func ApplySQLFile(gphome string, port int, database string, path string, args ...string) ([]byte, error)

func ArchiveDataMigrationScriptsPrompt

func ArchiveDataMigrationScriptsPrompt(streams step.OutStreams, nonInteractive bool, reader *bufio.Reader, outputDirFS fs.FS, outputDir string) error

func CreateStateDir

func CreateStateDir() (err error)

CreateStateDir creates the state directory in the cli to ensure that at most one gpupgrade is occurring at the same time.

func Execute

func Execute(client idl.CliToHubClient, request *idl.ExecuteRequest, verbose bool) (*idl.ExecuteResponse, error)

func Finalize

func Finalize(client idl.CliToHubClient, verbose bool) (*idl.FinalizeResponse, error)

func Format

func Format(description string, status idl.Status) string

Format is also exported for ease of testing (see FormatStatus). Use NewSubstep instead.

func FormatStatus

func FormatStatus(status *idl.SubstepStatus) string

FormatStatus returns a status string based on the upgrade status message. It's exported for ease of testing.

FormatStatus panics if it doesn't have a string representation for a given protobuf code.

func GenerateDataMigrationScripts

func GenerateDataMigrationScripts(streams step.OutStreams, nonInteractive bool, gphome string, port int, seedDir string, outputDir string, outputDirFS fs.FS) error

func GenerateScriptsPerDatabase

func GenerateScriptsPerDatabase(streams step.OutStreams, database DatabaseInfo, gphome string, port int, seedDir string, outputDir string, bar *mpb.Bar) error

func GenerateScriptsPerPhase

func GenerateScriptsPerPhase(phase idl.Step, database DatabaseInfo, gphome string, port int, seedDir string, seedDirFS fs.FS, outputDir string, bar *mpb.Bar) error

func Initialize

func Initialize(client idl.CliToHubClient, request *idl.InitializeRequest, verbose bool) (err error)

func InitializeCreateCluster

func InitializeCreateCluster(client idl.CliToHubClient, request *idl.InitializeCreateClusterRequest, verbose bool) (*idl.InitializeResponse, error)

func IsHubRunning

func IsHubRunning() (bool, error)

func ResetBashCommand

func ResetBashCommand()

func ResetBootstrapConnectionFunction

func ResetBootstrapConnectionFunction()

XXX: for internal testing only

func ResetPsqlCommand

func ResetPsqlCommand()

func ResetPsqlFileCommand

func ResetPsqlFileCommand()

func Revert

func Revert(client idl.CliToHubClient, verbose bool) (*idl.RevertResponse, error)

func SelectDataMigrationScriptsPrompt

func SelectDataMigrationScriptsPrompt(reader *bufio.Reader, currentScriptDir string, currentScriptDirFS fs.FS, phase idl.Step) ([]string, error)

func SetBashCommand

func SetBashCommand(command exectest.Command)

func SetBootstrapConnectionFunction

func SetBootstrapConnectionFunction(connectionFunc func(destination idl.ClusterDestination, gphome string, port int) (*sql.DB, error))

XXX: for internal testing only

func SetPsqlCommand

func SetPsqlCommand(command exectest.Command)

func SetPsqlFileCommand

func SetPsqlFileCommand(command exectest.Command)

func StartHub

func StartHub(streams step.OutStreams) (err error)

func UILoop

func UILoop(stream receiver, verbose bool) (*idl.Response, error)

Types

type DatabaseInfo

type DatabaseInfo struct {
	Datname        string
	QuotedDatname  string
	NumSeedScripts int
}

func GetDatabases

func GetDatabases(db *sql.DB, seedDirFS fs.FS) ([]DatabaseInfo, error)

type Script

type Script struct {
	Num  uint64
	Name string
}

type Scripts

type Scripts []Script

func ParseSelection

func ParseSelection(input string, allScripts Scripts) (Scripts, error)

func (Scripts) Description

func (scripts Scripts) Description() string

func (Scripts) Find

func (scripts Scripts) Find(num uint64) Script

func (Scripts) Len

func (scripts Scripts) Len() int

func (Scripts) Less

func (scripts Scripts) Less(i, j int) bool

func (Scripts) Names

func (scripts Scripts) Names() []string

func (Scripts) String

func (scripts Scripts) String() string

func (Scripts) Swap

func (scripts Scripts) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL