Documentation
¶
Overview ¶
Package pvm logging.go from github.com/fergusstrange/embedded-postgres and modified (so should be considered under same license)
Package pvm these functions from github.com/fergusstrange/embedded-postgres and modified (so should be considered under same license)
Package pvm version_strategy.go from github.com/fergusstrange/embedded-postgres and modified (so should be considered under same license)
Index ¶
- Constants
- Variables
- func DownloadSubcommand(args *Args, cacheLocation *string) error
- func EnvSubcommand(config *ConfigStruct) string
- func FieldAndValueWhenNonDefaultValue(configStruct *ConfigStruct) map[string]interface{}
- func GetPathSubcommand(directoryToFind *string, config *ConfigStruct) (string, error)
- func InstallServiceSubcommand(args *Args) error
- func InstallSubcommand(args *Args, cacheLocation *string) error
- func LsRemoteSubcommand(args *Args) error
- func LsSubcommand(args *Args) error
- func PingSubcommand(config *ConfigStruct) error
- func PostgresVersionFromLocalOrGlobal(localOptionPostgresVersion, postgresVersion, BinariesPath string) (string, error)
- func ReloadPostgres(config *ConfigStruct) error
- func SaveConfig(args *Args) error
- func SetDefaultsFromEnvironment(args *Args, userHomeDir *string)
- func SetField(obj interface{}, name string, value interface{}) error
- func SetVersionAndDirectories(args *Args) error
- func StartSubcommand(args *Args, cacheLocation *string) error
- func StopPostgres(config *ConfigStruct) error
- func UriSubcommand(config *ConfigStruct) string
- type Args
- type CacheLocator
- type ConfigStruct
- type ConfigStructs
- type DownloadCmd
- type EnvCmd
- type GetPathCmd
- type InstallCmd
- type InstallServiceCmd
- type InstallServiceForOpenRcCmd
- type InstallServiceForSystemdCmd
- type InstallServiceForWindowsCmd
- type LsCmd
- type LsRemoteCmd
- type Metadata
- type PingCmd
- type ReloadCmd
- type RemoteFetchStrategy
- type StartCmd
- type StopCmd
- type UriCmd
- type VersionStrategy
Constants ¶
const CmdQuoteChar = '\''
const NumberOfPostgresVersions uintptr = 140
Variables ¶
var PostgresVersions [NumberOfPostgresVersions]string = [NumberOfPostgresVersions]string{}/* 140 elements not displayed */
Functions ¶
func DownloadSubcommand ¶
func EnvSubcommand ¶
func EnvSubcommand(config *ConfigStruct) string
func FieldAndValueWhenNonDefaultValue ¶
func FieldAndValueWhenNonDefaultValue(configStruct *ConfigStruct) map[string]interface{}
func GetPathSubcommand ¶
func GetPathSubcommand(directoryToFind *string, config *ConfigStruct) (string, error)
func InstallSubcommand ¶
func LsRemoteSubcommand ¶
func LsSubcommand ¶
func PingSubcommand ¶
func PingSubcommand(config *ConfigStruct) error
func ReloadPostgres ¶
func ReloadPostgres(config *ConfigStruct) error
func SaveConfig ¶
SaveConfig will only perform write operations if the file is nonexistent or contains different values
func StartSubcommand ¶
func StopPostgres ¶
func StopPostgres(config *ConfigStruct) error
func UriSubcommand ¶
func UriSubcommand(config *ConfigStruct) string
Types ¶
type Args ¶
type Args struct {
ConfigStruct
ConfigFile string `arg:"-c,--config" help:"Config filepath to use"`
NoConfigRead bool `arg:"--no-config-read" default:"false" help:"Do not read the config file"`
NoConfigWrite bool `arg:"--no-config-write" default:"false" help:"Do not write to config file"`
NoRemote bool `arg:"--no-remote" default:"false" help:"Disable HTTPS calls for everything except 'install'"`
Download *DownloadCmd `arg:"subcommand:download" help:"Download specified PostgreSQL version"`
Env *EnvCmd `arg:"subcommand:env" help:"Print out associated environment variables"`
GetPath *GetPathCmd `arg:"subcommand:get-path" help:"One of: bin, data, log, runtime"`
Install *InstallCmd `arg:"subcommand:install" help:"Install specified PostgreSQL version"`
InstallService *InstallServiceCmd `arg:"subcommand:install-service" help:"Install service (daemon), e.g., systemd, openrc, windows-service"`
Ls *LsCmd `arg:"subcommand:ls" help:"List what versions of PostgreSQL are installed"`
LsRemote *LsRemoteCmd `arg:"subcommand:ls-remote" help:"List what versions of PostgreSQL are available"`
Ping *PingCmd `arg:"subcommand:ping" help:"Confirm server is online and auth works"`
Reload *ReloadCmd `arg:"subcommand:reload" help:"Reload specified PostgreSQL server"`
Start *StartCmd `arg:"subcommand:start" help:"Start specified PostgreSQL server"`
Stop *StopCmd `arg:"subcommand:stop" help:"Stop specific (running) PostgreSQL server"`
Uri *UriCmd `arg:"subcommand:uri" help:"Print out database connection string"`
}
func (Args) Description ¶
type CacheLocator ¶
CacheLocator retrieves the location of the Postgres binary cache returning it to location. The result of whether this cache is present will be returned to exists.
type ConfigStruct ¶
type ConfigStruct struct {
PostgresVersion string `arg:"--postgres-version,env:POSTGRES_VERSION" default:"latest" json:"-"`
Port uint32 `arg:"-p,env:PGPORT" default:"5432"`
Database string `arg:"-d,env:POSTGRES_DATABASE" default:"database"`
Username string `arg:"-u,env:POSTGRES_USERNAME" default:"username"`
Password string `arg:"env:POSTGRES_PASSWORD" default:"password"`
VersionManagerRoot string `arg:"--version-manager-root,env:VERSION_MANAGER_ROOT" placeholder:"VERSION_MANAGER_ROOT"`
RuntimePath string `arg:"--runtime-path,env:RUNTIME_PATH"`
DataPath string `arg:"--data-path,env:PGDATA"`
BinariesPath string `arg:"--binary-path,env:BINARY_PATH"`
LogsPath string `arg:"--logs-path,env:LOGS_PATH"`
Locale string `arg:"--locale,env:LC_ALL" default:"en_US.UTF-8"`
BinaryRepositoryURL string `arg:"--binary-repository-url,env:BINARY_REPOSITORY_URL" default:"https://repo1.maven.org/maven2"`
}
ConfigStruct originally from github.com/fergusstrange/[email protected]/config.go
func GetConfigFromFileOfConfigs ¶
func GetConfigFromFileOfConfigs(args *Args) (*ConfigStruct, error)
type ConfigStructs ¶
type ConfigStructs []ConfigStruct
func (ConfigStructs) MarshalJSON ¶
func (configs ConfigStructs) MarshalJSON() ([]byte, error)
func (*ConfigStructs) UnmarshalJSON ¶
func (configs *ConfigStructs) UnmarshalJSON(bytes []byte) error
type DownloadCmd ¶
type DownloadCmd struct {
PostgresVersion string `arg:"positional" placeholder:"POSTGRES_VERSION" default:""`
}
type GetPathCmd ¶
type GetPathCmd struct {
DirectoryToFind string `arg:"positional" help:"bin|data|log|runtime"`
}
type InstallCmd ¶
type InstallCmd struct {
PostgresVersion string `arg:"positional" placeholder:"POSTGRES_VERSION" default:""`
}
type InstallServiceCmd ¶
type InstallServiceCmd struct {
OpenRc *InstallServiceForOpenRcCmd `arg:"subcommand:openrc" help:"Install OpenRC service"`
Systemd *InstallServiceForSystemdCmd `arg:"subcommand:systemd" help:"Install systemd service"`
WindowsService *InstallServiceForWindowsCmd `arg:"subcommand:windows-service" help:"Install Windows Service"`
}
type InstallServiceForOpenRcCmd ¶
type InstallServiceForOpenRcCmd struct {
Group string `arg:"--group" default:"postgres"`
ConfigInstallPath string `arg:"--config-install-path" default:"/etc/conf.d/postgresql"`
ServiceInstallPath string `arg:"--service-install-path" default:"/etc/init.d/postgresql"`
User string `arg:"--user" default:"postgres"`
}
type LsRemoteCmd ¶
type LsRemoteCmd struct{}
type Metadata ¶
type Metadata struct {
XMLName xml.Name `xml:"metadata"`
Text string `xml:",chardata"`
GroupId string `xml:"groupId"`
ArtifactId string `xml:"artifactId"`
Versioning struct {
Text string `xml:",chardata"`
Latest string `xml:"latest"`
Release string `xml:"release"`
Versions struct {
Text string `xml:",chardata"`
Version []string `xml:"version"`
} `xml:"versions"`
LastUpdated string `xml:"lastUpdated"`
} `xml:"versioning"`
}
type PingCmd ¶
type PingCmd struct {
PostgresVersion string `arg:"positional" placeholder:"POSTGRES_VERSION" default:""`
}
type ReloadCmd ¶
type ReloadCmd struct {
PostgresVersion string `arg:"positional" placeholder:"POSTGRES_VERSION" default:""`
}
type RemoteFetchStrategy ¶
type RemoteFetchStrategy func() error
RemoteFetchStrategy provides a strategy to fetch a Postgres binary so that it is available for use.
type StopCmd ¶
type StopCmd struct {
PostgresVersion string `arg:"positional" placeholder:"POSTGRES_VERSION" default:""`
}
type VersionStrategy ¶
VersionStrategy provides a strategy that can be used to determine which version of Postgres should be used based on the operating system, architecture and desired Postgres version.