Documentation
¶
Index ¶
- func AddOrUpdateProfile(p Profile, testConnection func(Profile) error) error
- func BuildDSN(p Profile) string
- func DeleteProfile(name string) error
- func ProfileExists(name string) (bool, error)
- func SaveConfig(cfg *ConfigFile) error
- func SetActiveProfile(name string) error
- type ConfigFile
- type Profile
- type SSHConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOrUpdateProfile ¶
func DeleteProfile ¶
func ProfileExists ¶
func SaveConfig ¶
func SaveConfig(cfg *ConfigFile) error
SaveConfig writes the YAML configuration file to disk.
func SetActiveProfile ¶
Types ¶
type ConfigFile ¶
type ConfigFile struct {
ActiveProfile string `yaml:"active_profile,omitempty"`
Profiles map[string]Profile `yaml:"profiles"`
}
func ListProfiles ¶
func ListProfiles() (*ConfigFile, error)
func LoadConfig ¶
func LoadConfig() (*ConfigFile, error)
LoadConfig reads ~/.pgtransfer/config.yaml or initializes a new one.
type Profile ¶
type Profile struct {
Name string `yaml:"name"`
User string `yaml:"user,omitempty"`
Password string `yaml:"password,omitempty"`
Host string `yaml:"host,omitempty"`
Port int `yaml:"port,omitempty"`
Database string `yaml:"database,omitempty"`
SSLMode string `yaml:"sslmode,omitempty"`
DBURL string `yaml:"dburl,omitempty"`
SSH SSHConfig `yaml:"ssh,omitempty"`
}
func GetActiveProfile ¶
type SSHConfig ¶
type SSHConfig struct {
Enabled bool `yaml:"enabled"`
User string `yaml:"user,omitempty"`
Host string `yaml:"host,omitempty"`
Port int `yaml:"port,omitempty"`
KeyPath string `yaml:"key_path,omitempty"`
Passphrase string `yaml:"passphrase,omitempty"`
Password string `yaml:"password,omitempty"`
Timeout int `yaml:"timeout,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.