package pgpassfile
import "github.com/jackc/pgpassfile"
Package pgpassfile is a parser PostgreSQL .pgpass files.
Index ¶
Types ¶
type Entry ¶
Entry represents a line in a PG passfile.
type Passfile ¶
type Passfile struct { Entries []*Entry }
Passfile is the in memory data structure representing a PG passfile.
func ParsePassfile ¶
ParsePassfile reads r and parses it into a Passfile.
func ReadPassfile ¶
ReadPassfile reads the file at path and parses it into a Passfile.
func (*Passfile) FindPassword ¶
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.
Source Files ¶
- Version
- v1.0.0 (latest)
- Published
- Mar 30, 2019
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 3 minutes ago –
Tools for package owners.