utils

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorReset  = "\033[0m"
	ColorRed    = "\033[31m"
	ColorGreen  = "\033[32m"
	ColorYellow = "\033[33m"
	ColorBlue   = "\033[34m"
	ColorCyan   = "\033[36m"
	ColorGray   = "\033[90m"
	ColorBold   = "\033[1m"
)

Variables

This section is empty.

Functions

func ColorTextBlue

func ColorTextBlue(s string) string

func ColorTextBold

func ColorTextBold(s string) string

func ColorTextCyan

func ColorTextCyan(s string) string

func ColorTextGray

func ColorTextGray(s string) string

func ColorTextGreen

func ColorTextGreen(s string) string

Inline color helpers for other packages (e.g., log viewer)

func ColorTextRed

func ColorTextRed(s string) string

func ColorTextYellow

func ColorTextYellow(s string) string

func FormatDuration

func FormatDuration(d time.Duration) string

func GetConfigDir

func GetConfigDir() string

GetConfigDir returns the ~/.pgtransfer directory path

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns the full path to ~/.pgtransfer/config.yaml

func GetDefaultDumpPath

func GetDefaultDumpPath(dbName string) (string, error)

GetDefaultDumpPath builds a timestamped SQL dump path under ~/.pgtransfer/dumps/

func GetDefaultExportPath

func GetDefaultExportPath(table string) (string, error)

GetDefaultExportPath builds a timestamped export CSV path under ~/.pgtransfer/exports/

func GetLogDir

func GetLogDir() string

func PrintDivider

func PrintDivider(cmd *cobra.Command)

PrintDivider prints a cyan horizontal divider.

func PrintError

func PrintError(cmd *cobra.Command, format string, args ...interface{})

PrintError prints a red error message.

func PrintInfo

func PrintInfo(cmd *cobra.Command, format string, args ...interface{})

PrintInfo prints a cyan informational message.

func PrintMuted

func PrintMuted(cmd *cobra.Command, format string, args ...interface{})

PrintMuted prints a gray, low-importance message.

func PrintNote

func PrintNote(cmd *cobra.Command, format string, args ...interface{})

PrintNote prints a blue note-style message.

func PrintSuccess

func PrintSuccess(cmd *cobra.Command, format string, args ...interface{})

PrintSuccess prints a green success message.

func PrintTitle

func PrintTitle(cmd *cobra.Command, title string)

PrintTitle prints a bold section title, often used for CLI headers.

func PrintWarning

func PrintWarning(cmd *cobra.Command, format string, args ...interface{})

PrintWarning prints a yellow warning message.

func ReadPrivateKey deprecated

func ReadPrivateKey(path string) ([]byte, error)

ReadPrivateKey reads an SSH private key file from disk.

Deprecated: use sshx.ReadPrivateKey directly.

Types

This section is empty.

Jump to

Keyboard shortcuts

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