Versions in this module Expand all Collapse all v1 v1.1.0 Aug 27, 2025 v1.0.0 Aug 14, 2025 Changes in this version + const DefaultPostgresPort + const ErrNotFound + const PostgresPrimaryRole + const PostgresStandbyRole + type Admin struct + func (a *Admin) Close() + func (a *Admin) ConfigureAsyncMode(ctx context.Context, addr string) error + func (a *Admin) ConfigureStandby(ctx context.Context, ...) error + func (a *Admin) ConfigureSyncMode(ctx context.Context, addr, standbyList string) error + func (a *Admin) Connections() IAdminConnections + func (a *Admin) GetReplicationStatus(ctx context.Context) *ReplicationInfo + type AdminConnections struct + func (cnx *AdminConnections) Add(addr string) error + func (cnx *AdminConnections) AddAll(addrs []string) + func (cnx *AdminConnections) Get(addr string) (IClient, error) + func (cnx *AdminConnections) GetAll() map[string]IClient + func (cnx *AdminConnections) GetSelected(addrs []string) map[string]IClient + func (cnx *AdminConnections) Reconnect(addr string) error + func (cnx *AdminConnections) Remove(addr string) + func (cnx *AdminConnections) ReplaceAll(addrs []string) + func (cnx *AdminConnections) Reset() + type AdminOptions struct + ConnectionTimeout int + Password string + Username string + type Client struct + func (c *Client) Close() error + func (c *Client) Exec(ctx context.Context, query string, args ...any) (sql.Result, error) + func (c *Client) Query(ctx context.Context, query string, args ...any) (*sql.Rows, error) + func (c *Client) QueryRow(ctx context.Context, input interface{}, query string, args ...any) error + type IAdmin interface + Close func() + ConfigureAsyncMode func(ctx context.Context, addr string) error + ConfigureStandby func(ctx context.Context, ...) error + ConfigureSyncMode func(ctx context.Context, addr, standbyList string) error + Connections func() IAdminConnections + GetReplicationStatus func(ctx context.Context) *ReplicationInfo + func NewAdmin(addrs []string, options *AdminOptions, log logr.Logger) IAdmin + type IAdminConnections interface + Add func(addr string) error + AddAll func(addrs []string) + Get func(addr string) (IClient, error) + GetAll func() map[string]IClient + GetSelected func(addrs []string) map[string]IClient + Reconnect func(addr string) error + Remove func(addr string) + ReplaceAll func(addrs []string) + Reset func() + func NewAdminConnections(addrs []string, options *AdminOptions, log logr.Logger) IAdminConnections + type IClient interface + Close func() error + Exec func(ctx context.Context, query string, args ...any) (sql.Result, error) + Query func(ctx context.Context, query string, args ...any) (*sql.Rows, error) + QueryRow func(ctx context.Context, input interface{}, query string, args ...any) error + func NewClient(addr, username, password string, timeout int) (IClient, error) + type Node struct + DataDir string + Host string + Port int + ReplicationMode string + ReplicationStat []string + Role string + WalDiff int + func NewDefaultNode() *Node + func (n *Node) GetRole() composev1alpha1.PostgresReplicationRole + func (n *Node) HostPort() string + type Nodes []*Node + type ReplicationInfo struct + Nodes map[string]*Node + func NewReplicationInfo() *ReplicationInfo