Skip to content

Commit d9bd5d4

Browse files
committed
move default constants fo internal,
mark them deprecated
1 parent f2709fd commit d9bd5d4

File tree

2 files changed

+59
-11
lines changed

2 files changed

+59
-11
lines changed

config/defaults.go

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,58 @@ package config
33
import (
44
"crypto/tls"
55
"crypto/x509"
6-
"time"
76

87
"google.golang.org/grpc"
98
grpcCredentials "google.golang.org/grpc/credentials"
109
"google.golang.org/grpc/credentials/insecure"
11-
"google.golang.org/grpc/keepalive"
1210

1311
"github.com/ydb-platform/ydb-go-sdk/v3/balancers"
1412
"github.com/ydb-platform/ydb-go-sdk/v3/credentials"
13+
"github.com/ydb-platform/ydb-go-sdk/v3/internal/config"
1514
"github.com/ydb-platform/ydb-go-sdk/v3/internal/stack"
1615
"github.com/ydb-platform/ydb-go-sdk/v3/trace"
1716
)
1817

1918
var (
2019
// DefaultKeepaliveInterval contains default duration between grpc keepalive
21-
DefaultKeepaliveInterval = 10 * time.Second
22-
MinKeepaliveInterval = 10 * time.Second
23-
DefaultDialTimeout = 5 * time.Second
24-
DefaultGRPCMsgSize = 64 * 1024 * 1024 // 64MB
25-
DefaultGrpcConnectionPolicy = keepalive.ClientParameters{
26-
Time: DefaultKeepaliveInterval,
27-
Timeout: MinKeepaliveInterval,
28-
PermitWithoutStream: true,
29-
}
20+
//
21+
// Will be removed after Aug 2024.
22+
// Write Issue if you need the variable https://github.com/ydb-platform/ydb-go-sdk/issues/new/choose
23+
// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
24+
DefaultKeepaliveInterval = config.DefaultKeepaliveInterval // 10 * time.Second
25+
26+
// MinKeepaliveInterval
27+
//
28+
// Will be removed after Aug 2024.
29+
// Write Issue if you need the variable https://github.com/ydb-platform/ydb-go-sdk/issues/new/choose
30+
// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
31+
MinKeepaliveInterval = config.MinKeepaliveInterval // 10 * time.Second
32+
33+
// DefaultDialTimeout
34+
//
35+
// Will be removed after Aug 2024.
36+
// Write Issue if you need the variable https://github.com/ydb-platform/ydb-go-sdk/issues/new/choose
37+
// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
38+
DefaultDialTimeout = config.DefaultDialTimeout // 5 * time.Second
39+
40+
// DefaultGRPCMsgSize
41+
//
42+
// Will be removed after Aug 2024.
43+
// Write Issue if you need the variable https://github.com/ydb-platform/ydb-go-sdk/issues/new/choose
44+
// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
45+
DefaultGRPCMsgSize = config.DefaultGRPCMsgSize // 64 * 1024 * 1024 // 64MB
46+
47+
// DefaultGrpcConnectionPolicy
48+
//
49+
// Will be removed after Aug 2024.
50+
// Write Issue if you need the variable https://github.com/ydb-platform/ydb-go-sdk/issues/new/choose
51+
// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
52+
DefaultGrpcConnectionPolicy = config.DefaultGrpcConnectionPolicy
53+
//DefaultGrpcConnectionPolicy = keepalive.ClientParameters{
54+
// Time: DefaultKeepaliveInterval,
55+
// Timeout: MinKeepaliveInterval,
56+
// PermitWithoutStream: true,
57+
//}
3058
)
3159

3260
func defaultGrpcOptions(secure bool, tlsConfig *tls.Config) (opts []grpc.DialOption) {

internal/config/defaults.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package config
2+
3+
import (
4+
"time"
5+
6+
"google.golang.org/grpc/keepalive"
7+
)
8+
9+
var (
10+
// DefaultKeepaliveInterval contains default duration between grpc keepalive
11+
DefaultKeepaliveInterval = 10 * time.Second
12+
MinKeepaliveInterval = 10 * time.Second
13+
DefaultDialTimeout = 5 * time.Second
14+
DefaultGRPCMsgSize = 64 * 1024 * 1024 // 64MB
15+
DefaultGrpcConnectionPolicy = keepalive.ClientParameters{
16+
Time: DefaultKeepaliveInterval,
17+
Timeout: MinKeepaliveInterval,
18+
PermitWithoutStream: true,
19+
}
20+
)

0 commit comments

Comments
 (0)