API defines a general interface for interacting with the Patroni API.
| 17 | |
| 18 | // API defines a general interface for interacting with the Patroni API. |
| 19 | type API interface { |
| 20 | // ChangePrimaryAndWait tries to demote the current Patroni leader. It |
| 21 | // returns true when an election completes successfully. When Patroni is |
| 22 | // paused, next cannot be blank. |
| 23 | ChangePrimaryAndWait(ctx context.Context, current, next string) (bool, error) |
| 24 | |
| 25 | // ReplaceConfiguration replaces Patroni's entire dynamic configuration. |
| 26 | ReplaceConfiguration(ctx context.Context, configuration map[string]any) error |
| 27 | } |
| 28 | |
| 29 | // Executor implements API by calling "patronictl". |
| 30 | type Executor func( |
no outgoing calls
no test coverage detected