Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnConfig ¶
type ConnConfig struct {
Host string
Port string
Username string
Password string
SSLMode string // disable, allow, prefer, require, verify-ca, verify-full
SSLCert string // path to client certificate file (PEM)
SSLKey string // path to client private key file (PEM)
SSLRootCert string // path to root CA certificate file (PEM)
}
ConnConfig holds the connection parameters shared by all PostgreSQL connectors.
func ParseConnConfig ¶
func ParseConnConfig(config map[string]string) (ConnConfig, string, error)
ParseConnConfig parses host, port, username, and password from the "location" URI and from standalone config keys. Standalone keys override URI components. The path component of the URI (i.e. the database name) is returned separately so callers can handle it as appropriate (use it, reject it, or ignore it).
func (ConnConfig) Args ¶
func (c ConnConfig) Args() []string
Args returns the common connection flags shared by all PostgreSQL client tools: -h host -p port -w, plus -U username when one is configured.
func (ConnConfig) Env ¶
func (c ConnConfig) Env() []string
Env returns the current process environment with PostgreSQL authentication and TLS variables injected when configured.