github.com/ydb-platform/ydb-go-sdk/v3@v3.89.2/trace/coordination_gtrace.go (about)

     1  // Code generated by gtrace. DO NOT EDIT.
     2  
     3  package trace
     4  
     5  import (
     6  	"context"
     7  	"time"
     8  
     9  	"github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Coordination"
    10  )
    11  
    12  // coordinationComposeOptions is a holder of options
    13  type coordinationComposeOptions struct {
    14  	panicCallback func(e interface{})
    15  }
    16  
    17  // CoordinationOption specified Coordination compose option
    18  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
    19  type CoordinationComposeOption func(o *coordinationComposeOptions)
    20  
    21  // WithCoordinationPanicCallback specified behavior on panic
    22  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
    23  func WithCoordinationPanicCallback(cb func(e interface{})) CoordinationComposeOption {
    24  	return func(o *coordinationComposeOptions) {
    25  		o.panicCallback = cb
    26  	}
    27  }
    28  
    29  // Compose returns a new Coordination which has functional fields composed both from t and x.
    30  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
    31  func (t *Coordination) Compose(x *Coordination, opts ...CoordinationComposeOption) *Coordination {
    32  	if t == nil {
    33  		return x
    34  	}
    35  	var ret Coordination
    36  	options := coordinationComposeOptions{}
    37  	for _, opt := range opts {
    38  		if opt != nil {
    39  			opt(&options)
    40  		}
    41  	}
    42  	{
    43  		h1 := t.OnNew
    44  		h2 := x.OnNew
    45  		ret.OnNew = func(c CoordinationNewStartInfo) func(CoordinationNewDoneInfo) {
    46  			if options.panicCallback != nil {
    47  				defer func() {
    48  					if e := recover(); e != nil {
    49  						options.panicCallback(e)
    50  					}
    51  				}()
    52  			}
    53  			var r, r1 func(CoordinationNewDoneInfo)
    54  			if h1 != nil {
    55  				r = h1(c)
    56  			}
    57  			if h2 != nil {
    58  				r1 = h2(c)
    59  			}
    60  			return func(c CoordinationNewDoneInfo) {
    61  				if options.panicCallback != nil {
    62  					defer func() {
    63  						if e := recover(); e != nil {
    64  							options.panicCallback(e)
    65  						}
    66  					}()
    67  				}
    68  				if r != nil {
    69  					r(c)
    70  				}
    71  				if r1 != nil {
    72  					r1(c)
    73  				}
    74  			}
    75  		}
    76  	}
    77  	{
    78  		h1 := t.OnCreateNode
    79  		h2 := x.OnCreateNode
    80  		ret.OnCreateNode = func(c CoordinationCreateNodeStartInfo) func(CoordinationCreateNodeDoneInfo) {
    81  			if options.panicCallback != nil {
    82  				defer func() {
    83  					if e := recover(); e != nil {
    84  						options.panicCallback(e)
    85  					}
    86  				}()
    87  			}
    88  			var r, r1 func(CoordinationCreateNodeDoneInfo)
    89  			if h1 != nil {
    90  				r = h1(c)
    91  			}
    92  			if h2 != nil {
    93  				r1 = h2(c)
    94  			}
    95  			return func(c CoordinationCreateNodeDoneInfo) {
    96  				if options.panicCallback != nil {
    97  					defer func() {
    98  						if e := recover(); e != nil {
    99  							options.panicCallback(e)
   100  						}
   101  					}()
   102  				}
   103  				if r != nil {
   104  					r(c)
   105  				}
   106  				if r1 != nil {
   107  					r1(c)
   108  				}
   109  			}
   110  		}
   111  	}
   112  	{
   113  		h1 := t.OnAlterNode
   114  		h2 := x.OnAlterNode
   115  		ret.OnAlterNode = func(c CoordinationAlterNodeStartInfo) func(CoordinationAlterNodeDoneInfo) {
   116  			if options.panicCallback != nil {
   117  				defer func() {
   118  					if e := recover(); e != nil {
   119  						options.panicCallback(e)
   120  					}
   121  				}()
   122  			}
   123  			var r, r1 func(CoordinationAlterNodeDoneInfo)
   124  			if h1 != nil {
   125  				r = h1(c)
   126  			}
   127  			if h2 != nil {
   128  				r1 = h2(c)
   129  			}
   130  			return func(c CoordinationAlterNodeDoneInfo) {
   131  				if options.panicCallback != nil {
   132  					defer func() {
   133  						if e := recover(); e != nil {
   134  							options.panicCallback(e)
   135  						}
   136  					}()
   137  				}
   138  				if r != nil {
   139  					r(c)
   140  				}
   141  				if r1 != nil {
   142  					r1(c)
   143  				}
   144  			}
   145  		}
   146  	}
   147  	{
   148  		h1 := t.OnDropNode
   149  		h2 := x.OnDropNode
   150  		ret.OnDropNode = func(c CoordinationDropNodeStartInfo) func(CoordinationDropNodeDoneInfo) {
   151  			if options.panicCallback != nil {
   152  				defer func() {
   153  					if e := recover(); e != nil {
   154  						options.panicCallback(e)
   155  					}
   156  				}()
   157  			}
   158  			var r, r1 func(CoordinationDropNodeDoneInfo)
   159  			if h1 != nil {
   160  				r = h1(c)
   161  			}
   162  			if h2 != nil {
   163  				r1 = h2(c)
   164  			}
   165  			return func(c CoordinationDropNodeDoneInfo) {
   166  				if options.panicCallback != nil {
   167  					defer func() {
   168  						if e := recover(); e != nil {
   169  							options.panicCallback(e)
   170  						}
   171  					}()
   172  				}
   173  				if r != nil {
   174  					r(c)
   175  				}
   176  				if r1 != nil {
   177  					r1(c)
   178  				}
   179  			}
   180  		}
   181  	}
   182  	{
   183  		h1 := t.OnDescribeNode
   184  		h2 := x.OnDescribeNode
   185  		ret.OnDescribeNode = func(c CoordinationDescribeNodeStartInfo) func(CoordinationDescribeNodeDoneInfo) {
   186  			if options.panicCallback != nil {
   187  				defer func() {
   188  					if e := recover(); e != nil {
   189  						options.panicCallback(e)
   190  					}
   191  				}()
   192  			}
   193  			var r, r1 func(CoordinationDescribeNodeDoneInfo)
   194  			if h1 != nil {
   195  				r = h1(c)
   196  			}
   197  			if h2 != nil {
   198  				r1 = h2(c)
   199  			}
   200  			return func(c CoordinationDescribeNodeDoneInfo) {
   201  				if options.panicCallback != nil {
   202  					defer func() {
   203  						if e := recover(); e != nil {
   204  							options.panicCallback(e)
   205  						}
   206  					}()
   207  				}
   208  				if r != nil {
   209  					r(c)
   210  				}
   211  				if r1 != nil {
   212  					r1(c)
   213  				}
   214  			}
   215  		}
   216  	}
   217  	{
   218  		h1 := t.OnSession
   219  		h2 := x.OnSession
   220  		ret.OnSession = func(c CoordinationSessionStartInfo) func(CoordinationSessionDoneInfo) {
   221  			if options.panicCallback != nil {
   222  				defer func() {
   223  					if e := recover(); e != nil {
   224  						options.panicCallback(e)
   225  					}
   226  				}()
   227  			}
   228  			var r, r1 func(CoordinationSessionDoneInfo)
   229  			if h1 != nil {
   230  				r = h1(c)
   231  			}
   232  			if h2 != nil {
   233  				r1 = h2(c)
   234  			}
   235  			return func(c CoordinationSessionDoneInfo) {
   236  				if options.panicCallback != nil {
   237  					defer func() {
   238  						if e := recover(); e != nil {
   239  							options.panicCallback(e)
   240  						}
   241  					}()
   242  				}
   243  				if r != nil {
   244  					r(c)
   245  				}
   246  				if r1 != nil {
   247  					r1(c)
   248  				}
   249  			}
   250  		}
   251  	}
   252  	{
   253  		h1 := t.OnClose
   254  		h2 := x.OnClose
   255  		ret.OnClose = func(c CoordinationCloseStartInfo) func(CoordinationCloseDoneInfo) {
   256  			if options.panicCallback != nil {
   257  				defer func() {
   258  					if e := recover(); e != nil {
   259  						options.panicCallback(e)
   260  					}
   261  				}()
   262  			}
   263  			var r, r1 func(CoordinationCloseDoneInfo)
   264  			if h1 != nil {
   265  				r = h1(c)
   266  			}
   267  			if h2 != nil {
   268  				r1 = h2(c)
   269  			}
   270  			return func(c CoordinationCloseDoneInfo) {
   271  				if options.panicCallback != nil {
   272  					defer func() {
   273  						if e := recover(); e != nil {
   274  							options.panicCallback(e)
   275  						}
   276  					}()
   277  				}
   278  				if r != nil {
   279  					r(c)
   280  				}
   281  				if r1 != nil {
   282  					r1(c)
   283  				}
   284  			}
   285  		}
   286  	}
   287  	{
   288  		h1 := t.OnStreamNew
   289  		h2 := x.OnStreamNew
   290  		ret.OnStreamNew = func(c CoordinationStreamNewStartInfo) func(CoordinationStreamNewDoneInfo) {
   291  			if options.panicCallback != nil {
   292  				defer func() {
   293  					if e := recover(); e != nil {
   294  						options.panicCallback(e)
   295  					}
   296  				}()
   297  			}
   298  			var r, r1 func(CoordinationStreamNewDoneInfo)
   299  			if h1 != nil {
   300  				r = h1(c)
   301  			}
   302  			if h2 != nil {
   303  				r1 = h2(c)
   304  			}
   305  			return func(c CoordinationStreamNewDoneInfo) {
   306  				if options.panicCallback != nil {
   307  					defer func() {
   308  						if e := recover(); e != nil {
   309  							options.panicCallback(e)
   310  						}
   311  					}()
   312  				}
   313  				if r != nil {
   314  					r(c)
   315  				}
   316  				if r1 != nil {
   317  					r1(c)
   318  				}
   319  			}
   320  		}
   321  	}
   322  	{
   323  		h1 := t.OnSessionStarted
   324  		h2 := x.OnSessionStarted
   325  		ret.OnSessionStarted = func(c CoordinationSessionStartedInfo) {
   326  			if options.panicCallback != nil {
   327  				defer func() {
   328  					if e := recover(); e != nil {
   329  						options.panicCallback(e)
   330  					}
   331  				}()
   332  			}
   333  			if h1 != nil {
   334  				h1(c)
   335  			}
   336  			if h2 != nil {
   337  				h2(c)
   338  			}
   339  		}
   340  	}
   341  	{
   342  		h1 := t.OnSessionStartTimeout
   343  		h2 := x.OnSessionStartTimeout
   344  		ret.OnSessionStartTimeout = func(c CoordinationSessionStartTimeoutInfo) {
   345  			if options.panicCallback != nil {
   346  				defer func() {
   347  					if e := recover(); e != nil {
   348  						options.panicCallback(e)
   349  					}
   350  				}()
   351  			}
   352  			if h1 != nil {
   353  				h1(c)
   354  			}
   355  			if h2 != nil {
   356  				h2(c)
   357  			}
   358  		}
   359  	}
   360  	{
   361  		h1 := t.OnSessionKeepAliveTimeout
   362  		h2 := x.OnSessionKeepAliveTimeout
   363  		ret.OnSessionKeepAliveTimeout = func(c CoordinationSessionKeepAliveTimeoutInfo) {
   364  			if options.panicCallback != nil {
   365  				defer func() {
   366  					if e := recover(); e != nil {
   367  						options.panicCallback(e)
   368  					}
   369  				}()
   370  			}
   371  			if h1 != nil {
   372  				h1(c)
   373  			}
   374  			if h2 != nil {
   375  				h2(c)
   376  			}
   377  		}
   378  	}
   379  	{
   380  		h1 := t.OnSessionStopped
   381  		h2 := x.OnSessionStopped
   382  		ret.OnSessionStopped = func(c CoordinationSessionStoppedInfo) {
   383  			if options.panicCallback != nil {
   384  				defer func() {
   385  					if e := recover(); e != nil {
   386  						options.panicCallback(e)
   387  					}
   388  				}()
   389  			}
   390  			if h1 != nil {
   391  				h1(c)
   392  			}
   393  			if h2 != nil {
   394  				h2(c)
   395  			}
   396  		}
   397  	}
   398  	{
   399  		h1 := t.OnSessionStopTimeout
   400  		h2 := x.OnSessionStopTimeout
   401  		ret.OnSessionStopTimeout = func(c CoordinationSessionStopTimeoutInfo) {
   402  			if options.panicCallback != nil {
   403  				defer func() {
   404  					if e := recover(); e != nil {
   405  						options.panicCallback(e)
   406  					}
   407  				}()
   408  			}
   409  			if h1 != nil {
   410  				h1(c)
   411  			}
   412  			if h2 != nil {
   413  				h2(c)
   414  			}
   415  		}
   416  	}
   417  	{
   418  		h1 := t.OnSessionClientTimeout
   419  		h2 := x.OnSessionClientTimeout
   420  		ret.OnSessionClientTimeout = func(c CoordinationSessionClientTimeoutInfo) {
   421  			if options.panicCallback != nil {
   422  				defer func() {
   423  					if e := recover(); e != nil {
   424  						options.panicCallback(e)
   425  					}
   426  				}()
   427  			}
   428  			if h1 != nil {
   429  				h1(c)
   430  			}
   431  			if h2 != nil {
   432  				h2(c)
   433  			}
   434  		}
   435  	}
   436  	{
   437  		h1 := t.OnSessionServerExpire
   438  		h2 := x.OnSessionServerExpire
   439  		ret.OnSessionServerExpire = func(c CoordinationSessionServerExpireInfo) {
   440  			if options.panicCallback != nil {
   441  				defer func() {
   442  					if e := recover(); e != nil {
   443  						options.panicCallback(e)
   444  					}
   445  				}()
   446  			}
   447  			if h1 != nil {
   448  				h1(c)
   449  			}
   450  			if h2 != nil {
   451  				h2(c)
   452  			}
   453  		}
   454  	}
   455  	{
   456  		h1 := t.OnSessionServerError
   457  		h2 := x.OnSessionServerError
   458  		ret.OnSessionServerError = func(c CoordinationSessionServerErrorInfo) {
   459  			if options.panicCallback != nil {
   460  				defer func() {
   461  					if e := recover(); e != nil {
   462  						options.panicCallback(e)
   463  					}
   464  				}()
   465  			}
   466  			if h1 != nil {
   467  				h1(c)
   468  			}
   469  			if h2 != nil {
   470  				h2(c)
   471  			}
   472  		}
   473  	}
   474  	{
   475  		h1 := t.OnSessionReceive
   476  		h2 := x.OnSessionReceive
   477  		ret.OnSessionReceive = func(c CoordinationSessionReceiveStartInfo) func(CoordinationSessionReceiveDoneInfo) {
   478  			if options.panicCallback != nil {
   479  				defer func() {
   480  					if e := recover(); e != nil {
   481  						options.panicCallback(e)
   482  					}
   483  				}()
   484  			}
   485  			var r, r1 func(CoordinationSessionReceiveDoneInfo)
   486  			if h1 != nil {
   487  				r = h1(c)
   488  			}
   489  			if h2 != nil {
   490  				r1 = h2(c)
   491  			}
   492  			return func(c CoordinationSessionReceiveDoneInfo) {
   493  				if options.panicCallback != nil {
   494  					defer func() {
   495  						if e := recover(); e != nil {
   496  							options.panicCallback(e)
   497  						}
   498  					}()
   499  				}
   500  				if r != nil {
   501  					r(c)
   502  				}
   503  				if r1 != nil {
   504  					r1(c)
   505  				}
   506  			}
   507  		}
   508  	}
   509  	{
   510  		h1 := t.OnSessionReceiveUnexpected
   511  		h2 := x.OnSessionReceiveUnexpected
   512  		ret.OnSessionReceiveUnexpected = func(c CoordinationSessionReceiveUnexpectedInfo) {
   513  			if options.panicCallback != nil {
   514  				defer func() {
   515  					if e := recover(); e != nil {
   516  						options.panicCallback(e)
   517  					}
   518  				}()
   519  			}
   520  			if h1 != nil {
   521  				h1(c)
   522  			}
   523  			if h2 != nil {
   524  				h2(c)
   525  			}
   526  		}
   527  	}
   528  	{
   529  		h1 := t.OnSessionStop
   530  		h2 := x.OnSessionStop
   531  		ret.OnSessionStop = func(c CoordinationSessionStopInfo) {
   532  			if options.panicCallback != nil {
   533  				defer func() {
   534  					if e := recover(); e != nil {
   535  						options.panicCallback(e)
   536  					}
   537  				}()
   538  			}
   539  			if h1 != nil {
   540  				h1(c)
   541  			}
   542  			if h2 != nil {
   543  				h2(c)
   544  			}
   545  		}
   546  	}
   547  	{
   548  		h1 := t.OnSessionStart
   549  		h2 := x.OnSessionStart
   550  		ret.OnSessionStart = func(c CoordinationSessionStartStartInfo) func(CoordinationSessionStartDoneInfo) {
   551  			if options.panicCallback != nil {
   552  				defer func() {
   553  					if e := recover(); e != nil {
   554  						options.panicCallback(e)
   555  					}
   556  				}()
   557  			}
   558  			var r, r1 func(CoordinationSessionStartDoneInfo)
   559  			if h1 != nil {
   560  				r = h1(c)
   561  			}
   562  			if h2 != nil {
   563  				r1 = h2(c)
   564  			}
   565  			return func(c CoordinationSessionStartDoneInfo) {
   566  				if options.panicCallback != nil {
   567  					defer func() {
   568  						if e := recover(); e != nil {
   569  							options.panicCallback(e)
   570  						}
   571  					}()
   572  				}
   573  				if r != nil {
   574  					r(c)
   575  				}
   576  				if r1 != nil {
   577  					r1(c)
   578  				}
   579  			}
   580  		}
   581  	}
   582  	{
   583  		h1 := t.OnSessionSend
   584  		h2 := x.OnSessionSend
   585  		ret.OnSessionSend = func(c CoordinationSessionSendStartInfo) func(CoordinationSessionSendDoneInfo) {
   586  			if options.panicCallback != nil {
   587  				defer func() {
   588  					if e := recover(); e != nil {
   589  						options.panicCallback(e)
   590  					}
   591  				}()
   592  			}
   593  			var r, r1 func(CoordinationSessionSendDoneInfo)
   594  			if h1 != nil {
   595  				r = h1(c)
   596  			}
   597  			if h2 != nil {
   598  				r1 = h2(c)
   599  			}
   600  			return func(c CoordinationSessionSendDoneInfo) {
   601  				if options.panicCallback != nil {
   602  					defer func() {
   603  						if e := recover(); e != nil {
   604  							options.panicCallback(e)
   605  						}
   606  					}()
   607  				}
   608  				if r != nil {
   609  					r(c)
   610  				}
   611  				if r1 != nil {
   612  					r1(c)
   613  				}
   614  			}
   615  		}
   616  	}
   617  	return &ret
   618  }
   619  func (t *Coordination) onNew(c CoordinationNewStartInfo) func(CoordinationNewDoneInfo) {
   620  	fn := t.OnNew
   621  	if fn == nil {
   622  		return func(CoordinationNewDoneInfo) {
   623  			return
   624  		}
   625  	}
   626  	res := fn(c)
   627  	if res == nil {
   628  		return func(CoordinationNewDoneInfo) {
   629  			return
   630  		}
   631  	}
   632  	return res
   633  }
   634  func (t *Coordination) onCreateNode(c CoordinationCreateNodeStartInfo) func(CoordinationCreateNodeDoneInfo) {
   635  	fn := t.OnCreateNode
   636  	if fn == nil {
   637  		return func(CoordinationCreateNodeDoneInfo) {
   638  			return
   639  		}
   640  	}
   641  	res := fn(c)
   642  	if res == nil {
   643  		return func(CoordinationCreateNodeDoneInfo) {
   644  			return
   645  		}
   646  	}
   647  	return res
   648  }
   649  func (t *Coordination) onAlterNode(c CoordinationAlterNodeStartInfo) func(CoordinationAlterNodeDoneInfo) {
   650  	fn := t.OnAlterNode
   651  	if fn == nil {
   652  		return func(CoordinationAlterNodeDoneInfo) {
   653  			return
   654  		}
   655  	}
   656  	res := fn(c)
   657  	if res == nil {
   658  		return func(CoordinationAlterNodeDoneInfo) {
   659  			return
   660  		}
   661  	}
   662  	return res
   663  }
   664  func (t *Coordination) onDropNode(c CoordinationDropNodeStartInfo) func(CoordinationDropNodeDoneInfo) {
   665  	fn := t.OnDropNode
   666  	if fn == nil {
   667  		return func(CoordinationDropNodeDoneInfo) {
   668  			return
   669  		}
   670  	}
   671  	res := fn(c)
   672  	if res == nil {
   673  		return func(CoordinationDropNodeDoneInfo) {
   674  			return
   675  		}
   676  	}
   677  	return res
   678  }
   679  func (t *Coordination) onDescribeNode(c CoordinationDescribeNodeStartInfo) func(CoordinationDescribeNodeDoneInfo) {
   680  	fn := t.OnDescribeNode
   681  	if fn == nil {
   682  		return func(CoordinationDescribeNodeDoneInfo) {
   683  			return
   684  		}
   685  	}
   686  	res := fn(c)
   687  	if res == nil {
   688  		return func(CoordinationDescribeNodeDoneInfo) {
   689  			return
   690  		}
   691  	}
   692  	return res
   693  }
   694  func (t *Coordination) onSession(c CoordinationSessionStartInfo) func(CoordinationSessionDoneInfo) {
   695  	fn := t.OnSession
   696  	if fn == nil {
   697  		return func(CoordinationSessionDoneInfo) {
   698  			return
   699  		}
   700  	}
   701  	res := fn(c)
   702  	if res == nil {
   703  		return func(CoordinationSessionDoneInfo) {
   704  			return
   705  		}
   706  	}
   707  	return res
   708  }
   709  func (t *Coordination) onClose(c CoordinationCloseStartInfo) func(CoordinationCloseDoneInfo) {
   710  	fn := t.OnClose
   711  	if fn == nil {
   712  		return func(CoordinationCloseDoneInfo) {
   713  			return
   714  		}
   715  	}
   716  	res := fn(c)
   717  	if res == nil {
   718  		return func(CoordinationCloseDoneInfo) {
   719  			return
   720  		}
   721  	}
   722  	return res
   723  }
   724  func (t *Coordination) onStreamNew(c CoordinationStreamNewStartInfo) func(CoordinationStreamNewDoneInfo) {
   725  	fn := t.OnStreamNew
   726  	if fn == nil {
   727  		return func(CoordinationStreamNewDoneInfo) {
   728  			return
   729  		}
   730  	}
   731  	res := fn(c)
   732  	if res == nil {
   733  		return func(CoordinationStreamNewDoneInfo) {
   734  			return
   735  		}
   736  	}
   737  	return res
   738  }
   739  func (t *Coordination) onSessionStarted(c CoordinationSessionStartedInfo) {
   740  	fn := t.OnSessionStarted
   741  	if fn == nil {
   742  		return
   743  	}
   744  	fn(c)
   745  }
   746  func (t *Coordination) onSessionStartTimeout(c CoordinationSessionStartTimeoutInfo) {
   747  	fn := t.OnSessionStartTimeout
   748  	if fn == nil {
   749  		return
   750  	}
   751  	fn(c)
   752  }
   753  func (t *Coordination) onSessionKeepAliveTimeout(c CoordinationSessionKeepAliveTimeoutInfo) {
   754  	fn := t.OnSessionKeepAliveTimeout
   755  	if fn == nil {
   756  		return
   757  	}
   758  	fn(c)
   759  }
   760  func (t *Coordination) onSessionStopped(c CoordinationSessionStoppedInfo) {
   761  	fn := t.OnSessionStopped
   762  	if fn == nil {
   763  		return
   764  	}
   765  	fn(c)
   766  }
   767  func (t *Coordination) onSessionStopTimeout(c CoordinationSessionStopTimeoutInfo) {
   768  	fn := t.OnSessionStopTimeout
   769  	if fn == nil {
   770  		return
   771  	}
   772  	fn(c)
   773  }
   774  func (t *Coordination) onSessionClientTimeout(c CoordinationSessionClientTimeoutInfo) {
   775  	fn := t.OnSessionClientTimeout
   776  	if fn == nil {
   777  		return
   778  	}
   779  	fn(c)
   780  }
   781  func (t *Coordination) onSessionServerExpire(c CoordinationSessionServerExpireInfo) {
   782  	fn := t.OnSessionServerExpire
   783  	if fn == nil {
   784  		return
   785  	}
   786  	fn(c)
   787  }
   788  func (t *Coordination) onSessionServerError(c CoordinationSessionServerErrorInfo) {
   789  	fn := t.OnSessionServerError
   790  	if fn == nil {
   791  		return
   792  	}
   793  	fn(c)
   794  }
   795  func (t *Coordination) onSessionReceive(c CoordinationSessionReceiveStartInfo) func(CoordinationSessionReceiveDoneInfo) {
   796  	fn := t.OnSessionReceive
   797  	if fn == nil {
   798  		return func(CoordinationSessionReceiveDoneInfo) {
   799  			return
   800  		}
   801  	}
   802  	res := fn(c)
   803  	if res == nil {
   804  		return func(CoordinationSessionReceiveDoneInfo) {
   805  			return
   806  		}
   807  	}
   808  	return res
   809  }
   810  func (t *Coordination) onSessionReceiveUnexpected(c CoordinationSessionReceiveUnexpectedInfo) {
   811  	fn := t.OnSessionReceiveUnexpected
   812  	if fn == nil {
   813  		return
   814  	}
   815  	fn(c)
   816  }
   817  func (t *Coordination) onSessionStop(c CoordinationSessionStopInfo) {
   818  	fn := t.OnSessionStop
   819  	if fn == nil {
   820  		return
   821  	}
   822  	fn(c)
   823  }
   824  func (t *Coordination) onSessionStart(c CoordinationSessionStartStartInfo) func(CoordinationSessionStartDoneInfo) {
   825  	fn := t.OnSessionStart
   826  	if fn == nil {
   827  		return func(CoordinationSessionStartDoneInfo) {
   828  			return
   829  		}
   830  	}
   831  	res := fn(c)
   832  	if res == nil {
   833  		return func(CoordinationSessionStartDoneInfo) {
   834  			return
   835  		}
   836  	}
   837  	return res
   838  }
   839  func (t *Coordination) onSessionSend(c CoordinationSessionSendStartInfo) func(CoordinationSessionSendDoneInfo) {
   840  	fn := t.OnSessionSend
   841  	if fn == nil {
   842  		return func(CoordinationSessionSendDoneInfo) {
   843  			return
   844  		}
   845  	}
   846  	res := fn(c)
   847  	if res == nil {
   848  		return func(CoordinationSessionSendDoneInfo) {
   849  			return
   850  		}
   851  	}
   852  	return res
   853  }
   854  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   855  func CoordinationOnNew(t *Coordination, c *context.Context, call call) func() {
   856  	var p CoordinationNewStartInfo
   857  	p.Context = c
   858  	p.Call = call
   859  	res := t.onNew(p)
   860  	return func() {
   861  		var p CoordinationNewDoneInfo
   862  		res(p)
   863  	}
   864  }
   865  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   866  func CoordinationOnCreateNode(t *Coordination, c *context.Context, call call, path string) func(error) {
   867  	var p CoordinationCreateNodeStartInfo
   868  	p.Context = c
   869  	p.Call = call
   870  	p.Path = path
   871  	res := t.onCreateNode(p)
   872  	return func(e error) {
   873  		var p CoordinationCreateNodeDoneInfo
   874  		p.Error = e
   875  		res(p)
   876  	}
   877  }
   878  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   879  func CoordinationOnAlterNode(t *Coordination, c *context.Context, call call, path string) func(error) {
   880  	var p CoordinationAlterNodeStartInfo
   881  	p.Context = c
   882  	p.Call = call
   883  	p.Path = path
   884  	res := t.onAlterNode(p)
   885  	return func(e error) {
   886  		var p CoordinationAlterNodeDoneInfo
   887  		p.Error = e
   888  		res(p)
   889  	}
   890  }
   891  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   892  func CoordinationOnDropNode(t *Coordination, c *context.Context, call call, path string) func(error) {
   893  	var p CoordinationDropNodeStartInfo
   894  	p.Context = c
   895  	p.Call = call
   896  	p.Path = path
   897  	res := t.onDropNode(p)
   898  	return func(e error) {
   899  		var p CoordinationDropNodeDoneInfo
   900  		p.Error = e
   901  		res(p)
   902  	}
   903  }
   904  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   905  func CoordinationOnDescribeNode(t *Coordination, c *context.Context, call call, path string) func(error) {
   906  	var p CoordinationDescribeNodeStartInfo
   907  	p.Context = c
   908  	p.Call = call
   909  	p.Path = path
   910  	res := t.onDescribeNode(p)
   911  	return func(e error) {
   912  		var p CoordinationDescribeNodeDoneInfo
   913  		p.Error = e
   914  		res(p)
   915  	}
   916  }
   917  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   918  func CoordinationOnSession(t *Coordination, c *context.Context, call call, path string) func(error) {
   919  	var p CoordinationSessionStartInfo
   920  	p.Context = c
   921  	p.Call = call
   922  	p.Path = path
   923  	res := t.onSession(p)
   924  	return func(e error) {
   925  		var p CoordinationSessionDoneInfo
   926  		p.Error = e
   927  		res(p)
   928  	}
   929  }
   930  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   931  func CoordinationOnClose(t *Coordination, c *context.Context, call call) func(error) {
   932  	var p CoordinationCloseStartInfo
   933  	p.Context = c
   934  	p.Call = call
   935  	res := t.onClose(p)
   936  	return func(e error) {
   937  		var p CoordinationCloseDoneInfo
   938  		p.Error = e
   939  		res(p)
   940  	}
   941  }
   942  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   943  func CoordinationOnStreamNew(t *Coordination) func(error) {
   944  	var p CoordinationStreamNewStartInfo
   945  	res := t.onStreamNew(p)
   946  	return func(e error) {
   947  		var p CoordinationStreamNewDoneInfo
   948  		p.Error = e
   949  		res(p)
   950  	}
   951  }
   952  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   953  func CoordinationOnSessionStarted(t *Coordination, sessionID uint64, expectedSessionID uint64) {
   954  	var p CoordinationSessionStartedInfo
   955  	p.SessionID = sessionID
   956  	p.ExpectedSessionID = expectedSessionID
   957  	t.onSessionStarted(p)
   958  }
   959  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   960  func CoordinationOnSessionStartTimeout(t *Coordination, timeout time.Duration) {
   961  	var p CoordinationSessionStartTimeoutInfo
   962  	p.Timeout = timeout
   963  	t.onSessionStartTimeout(p)
   964  }
   965  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   966  func CoordinationOnSessionKeepAliveTimeout(t *Coordination, lastGoodResponseTime time.Time, timeout time.Duration) {
   967  	var p CoordinationSessionKeepAliveTimeoutInfo
   968  	p.LastGoodResponseTime = lastGoodResponseTime
   969  	p.Timeout = timeout
   970  	t.onSessionKeepAliveTimeout(p)
   971  }
   972  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   973  func CoordinationOnSessionStopped(t *Coordination, sessionID uint64, expectedSessionID uint64) {
   974  	var p CoordinationSessionStoppedInfo
   975  	p.SessionID = sessionID
   976  	p.ExpectedSessionID = expectedSessionID
   977  	t.onSessionStopped(p)
   978  }
   979  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   980  func CoordinationOnSessionStopTimeout(t *Coordination, timeout time.Duration) {
   981  	var p CoordinationSessionStopTimeoutInfo
   982  	p.Timeout = timeout
   983  	t.onSessionStopTimeout(p)
   984  }
   985  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   986  func CoordinationOnSessionClientTimeout(t *Coordination, lastGoodResponseTime time.Time, timeout time.Duration) {
   987  	var p CoordinationSessionClientTimeoutInfo
   988  	p.LastGoodResponseTime = lastGoodResponseTime
   989  	p.Timeout = timeout
   990  	t.onSessionClientTimeout(p)
   991  }
   992  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   993  func CoordinationOnSessionServerExpire(t *Coordination, failure *Ydb_Coordination.SessionResponse_Failure) {
   994  	var p CoordinationSessionServerExpireInfo
   995  	p.Failure = failure
   996  	t.onSessionServerExpire(p)
   997  }
   998  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
   999  func CoordinationOnSessionServerError(t *Coordination, failure *Ydb_Coordination.SessionResponse_Failure) {
  1000  	var p CoordinationSessionServerErrorInfo
  1001  	p.Failure = failure
  1002  	t.onSessionServerError(p)
  1003  }
  1004  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
  1005  func CoordinationOnSessionReceive(t *Coordination) func(response *Ydb_Coordination.SessionResponse, _ error) {
  1006  	var p CoordinationSessionReceiveStartInfo
  1007  	res := t.onSessionReceive(p)
  1008  	return func(response *Ydb_Coordination.SessionResponse, e error) {
  1009  		var p CoordinationSessionReceiveDoneInfo
  1010  		p.Response = response
  1011  		p.Error = e
  1012  		res(p)
  1013  	}
  1014  }
  1015  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
  1016  func CoordinationOnSessionReceiveUnexpected(t *Coordination, response *Ydb_Coordination.SessionResponse) {
  1017  	var p CoordinationSessionReceiveUnexpectedInfo
  1018  	p.Response = response
  1019  	t.onSessionReceiveUnexpected(p)
  1020  }
  1021  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
  1022  func CoordinationOnSessionStop(t *Coordination, sessionID uint64) {
  1023  	var p CoordinationSessionStopInfo
  1024  	p.SessionID = sessionID
  1025  	t.onSessionStop(p)
  1026  }
  1027  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
  1028  func CoordinationOnSessionStart(t *Coordination) func(error) {
  1029  	var p CoordinationSessionStartStartInfo
  1030  	res := t.onSessionStart(p)
  1031  	return func(e error) {
  1032  		var p CoordinationSessionStartDoneInfo
  1033  		p.Error = e
  1034  		res(p)
  1035  	}
  1036  }
  1037  // Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
  1038  func CoordinationOnSessionSend(t *Coordination, request *Ydb_Coordination.SessionRequest) func(error) {
  1039  	var p CoordinationSessionSendStartInfo
  1040  	p.Request = request
  1041  	res := t.onSessionSend(p)
  1042  	return func(e error) {
  1043  		var p CoordinationSessionSendDoneInfo
  1044  		p.Error = e
  1045  		res(p)
  1046  	}
  1047  }