MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / authFileContents

Function authFileContents

internal/pgbouncer/config.go:67–78  ·  view source on GitHub ↗

authFileContents returns a PgBouncer user database.

(password string)

Source from the content-addressed store, hash-verified

65
66// authFileContents returns a PgBouncer user database.
67func authFileContents(password string) []byte {
68 // > There should be at least 2 fields, surrounded by double quotes.
69 // > Double quotes in a field value can be escaped by writing two double quotes.
70 // - https://www.pgbouncer.org/config.html#authentication-file-format
71 quote := func(s string) string {
72 return `"` + strings.ReplaceAll(s, `"`, `""`) + `"`
73 }
74
75 user1 := quote(PostgresqlUser) + " " + quote(password) + "\n"
76
77 return []byte(user1)
78}
79
80func clusterINI(ctx context.Context, cluster *v1beta1.PostgresCluster) string {
81 var (

Callers 2

TestAuthFileContentsFunction · 0.85
SecretFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestAuthFileContentsFunction · 0.68