certFile concatenates the results of multiple PEM-encoding marshalers.
(texts ...encoding.TextMarshaler)
| 20 | |
| 21 | // certFile concatenates the results of multiple PEM-encoding marshalers. |
| 22 | func certFile(texts ...encoding.TextMarshaler) ([]byte, error) { |
| 23 | var out []byte |
| 24 | |
| 25 | for i := range texts { |
| 26 | if b, err := texts[i].MarshalText(); err == nil { |
| 27 | out = append(out, b...) |
| 28 | } else { |
| 29 | return nil, err |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | return out, nil |
| 34 | } |
| 35 | |
| 36 | // instanceCertificates returns projections of Patroni's CAs, keys, and |
| 37 | // certificates to include in the instance configuration volume. |