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

Method Encode

pkg/utils/parser.go:238–245  ·  view source on GitHub ↗

Encode encodes the token content into a base64 string

()

Source from the content-addressed store, hash-verified

236
237// Encode encodes the token content into a base64 string
238func (token *PgControldataTokenContent) Encode() (string, error) {
239 tokenJSON, err := json.Marshal(token)
240 if err != nil {
241 return "", err
242 }
243
244 return base64.StdEncoding.EncodeToString(tokenJSON), nil
245}
246
247// ErrInvalidPromotionToken is raised when the promotion token
248// is not valid

Callers 4

sendLogsToWriterMethod · 0.80
buildJdbcMethod · 0.80
sendJSONResponseFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected