Encode encodes the token content into a base64 string
()
| 236 | |
| 237 | // Encode encodes the token content into a base64 string |
| 238 | func (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 |
no outgoing calls
no test coverage detected