pgpass

package
v1.27.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2025 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pgpass allows the user to generate a PostgreSQL .pgpass file See: https://www.postgresql.org/docs/current/libpq-pgpass.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionInfo

type ConnectionInfo struct {
	// contains filtered or unexported fields
}

ConnectionInfo contains the information identifying a PostgreSQL server whom credentials need to be included in a pgpass file

func NewConnectionInfo

func NewConnectionInfo(
	connectionParameters map[string]string,
	password string,
) (result ConnectionInfo)

NewConnectionInfo builds a new NewConnectionInfo from a set of connection parameters and the corresponding password

func (ConnectionInfo) BuildLine

func (info ConnectionInfo) BuildLine() string

BuildLine builds a pgPass configuration file line

type Data

type Data struct {
	// contains filtered or unexported fields
}

Data represents the contents of a pgpass file

func Empty

func Empty() *Data

Empty creates an empty pgpass file content

func From

func From(lines ...ConnectionInfo) *Data

From creates a new pgpass file content with the specified lines

func (*Data) WithLine

func (data *Data) WithLine(line ConnectionInfo) *Data

WithLine appends a line to an existing pgpass file content

func (*Data) Write

func (data *Data) Write(fileName string) error

Write writes the content of this data file into the chosen file name, truncating if existing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL