Skip to content

Commit

Permalink
Fix type forwarding for sqlx
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Sinelnikov committed Sep 15, 2020
1 parent a78c611 commit 7f5cf1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions sqlx/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
}
11 changes: 6 additions & 5 deletions sqlx/forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7f5cf1a

Please sign in to comment.