@@ -7,71 +7,71 @@ import (
77 "github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Coordination"
88)
99
10- // WithDescription returns an OpenSessionOption that specifies a user-defined description that may be used to describe
10+ // WithDescription returns an CreateSessionOption that specifies a user-defined description that may be used to describe
1111// the client.
12- func WithDescription (description string ) OpenSessionOption {
13- return func (c * OpenSessionOptions ) {
12+ func WithDescription (description string ) CreateSessionOption {
13+ return func (c * CreateSessionOptions ) {
1414 c .Description = description
1515 }
1616}
1717
18- // WithSessionTimeout returns an OpenSessionOption that specifies the timeout during which client may restore a
18+ // WithSessionTimeout returns an CreateSessionOption that specifies the timeout during which client may restore a
1919// detached session. The client is forced to terminate the session if the last successful session request occurred
2020// earlier than this time.
2121//
2222// If this is not set, the client uses the default 5 seconds.
23- func WithSessionTimeout (timeout time.Duration ) OpenSessionOption {
24- return func (c * OpenSessionOptions ) {
23+ func WithSessionTimeout (timeout time.Duration ) CreateSessionOption {
24+ return func (c * CreateSessionOptions ) {
2525 c .SessionTimeout = timeout
2626 }
2727}
2828
29- // WithSessionStartTimeout returns an OpenSessionOption that specifies the time that the client should wait for a
29+ // WithSessionStartTimeout returns an CreateSessionOption that specifies the time that the client should wait for a
3030// response to the StartSession request from the server before it terminates the gRPC stream and tries to reconnect.
3131//
3232// If this is not set, the client uses the default time 1 second.
33- func WithSessionStartTimeout (timeout time.Duration ) OpenSessionOption {
34- return func (c * OpenSessionOptions ) {
33+ func WithSessionStartTimeout (timeout time.Duration ) CreateSessionOption {
34+ return func (c * CreateSessionOptions ) {
3535 c .SessionStartTimeout = timeout
3636 }
3737}
3838
39- // WithSessionStopTimeout returns an OpenSessionOption that specifies the time that the client should wait for a
39+ // WithSessionStopTimeout returns an CreateSessionOption that specifies the time that the client should wait for a
4040// response to the StopSession request from the server before it terminates the gRPC stream and tries to reconnect.
4141//
4242// If this is not set, the client uses the default time 1 second.
43- func WithSessionStopTimeout (timeout time.Duration ) OpenSessionOption {
44- return func (c * OpenSessionOptions ) {
43+ func WithSessionStopTimeout (timeout time.Duration ) CreateSessionOption {
44+ return func (c * CreateSessionOptions ) {
4545 c .SessionStartTimeout = timeout
4646 }
4747}
4848
49- // WithSessionKeepAliveTimeout returns an OpenSessionOption that specifies the time that the client will wait before it
50- // terminates the gRPC stream and tries to reconnect if no successful responses have been received from the server.
49+ // WithSessionKeepAliveTimeout returns an CreateSessionOption that specifies the time that the client will wait before
50+ // it terminates the gRPC stream and tries to reconnect if no successful responses have been received from the server.
5151//
5252// If this is not set, the client uses the default time 10 seconds.
53- func WithSessionKeepAliveTimeout (timeout time.Duration ) OpenSessionOption {
54- return func (c * OpenSessionOptions ) {
53+ func WithSessionKeepAliveTimeout (timeout time.Duration ) CreateSessionOption {
54+ return func (c * CreateSessionOptions ) {
5555 c .SessionKeepAliveTimeout = timeout
5656 }
5757}
5858
59- // WithSessionReconnectDelay returns an OpenSessionOption that specifies the time that the client will wait before it
59+ // WithSessionReconnectDelay returns an CreateSessionOption that specifies the time that the client will wait before it
6060// tries to reconnect the underlying gRPC stream in case of error.
6161//
6262// If this is not set, the client uses the default time 500 milliseconds.
63- func WithSessionReconnectDelay (delay time.Duration ) OpenSessionOption {
64- return func (c * OpenSessionOptions ) {
63+ func WithSessionReconnectDelay (delay time.Duration ) CreateSessionOption {
64+ return func (c * CreateSessionOptions ) {
6565 c .SessionReconnectDelay = delay
6666 }
6767}
6868
69- // OpenSessionOption configures how we open a new session.
70- type OpenSessionOption func (c * OpenSessionOptions )
69+ // CreateSessionOption configures how we create a new session.
70+ type CreateSessionOption func (c * CreateSessionOptions )
7171
72- // OpenSessionOptions configure an OpenSession call. OpenSessionOptions are set by the OpenSessionOption values passed
73- // to the OpenSession function.
74- type OpenSessionOptions struct {
72+ // CreateSessionOptions configure an CreateSession call. CreateSessionOptions are set by the CreateSessionOption values
73+ // passed to the CreateSession function.
74+ type CreateSessionOptions struct {
7575 Description string
7676 SessionTimeout time.Duration
7777 SessionStartTimeout time.Duration
@@ -95,18 +95,18 @@ func WithEphemeral(ephemeral bool) AcquireSemaphoreOption {
9595// acquired by another session.
9696//
9797// If this is not set, the client waits for the acquire operation result until the operation or session context is done.
98- // You can reset the default value of this timeout by calling the WithNoAcquireTimeout method.
98+ // You can reset the default value of this timeout by calling the WithAcquireInfiniteTimeout method.
9999func WithAcquireTimeout (timeout time.Duration ) AcquireSemaphoreOption {
100100 return func (c * Ydb_Coordination.SessionRequest_AcquireSemaphore ) {
101101 c .TimeoutMillis = uint64 (timeout .Milliseconds ())
102102 }
103103}
104104
105- // WithNoAcquireTimeout returns an AcquireSemaphoreOption which disables the timeout after which the operation fails if
106- // it is still waiting in the queue.
105+ // WithAcquireInfiniteTimeout returns an AcquireSemaphoreOption which disables the timeout after which the operation
106+ // fails if it is still waiting in the queue.
107107//
108108// This is the default behavior. You can set the specific timeout by calling the WithAcquireTimeout method.
109- func WithNoAcquireTimeout () AcquireSemaphoreOption {
109+ func WithAcquireInfiniteTimeout () AcquireSemaphoreOption {
110110 return func (c * Ydb_Coordination.SessionRequest_AcquireSemaphore ) {
111111 c .TimeoutMillis = math .MaxUint64
112112 }
0 commit comments