Closed oleg-jukovec closed 7 months ago
The current interface:
func Connect(ctx context.Context, dialers map[string]tarantool.Dialer, connOpts tarantool.Opts) (*ConnectionPool, error)
It has two disadvantages:
I suggest a small refactoring:
Server
type Server struct { Id string Dialer tarantool.Dialer Opts tarantool.Opts }
pool.Connect
func Connect(ctx context.Context, servers ...Server) (*ConnectionPool, error)
pool.ConnectWithOpts
func ConnectWithOpts(ctx context.Context, opts Opts, servers ...Server) (*ConnectionPool, error)
pool.Add
func (p *ConnectionPool) Add(ctx context.Context, server Server) error
The current interface:
It has two disadvantages:
I suggest a small refactoring:
Server
type to the pool package, which would describe one server for a pool:pool.Connect
interface:pool.ConnectWithOpts
:pool.Add
: