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.3.2-preview. (GOOS=darwin 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.