authFileContents returns a PgBouncer user database.
(password string)
| 65 | |
| 66 | // authFileContents returns a PgBouncer user database. |
| 67 | func 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 | |
| 80 | func clusterINI(ctx context.Context, cluster *v1beta1.PostgresCluster) string { |
| 81 | var ( |
no outgoing calls