package pgpassfile
Import Path
github.com/jackc/pgpassfile (on go.dev)
Dependency Relation
imports 5 packages, and imported by one package
Involved Source Files
Package pgpassfile is a parser PostgreSQL .pgpass files.
Package-Level Type Names (total 2)
Entry represents a line in a PG passfile.
Database string
Hostname string
Password string
Port string
Username string
Passfile is the in memory data structure representing a PG passfile.
Entries []*Entry
FindPassword finds the password for the provided hostname, port, database, and username. For a
Unix domain socket hostname must be set to "localhost". An empty string will be returned if no
match is found.
See https://www.postgresql.org/docs/current/libpq-pgpass.html for more password file information.
func ParsePassfile(r io.Reader) (*Passfile, error)
func ReadPassfile(path string) (*Passfile, error)
Package-Level Functions (total 2)
ParsePassfile reads r and parses it into a Passfile.
ReadPassfile reads the file at path and parses it into a Passfile.
![]() |
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |