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 3, in which 2 are exported)
ParsePassfile reads r and parses it into a Passfile.
ReadPassfile reads the file at path and parses it into a Passfile.
parseLine parses a line into an *Entry. It returns nil on comment lines or any other unparsable
line.
Package-Level Variables (only one, which is unexported)
Match (not colons or escaped colon or escaped backslash)+. Essentially gives a split on unescaped
colon.
The pages are generated with Goldsv0.7.6. (GOOS=linux GOARCH=amd64)