Documentation ¶
Index ¶
- Variables
- func AtomicallyWrite(path string, data []byte) (err error)
- func FilterEnv(keys []string) []string
- func GetAddMirrorsConfig() string
- func GetCoordinatorPostUpgradeBackupDir(backupDir string) string
- func GetCoordinatorPreUpgradeBackupDir(backupDir string) string
- func GetDataMigrationSeedDir() string
- func GetDefaultGeneratedDataMigrationScriptsDir() (string, error)
- func GetGpupgradePath() (string, error)
- func GetInitsystemConfig() string
- func GetJSONFile(stateDir string, fileName string) (path string, err error)
- func GetLogDir() (string, error)
- func GetOldTablespacesFile(backupDir string) string
- func GetPgUpgradeDir(role string, contentID int32, pgUpgradeTimeStamp string, targetVersion string) (string, error)
- func GetStateDir() string
- func GetStateDirOldTablespacesFile() string
- func GetTablespaceBackupDir(backupDir string) string
- func Move(src string, dst string) error
- func RemoveDuplicates(input []string) []string
- func ResetSystemFunctions()
- func Sanitize(ports []int) []int
- type NextActionErr
- type SystemFunctions
- type TableRows
Constants ¶
This section is empty.
Variables ¶
var ( System = InitializeSystemFunctions() Bold = color.New(color.Bold) StdinReader = bufio.NewReader(os.Stdin) )
Functions ¶
func AtomicallyWrite ¶
func FilterEnv ¶
FilterEnv selects only the specified variables from the environment and returns those key/value pairs, in the key=value format expected by os/exec.Cmd.Env.
func GetAddMirrorsConfig ¶
func GetAddMirrorsConfig() string
func GetDataMigrationSeedDir ¶
func GetDataMigrationSeedDir() string
func GetGpupgradePath ¶
func GetInitsystemConfig ¶
func GetInitsystemConfig() string
func GetJSONFile ¶
Returns path to a JSON file, and if one does not exist it creates an empty JSON file.
func GetOldTablespacesFile ¶
GetOldTablespacesFile is the file location used when backing up the user defined coordinator tablespaces. To upgrade tablespaces from 5->6 the --old-tablespaces-file is needed by pg_upgrade.
func GetPgUpgradeDir ¶
func GetStateDir ¶
func GetStateDir() string
func GetStateDirOldTablespacesFile ¶
func GetStateDirOldTablespacesFile() string
GetStateDirOldTablespacesFile is the file location used when creating the old tablespaces file. To upgrade tablespaces from 5->6 the --old-tablespaces-file is needed by pg_upgrade.
func GetTablespaceBackupDir ¶
func Move ¶
Calling os.Rename for a directory is allowed only when both the source and the destination path are on the top layer of filesystem. Otherwise, it returns EXDEV error ("cross-device link not permitted"). To avoid such case, use the Move utility instead of os.Rename. Found this issue on docker containers, when os.Rename was being used to archive the gpupgrade log directory.
func RemoveDuplicates ¶
RemoveDuplicates removes any duplicates while preserving order
func ResetSystemFunctions ¶
func ResetSystemFunctions()
Types ¶
type NextActionErr ¶
NextActionErr attaches the Help method to an existing error. This is used to tell the CLI's top level to print additional helper text AFTER the error message is printed.
func NewNextActionErr ¶
func NewNextActionErr(err error, nextAction string) NextActionErr
func (NextActionErr) Error ¶
func (n NextActionErr) Error() string
func (NextActionErr) Help ¶
func (n NextActionErr) Help() string
type SystemFunctions ¶
type SystemFunctions struct { Current func() (*user.User, error) Getenv func(key string) string Getpid func() int Hostname func() (string, error) IsNotExist func(err error) bool LookupIP func(host string) ([]net.IP, error) MkdirAll func(path string, perm os.FileMode) error Now func() time.Time Open func(name string) (*os.File, error) OpenFile func(name string, flag int, perm os.FileMode) (*os.File, error) Remove func(name string) error RemoveAll func(name string) error Rename func(oldpath, newpath string) error ReadFile func(filename string) ([]byte, error) ReadFileFS func(fs.FS, string) ([]byte, error) WriteFile func(filename string, data []byte, perm os.FileMode) error Stat func(name string) (os.FileInfo, error) FilePathGlob func(pattern string) ([]string, error) Create func(name string) (*os.File, error) Mkdir func(name string, perm os.FileMode) error Symlink func(oldname, newname string) error Lstat func(name string) (os.FileInfo, error) ReadDirFS func(fsys fs.FS, name string) ([]fs.DirEntry, error) StatFS func(fsys fs.FS, name string) (fs.FileInfo, error) DirFS func(dir string) fs.FS }
func InitializeSystemFunctions ¶
func InitializeSystemFunctions() *SystemFunctions
Directories ¶
Path | Synopsis |
---|---|
Package daemon provides utilities for programs that need to fork themselves into the background (for instance, a persistent server).
|
Package daemon provides utilities for programs that need to fork themselves into the background (for instance, a persistent server). |