MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / API

Interface API

internal/patroni/api.go:19–27  ·  view source on GitHub ↗

API defines a general interface for interacting with the Patroni API.

Source from the content-addressed store, hash-verified

17
18// API defines a general interface for interacting with the Patroni API.
19type 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".
30type Executor func(

Calls

no outgoing calls

Tested by

no test coverage detected