config

package
v1.23.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package config contains the code related to the generation of the PgBouncer configuration

Index

Constants

View Source
const (
	// ConfigsDir is the directory in which all pgbouncer configurations are
	ConfigsDir = postgres.ScratchDataDirectory + "/configs"

	// PgBouncerIniFileName is the name of PgBouncer configuration file
	PgBouncerIniFileName = "pgbouncer.ini"
	// PgBouncerHBAConfFileName is the name of PgBouncer Host Based Authentication file
	PgBouncerHBAConfFileName = "pg_hba.conf"
	// PgBouncerUserListFileName is the name of PgBouncer user list file
	PgBouncerUserListFileName = "userlist.txt"
	// PgBouncerAdminUser is the default admin user for pgbouncer
	PgBouncerAdminUser = "pgbouncer"
	// PgBouncerSocketDir is the directory in which pgbouncer socket is
	PgBouncerSocketDir = postgres.SocketDirectory
	// PgBouncerPort is the port where pgbouncer will be listening
	PgBouncerPort = 5432
	// PgBouncerPortName is the name of the port where pgbouncer will be listening
	PgBouncerPortName = "pgbouncer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigurationFiles

type ConfigurationFiles map[string][]byte

ConfigurationFiles is a set of configuration files that are needed for pgbouncer to work

func BuildConfigurationFiles

func BuildConfigurationFiles(pooler *apiv1.Pooler, secrets *Secrets) (ConfigurationFiles, error)

BuildConfigurationFiles create the config files containing the pgbouncer configuration and the users file

type ErrorUnknownSecretType

type ErrorUnknownSecretType struct {
	DeclaredType corev1.SecretType
	Keys         []string
}

ErrorUnknownSecretType is raised when the detection of a Secret type failed

func NewErrorUnknownSecretType

func NewErrorUnknownSecretType(secret *corev1.Secret) *ErrorUnknownSecretType

NewErrorUnknownSecretType returns a new error structure from the content of a secret

func (*ErrorUnknownSecretType) Error

func (e *ErrorUnknownSecretType) Error() string

Error implements the error interface

type Secrets

type Secrets struct {
	// The secret containing the credentials to be used to execute the auth_query queries.
	AuthQuery *corev1.Secret

	// The TLS secret that will be used for client connections (application-side)
	Client *corev1.Secret

	// The root-CA that will be used to validate client certificates
	ClientCA *corev1.Secret

	// The CA that will be used to validate the connections to PostgreSQL
	ServerCA *corev1.Secret
}

Secrets is the set of data that is needed to compute a PgBouncer configuration

Jump to

Keyboard shortcuts

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