MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / ParsePgControldataOutput

Function ParsePgControldataOutput

pkg/utils/parser.go:163–174  ·  view source on GitHub ↗

ParsePgControldataOutput parses a pg_controldata output into a map of key-value pairs

(data string)

Source from the content-addressed store, hash-verified

161
162// ParsePgControldataOutput parses a pg_controldata output into a map of key-value pairs
163func ParsePgControldataOutput(data string) PgControlData {
164 pairs := make(map[string]string)
165 lines := strings.Split(data, "\n")
166 for _, line := range lines {
167 key, value, done := strings.Cut(line, ":")
168 if !done {
169 continue
170 }
171 pairs[strings.TrimSpace(key)] = strings.TrimSpace(value)
172 }
173 return pairs
174}
175
176// TODO(leonardoce): I believe that the code about the promotion token
177// belongs to a different package

Callers 10

enrichSnapshotMethod · 0.92
reconciler_test.goFile · 0.92
generateDemotionTokenFunction · 0.92
pgArchivePartialMethod · 0.92
getControlDataFunction · 0.92
verifyPromotionTokenMethod · 0.92
parser_test.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected