pgpass

package
v1.20.5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

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