package pqutil
import "github.com/lib/pq/internal/pqutil"
Index ¶
- Variables
- func ErrNotExists(err error) bool
- func Home() string
- func Join[S ~[]E, E ~string](s S) string
- func ParseBool(str string) (bool, error)
- func Pgpass(passfile string) string
- func SSLKeyPermissions(sslkey string) error
- func User() (string, error)
Variables ¶
var ( ErrSSLKeyUnknownOwnership = errors.New("unused") ErrSSLKeyHasWorldPermissions = errors.New("unused") )
Functions ¶
func ErrNotExists ¶
ErrNotExists reports if err is a "path doesn't exist" type error.
fs.ErrNotExist is not enough, as "/dev/null/somefile" will return ENOTDIR instead of ENOENT.
func Home ¶
func Home() string
Home gets the PostgreSQL configuration dir in the user's home directory: %APPDATA%/postgresql on Windows, and $HOME/.postgresql/postgresql.crt everywhere else.
Returns an empy string if no home directory was found.
Matches pqGetHomeDirectory() from PostgreSQL. https://github.com/postgres/postgres/blob/2b117bb/src/interfaces/libpq/fe-connect.c#L8214
func Join ¶
func ParseBool ¶
ParseBool is like strconv.ParseBool, but also accepts "yes"/"no" and "on"/"off".
func Pgpass ¶
Pgpass gets the filepath to the pgpass file to use, returning "" if a pgpass file shouldn't be used.
func SSLKeyPermissions ¶
func User ¶
Source Files ¶
path.go perm_unsupported.go pqutil.go user_windows.go
- Version
- v1.12.0
- Published
- Mar 18, 2026
- Platform
- windows/amd64
- Imports
- 10 packages
- Last checked
- 17 minutes ago –
Tools for package owners.