Add default dialer #8

Merged
fyrchik merged 1 commit from dstepanov-yadro/multinet:feat/default_dialer into master 2024-09-04 19:51:22 +00:00

Add default dialer to substitute net.Dial.

Closes #3

Add default dialer to substitute `net.Dial`. Closes #3
dstepanov-yadro reviewed 2023-10-30 10:32:42 +00:00
default.go Outdated
@ -0,0 +14,4 @@
func init() {
var err error
defaultDialer, err = NewDialer(Config{
Balancer: BalancerTypeRoundRobin,
Author
Member

It looks like if balancer will be noop then there is no difference with net.Dial

It looks like if balancer will be `noop` then there is no difference with `net.Dial`
dstepanov-yadro requested review from storage-core-committers 2023-10-30 10:32:54 +00:00
dstepanov-yadro requested review from storage-core-developers 2023-10-30 10:32:54 +00:00
acid-ant approved these changes 2023-10-30 11:20:48 +00:00
fyrchik reviewed 2023-10-30 13:06:47 +00:00
default.go Outdated
@ -0,0 +15,4 @@
var err error
defaultDialer, err = NewDialer(Config{
Balancer: BalancerTypeRoundRobin,
Subnets: []string{"0.0.0.0/0", "0000:0000:0000:0000:0000:0000:0000:0000/0"},
Owner

Does ::/0 or ::0/0work?

Does `::/0` or `::0/0`work?
Author
Member

yes, fixed

yes, fixed
fyrchik marked this conversation as resolved
default_test.go Outdated
@ -0,0 +9,4 @@
)
func TestDefaultDialer(t *testing.T) {
conn, err := Dial("tcp", "s01.frostfs.devenv:8080")
Owner

We add devenv requirement to the integration, how setting up a small server in tests?

We add devenv requirement to the integration, how setting up a small server in tests?
Author
Member

fixed

fixed
fyrchik marked this conversation as resolved
fyrchik reviewed 2023-10-30 13:15:20 +00:00
default.go Outdated
@ -0,0 +22,4 @@
}
}
// Dial dials provided network and address using defaule dialer.
Owner

s/defaule/default/

s/defaule/default/
Author
Member

fixed

fixed
fyrchik marked this conversation as resolved
dstepanov-yadro force-pushed feat/default_dialer from 4159d54f64 to 70349432df 2023-10-30 13:43:21 +00:00 Compare
aarifullin reviewed 2023-11-02 09:11:37 +00:00
default_test.go Outdated
@ -0,0 +16,4 @@
conn, err := Dial("tcp", "localhost:8080")
require.NoError(t, err)
if err == nil {
Member

err is already nil if it has just passed require.NoError(t, err)?

`err` is already `nil` if it has just passed `require.NoError(t, err)`?
Author
Member

Fixed

Fixed
aarifullin marked this conversation as resolved
fyrchik approved these changes 2023-11-02 09:24:44 +00:00
dstepanov-yadro force-pushed feat/default_dialer from 70349432df to 76e736f572 2023-11-02 10:26:14 +00:00 Compare
aarifullin approved these changes 2023-11-02 10:37:58 +00:00
fyrchik merged commit 76e736f572 into master 2023-11-02 11:59:06 +00:00
Sign in to join this conversation.
No description provided.