diff --git a/sqlx/cluster.go b/sqlx/cluster.go index e2fad44..2bf1ac3 100644 --- a/sqlx/cluster.go +++ b/sqlx/cluster.go @@ -70,8 +70,8 @@ func (cl *Cluster) WaitForStandbyPreferred(ctx context.Context) (Node, error) { } // WaitForNode with specified status to appear or until context is canceled -func (cl *Cluster) WaitForNode(ctx context.Context, ns NodeStatus) (Node, error) { - return checkedSQLxNode(cl.Cluster.WaitForNode(ctx, ns)) +func (cl *Cluster) WaitForNode(ctx context.Context, criteria NodeStateCriteria) (Node, error) { + return checkedSQLxNode(cl.Cluster.WaitForNode(ctx, criteria)) } // Alive returns node that is considered alive @@ -100,6 +100,6 @@ func (cl *Cluster) StandbyPreferred() Node { } // Node returns cluster node with specified status. -func (cl *Cluster) Node(ns NodeStatus) Node { - return uncheckedSQLxNode(cl.Cluster.Node(ns)) +func (cl *Cluster) Node(criteria NodeStateCriteria) Node { + return uncheckedSQLxNode(cl.Cluster.Node(criteria)) } diff --git a/sqlx/forward.go b/sqlx/forward.go index e6ea25a..74ac8d4 100644 --- a/sqlx/forward.go +++ b/sqlx/forward.go @@ -21,11 +21,12 @@ import "golang.yandex/hasql" //nolint:golint // Forwarded types type ( - ClusterOption = hasql.ClusterOption - NodeStatus = hasql.NodeStateCriteria - NodeChecker = hasql.NodeChecker - NodePicker = hasql.NodePicker - Tracer = hasql.Tracer + ClusterOption = hasql.ClusterOption + NodeStateCriteria = hasql.NodeStateCriteria + NodeChecker = hasql.NodeChecker + NodePicker = hasql.NodePicker + AliveNodes = hasql.AliveNodes + Tracer = hasql.Tracer ) // Forwarded variables and functions