Skip to content

Commit

Permalink
Move WithSharedBalancer option upper
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Golov committed Oct 25, 2024
1 parent b895142 commit 49287c9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

"github.com/ydb-platform/ydb-go-sdk/v3/config"
"github.com/ydb-platform/ydb-go-sdk/v3/credentials"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer"
balancerConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/certificates"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/conn"
Expand Down Expand Up @@ -600,6 +599,15 @@ func WithPanicCallback(panicCallback func(e interface{})) Option {
}
}

// WithSharedBalancer sets balancer from parent driver to child driver
func WithSharedBalancer(parent *Driver) Option {
return func(ctx context.Context, c *Driver) error {
c.balancer = parent.balancer

return nil
}
}

// WithTraceTable appends trace.Table into table traces
func WithTraceTable(t trace.Table, opts ...trace.TableComposeOption) Option { //nolint:gocritic
return func(ctx context.Context, c *Driver) error {
Expand Down Expand Up @@ -805,11 +813,3 @@ func withConnPool(pool *conn.Pool) Option {
return pool.Take(ctx)
}
}

func WithSharedBalancer(parent *Driver) Option {
return func(ctx context.Context, c *Driver) error {
c.balancer = parent.balancer

return nil
}
}

0 comments on commit 49287c9

Please sign in to comment.