github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/trace/driver_gtrace.go (about)

     1  // Code generated by gtrace. DO NOT EDIT.
     2  
     3  package trace
     4  
     5  import (
     6  	"context"
     7  )
     8  
     9  // driverComposeOptions is a holder of options
    10  type driverComposeOptions struct {
    11  	panicCallback func(e interface{})
    12  }
    13  
    14  // DriverOption specified Driver compose option
    15  type DriverComposeOption func(o *driverComposeOptions)
    16  
    17  // WithDriverPanicCallback specified behavior on panic
    18  func WithDriverPanicCallback(cb func(e interface{})) DriverComposeOption {
    19  	return func(o *driverComposeOptions) {
    20  		o.panicCallback = cb
    21  	}
    22  }
    23  
    24  // Compose returns a new Driver which has functional fields composed both from t and x.
    25  func (t *Driver) Compose(x *Driver, opts ...DriverComposeOption) *Driver {
    26  	var ret Driver
    27  	options := driverComposeOptions{}
    28  	for _, opt := range opts {
    29  		if opt != nil {
    30  			opt(&options)
    31  		}
    32  	}
    33  	{
    34  		h1 := t.OnInit
    35  		h2 := x.OnInit
    36  		ret.OnInit = func(d DriverInitStartInfo) func(DriverInitDoneInfo) {
    37  			if options.panicCallback != nil {
    38  				defer func() {
    39  					if e := recover(); e != nil {
    40  						options.panicCallback(e)
    41  					}
    42  				}()
    43  			}
    44  			var r, r1 func(DriverInitDoneInfo)
    45  			if h1 != nil {
    46  				r = h1(d)
    47  			}
    48  			if h2 != nil {
    49  				r1 = h2(d)
    50  			}
    51  			return func(d DriverInitDoneInfo) {
    52  				if options.panicCallback != nil {
    53  					defer func() {
    54  						if e := recover(); e != nil {
    55  							options.panicCallback(e)
    56  						}
    57  					}()
    58  				}
    59  				if r != nil {
    60  					r(d)
    61  				}
    62  				if r1 != nil {
    63  					r1(d)
    64  				}
    65  			}
    66  		}
    67  	}
    68  	{
    69  		h1 := t.OnWith
    70  		h2 := x.OnWith
    71  		ret.OnWith = func(d DriverWithStartInfo) func(DriverWithDoneInfo) {
    72  			if options.panicCallback != nil {
    73  				defer func() {
    74  					if e := recover(); e != nil {
    75  						options.panicCallback(e)
    76  					}
    77  				}()
    78  			}
    79  			var r, r1 func(DriverWithDoneInfo)
    80  			if h1 != nil {
    81  				r = h1(d)
    82  			}
    83  			if h2 != nil {
    84  				r1 = h2(d)
    85  			}
    86  			return func(d DriverWithDoneInfo) {
    87  				if options.panicCallback != nil {
    88  					defer func() {
    89  						if e := recover(); e != nil {
    90  							options.panicCallback(e)
    91  						}
    92  					}()
    93  				}
    94  				if r != nil {
    95  					r(d)
    96  				}
    97  				if r1 != nil {
    98  					r1(d)
    99  				}
   100  			}
   101  		}
   102  	}
   103  	{
   104  		h1 := t.OnClose
   105  		h2 := x.OnClose
   106  		ret.OnClose = func(d DriverCloseStartInfo) func(DriverCloseDoneInfo) {
   107  			if options.panicCallback != nil {
   108  				defer func() {
   109  					if e := recover(); e != nil {
   110  						options.panicCallback(e)
   111  					}
   112  				}()
   113  			}
   114  			var r, r1 func(DriverCloseDoneInfo)
   115  			if h1 != nil {
   116  				r = h1(d)
   117  			}
   118  			if h2 != nil {
   119  				r1 = h2(d)
   120  			}
   121  			return func(d DriverCloseDoneInfo) {
   122  				if options.panicCallback != nil {
   123  					defer func() {
   124  						if e := recover(); e != nil {
   125  							options.panicCallback(e)
   126  						}
   127  					}()
   128  				}
   129  				if r != nil {
   130  					r(d)
   131  				}
   132  				if r1 != nil {
   133  					r1(d)
   134  				}
   135  			}
   136  		}
   137  	}
   138  	{
   139  		h1 := t.OnPoolNew
   140  		h2 := x.OnPoolNew
   141  		ret.OnPoolNew = func(d DriverConnPoolNewStartInfo) func(DriverConnPoolNewDoneInfo) {
   142  			if options.panicCallback != nil {
   143  				defer func() {
   144  					if e := recover(); e != nil {
   145  						options.panicCallback(e)
   146  					}
   147  				}()
   148  			}
   149  			var r, r1 func(DriverConnPoolNewDoneInfo)
   150  			if h1 != nil {
   151  				r = h1(d)
   152  			}
   153  			if h2 != nil {
   154  				r1 = h2(d)
   155  			}
   156  			return func(d DriverConnPoolNewDoneInfo) {
   157  				if options.panicCallback != nil {
   158  					defer func() {
   159  						if e := recover(); e != nil {
   160  							options.panicCallback(e)
   161  						}
   162  					}()
   163  				}
   164  				if r != nil {
   165  					r(d)
   166  				}
   167  				if r1 != nil {
   168  					r1(d)
   169  				}
   170  			}
   171  		}
   172  	}
   173  	{
   174  		h1 := t.OnPoolRelease
   175  		h2 := x.OnPoolRelease
   176  		ret.OnPoolRelease = func(d DriverConnPoolReleaseStartInfo) func(DriverConnPoolReleaseDoneInfo) {
   177  			if options.panicCallback != nil {
   178  				defer func() {
   179  					if e := recover(); e != nil {
   180  						options.panicCallback(e)
   181  					}
   182  				}()
   183  			}
   184  			var r, r1 func(DriverConnPoolReleaseDoneInfo)
   185  			if h1 != nil {
   186  				r = h1(d)
   187  			}
   188  			if h2 != nil {
   189  				r1 = h2(d)
   190  			}
   191  			return func(d DriverConnPoolReleaseDoneInfo) {
   192  				if options.panicCallback != nil {
   193  					defer func() {
   194  						if e := recover(); e != nil {
   195  							options.panicCallback(e)
   196  						}
   197  					}()
   198  				}
   199  				if r != nil {
   200  					r(d)
   201  				}
   202  				if r1 != nil {
   203  					r1(d)
   204  				}
   205  			}
   206  		}
   207  	}
   208  	{
   209  		h1 := t.OnNetRead
   210  		h2 := x.OnNetRead
   211  		ret.OnNetRead = func(d DriverNetReadStartInfo) func(DriverNetReadDoneInfo) {
   212  			if options.panicCallback != nil {
   213  				defer func() {
   214  					if e := recover(); e != nil {
   215  						options.panicCallback(e)
   216  					}
   217  				}()
   218  			}
   219  			var r, r1 func(DriverNetReadDoneInfo)
   220  			if h1 != nil {
   221  				r = h1(d)
   222  			}
   223  			if h2 != nil {
   224  				r1 = h2(d)
   225  			}
   226  			return func(d DriverNetReadDoneInfo) {
   227  				if options.panicCallback != nil {
   228  					defer func() {
   229  						if e := recover(); e != nil {
   230  							options.panicCallback(e)
   231  						}
   232  					}()
   233  				}
   234  				if r != nil {
   235  					r(d)
   236  				}
   237  				if r1 != nil {
   238  					r1(d)
   239  				}
   240  			}
   241  		}
   242  	}
   243  	{
   244  		h1 := t.OnNetWrite
   245  		h2 := x.OnNetWrite
   246  		ret.OnNetWrite = func(d DriverNetWriteStartInfo) func(DriverNetWriteDoneInfo) {
   247  			if options.panicCallback != nil {
   248  				defer func() {
   249  					if e := recover(); e != nil {
   250  						options.panicCallback(e)
   251  					}
   252  				}()
   253  			}
   254  			var r, r1 func(DriverNetWriteDoneInfo)
   255  			if h1 != nil {
   256  				r = h1(d)
   257  			}
   258  			if h2 != nil {
   259  				r1 = h2(d)
   260  			}
   261  			return func(d DriverNetWriteDoneInfo) {
   262  				if options.panicCallback != nil {
   263  					defer func() {
   264  						if e := recover(); e != nil {
   265  							options.panicCallback(e)
   266  						}
   267  					}()
   268  				}
   269  				if r != nil {
   270  					r(d)
   271  				}
   272  				if r1 != nil {
   273  					r1(d)
   274  				}
   275  			}
   276  		}
   277  	}
   278  	{
   279  		h1 := t.OnNetDial
   280  		h2 := x.OnNetDial
   281  		ret.OnNetDial = func(d DriverNetDialStartInfo) func(DriverNetDialDoneInfo) {
   282  			if options.panicCallback != nil {
   283  				defer func() {
   284  					if e := recover(); e != nil {
   285  						options.panicCallback(e)
   286  					}
   287  				}()
   288  			}
   289  			var r, r1 func(DriverNetDialDoneInfo)
   290  			if h1 != nil {
   291  				r = h1(d)
   292  			}
   293  			if h2 != nil {
   294  				r1 = h2(d)
   295  			}
   296  			return func(d DriverNetDialDoneInfo) {
   297  				if options.panicCallback != nil {
   298  					defer func() {
   299  						if e := recover(); e != nil {
   300  							options.panicCallback(e)
   301  						}
   302  					}()
   303  				}
   304  				if r != nil {
   305  					r(d)
   306  				}
   307  				if r1 != nil {
   308  					r1(d)
   309  				}
   310  			}
   311  		}
   312  	}
   313  	{
   314  		h1 := t.OnNetClose
   315  		h2 := x.OnNetClose
   316  		ret.OnNetClose = func(d DriverNetCloseStartInfo) func(DriverNetCloseDoneInfo) {
   317  			if options.panicCallback != nil {
   318  				defer func() {
   319  					if e := recover(); e != nil {
   320  						options.panicCallback(e)
   321  					}
   322  				}()
   323  			}
   324  			var r, r1 func(DriverNetCloseDoneInfo)
   325  			if h1 != nil {
   326  				r = h1(d)
   327  			}
   328  			if h2 != nil {
   329  				r1 = h2(d)
   330  			}
   331  			return func(d DriverNetCloseDoneInfo) {
   332  				if options.panicCallback != nil {
   333  					defer func() {
   334  						if e := recover(); e != nil {
   335  							options.panicCallback(e)
   336  						}
   337  					}()
   338  				}
   339  				if r != nil {
   340  					r(d)
   341  				}
   342  				if r1 != nil {
   343  					r1(d)
   344  				}
   345  			}
   346  		}
   347  	}
   348  	{
   349  		h1 := t.OnResolve
   350  		h2 := x.OnResolve
   351  		ret.OnResolve = func(d DriverResolveStartInfo) func(DriverResolveDoneInfo) {
   352  			if options.panicCallback != nil {
   353  				defer func() {
   354  					if e := recover(); e != nil {
   355  						options.panicCallback(e)
   356  					}
   357  				}()
   358  			}
   359  			var r, r1 func(DriverResolveDoneInfo)
   360  			if h1 != nil {
   361  				r = h1(d)
   362  			}
   363  			if h2 != nil {
   364  				r1 = h2(d)
   365  			}
   366  			return func(d DriverResolveDoneInfo) {
   367  				if options.panicCallback != nil {
   368  					defer func() {
   369  						if e := recover(); e != nil {
   370  							options.panicCallback(e)
   371  						}
   372  					}()
   373  				}
   374  				if r != nil {
   375  					r(d)
   376  				}
   377  				if r1 != nil {
   378  					r1(d)
   379  				}
   380  			}
   381  		}
   382  	}
   383  	{
   384  		h1 := t.OnConnStateChange
   385  		h2 := x.OnConnStateChange
   386  		ret.OnConnStateChange = func(d DriverConnStateChangeStartInfo) func(DriverConnStateChangeDoneInfo) {
   387  			if options.panicCallback != nil {
   388  				defer func() {
   389  					if e := recover(); e != nil {
   390  						options.panicCallback(e)
   391  					}
   392  				}()
   393  			}
   394  			var r, r1 func(DriverConnStateChangeDoneInfo)
   395  			if h1 != nil {
   396  				r = h1(d)
   397  			}
   398  			if h2 != nil {
   399  				r1 = h2(d)
   400  			}
   401  			return func(d DriverConnStateChangeDoneInfo) {
   402  				if options.panicCallback != nil {
   403  					defer func() {
   404  						if e := recover(); e != nil {
   405  							options.panicCallback(e)
   406  						}
   407  					}()
   408  				}
   409  				if r != nil {
   410  					r(d)
   411  				}
   412  				if r1 != nil {
   413  					r1(d)
   414  				}
   415  			}
   416  		}
   417  	}
   418  	{
   419  		h1 := t.OnConnInvoke
   420  		h2 := x.OnConnInvoke
   421  		ret.OnConnInvoke = func(d DriverConnInvokeStartInfo) func(DriverConnInvokeDoneInfo) {
   422  			if options.panicCallback != nil {
   423  				defer func() {
   424  					if e := recover(); e != nil {
   425  						options.panicCallback(e)
   426  					}
   427  				}()
   428  			}
   429  			var r, r1 func(DriverConnInvokeDoneInfo)
   430  			if h1 != nil {
   431  				r = h1(d)
   432  			}
   433  			if h2 != nil {
   434  				r1 = h2(d)
   435  			}
   436  			return func(d DriverConnInvokeDoneInfo) {
   437  				if options.panicCallback != nil {
   438  					defer func() {
   439  						if e := recover(); e != nil {
   440  							options.panicCallback(e)
   441  						}
   442  					}()
   443  				}
   444  				if r != nil {
   445  					r(d)
   446  				}
   447  				if r1 != nil {
   448  					r1(d)
   449  				}
   450  			}
   451  		}
   452  	}
   453  	{
   454  		h1 := t.OnConnNewStream
   455  		h2 := x.OnConnNewStream
   456  		ret.OnConnNewStream = func(d DriverConnNewStreamStartInfo) func(DriverConnNewStreamRecvInfo) func(DriverConnNewStreamDoneInfo) {
   457  			if options.panicCallback != nil {
   458  				defer func() {
   459  					if e := recover(); e != nil {
   460  						options.panicCallback(e)
   461  					}
   462  				}()
   463  			}
   464  			var r, r1 func(DriverConnNewStreamRecvInfo) func(DriverConnNewStreamDoneInfo)
   465  			if h1 != nil {
   466  				r = h1(d)
   467  			}
   468  			if h2 != nil {
   469  				r1 = h2(d)
   470  			}
   471  			return func(d DriverConnNewStreamRecvInfo) func(DriverConnNewStreamDoneInfo) {
   472  				if options.panicCallback != nil {
   473  					defer func() {
   474  						if e := recover(); e != nil {
   475  							options.panicCallback(e)
   476  						}
   477  					}()
   478  				}
   479  				var r2, r3 func(DriverConnNewStreamDoneInfo)
   480  				if r != nil {
   481  					r2 = r(d)
   482  				}
   483  				if r1 != nil {
   484  					r3 = r1(d)
   485  				}
   486  				return func(d DriverConnNewStreamDoneInfo) {
   487  					if options.panicCallback != nil {
   488  						defer func() {
   489  							if e := recover(); e != nil {
   490  								options.panicCallback(e)
   491  							}
   492  						}()
   493  					}
   494  					if r2 != nil {
   495  						r2(d)
   496  					}
   497  					if r3 != nil {
   498  						r3(d)
   499  					}
   500  				}
   501  			}
   502  		}
   503  	}
   504  	{
   505  		h1 := t.OnConnTake
   506  		h2 := x.OnConnTake
   507  		ret.OnConnTake = func(d DriverConnTakeStartInfo) func(DriverConnTakeDoneInfo) {
   508  			if options.panicCallback != nil {
   509  				defer func() {
   510  					if e := recover(); e != nil {
   511  						options.panicCallback(e)
   512  					}
   513  				}()
   514  			}
   515  			var r, r1 func(DriverConnTakeDoneInfo)
   516  			if h1 != nil {
   517  				r = h1(d)
   518  			}
   519  			if h2 != nil {
   520  				r1 = h2(d)
   521  			}
   522  			return func(d DriverConnTakeDoneInfo) {
   523  				if options.panicCallback != nil {
   524  					defer func() {
   525  						if e := recover(); e != nil {
   526  							options.panicCallback(e)
   527  						}
   528  					}()
   529  				}
   530  				if r != nil {
   531  					r(d)
   532  				}
   533  				if r1 != nil {
   534  					r1(d)
   535  				}
   536  			}
   537  		}
   538  	}
   539  	{
   540  		h1 := t.OnConnDial
   541  		h2 := x.OnConnDial
   542  		ret.OnConnDial = func(d DriverConnDialStartInfo) func(DriverConnDialDoneInfo) {
   543  			if options.panicCallback != nil {
   544  				defer func() {
   545  					if e := recover(); e != nil {
   546  						options.panicCallback(e)
   547  					}
   548  				}()
   549  			}
   550  			var r, r1 func(DriverConnDialDoneInfo)
   551  			if h1 != nil {
   552  				r = h1(d)
   553  			}
   554  			if h2 != nil {
   555  				r1 = h2(d)
   556  			}
   557  			return func(d DriverConnDialDoneInfo) {
   558  				if options.panicCallback != nil {
   559  					defer func() {
   560  						if e := recover(); e != nil {
   561  							options.panicCallback(e)
   562  						}
   563  					}()
   564  				}
   565  				if r != nil {
   566  					r(d)
   567  				}
   568  				if r1 != nil {
   569  					r1(d)
   570  				}
   571  			}
   572  		}
   573  	}
   574  	{
   575  		h1 := t.OnConnPark
   576  		h2 := x.OnConnPark
   577  		ret.OnConnPark = func(d DriverConnParkStartInfo) func(DriverConnParkDoneInfo) {
   578  			if options.panicCallback != nil {
   579  				defer func() {
   580  					if e := recover(); e != nil {
   581  						options.panicCallback(e)
   582  					}
   583  				}()
   584  			}
   585  			var r, r1 func(DriverConnParkDoneInfo)
   586  			if h1 != nil {
   587  				r = h1(d)
   588  			}
   589  			if h2 != nil {
   590  				r1 = h2(d)
   591  			}
   592  			return func(d DriverConnParkDoneInfo) {
   593  				if options.panicCallback != nil {
   594  					defer func() {
   595  						if e := recover(); e != nil {
   596  							options.panicCallback(e)
   597  						}
   598  					}()
   599  				}
   600  				if r != nil {
   601  					r(d)
   602  				}
   603  				if r1 != nil {
   604  					r1(d)
   605  				}
   606  			}
   607  		}
   608  	}
   609  	{
   610  		h1 := t.OnConnBan
   611  		h2 := x.OnConnBan
   612  		ret.OnConnBan = func(d DriverConnBanStartInfo) func(DriverConnBanDoneInfo) {
   613  			if options.panicCallback != nil {
   614  				defer func() {
   615  					if e := recover(); e != nil {
   616  						options.panicCallback(e)
   617  					}
   618  				}()
   619  			}
   620  			var r, r1 func(DriverConnBanDoneInfo)
   621  			if h1 != nil {
   622  				r = h1(d)
   623  			}
   624  			if h2 != nil {
   625  				r1 = h2(d)
   626  			}
   627  			return func(d DriverConnBanDoneInfo) {
   628  				if options.panicCallback != nil {
   629  					defer func() {
   630  						if e := recover(); e != nil {
   631  							options.panicCallback(e)
   632  						}
   633  					}()
   634  				}
   635  				if r != nil {
   636  					r(d)
   637  				}
   638  				if r1 != nil {
   639  					r1(d)
   640  				}
   641  			}
   642  		}
   643  	}
   644  	{
   645  		h1 := t.OnConnAllow
   646  		h2 := x.OnConnAllow
   647  		ret.OnConnAllow = func(d DriverConnAllowStartInfo) func(DriverConnAllowDoneInfo) {
   648  			if options.panicCallback != nil {
   649  				defer func() {
   650  					if e := recover(); e != nil {
   651  						options.panicCallback(e)
   652  					}
   653  				}()
   654  			}
   655  			var r, r1 func(DriverConnAllowDoneInfo)
   656  			if h1 != nil {
   657  				r = h1(d)
   658  			}
   659  			if h2 != nil {
   660  				r1 = h2(d)
   661  			}
   662  			return func(d DriverConnAllowDoneInfo) {
   663  				if options.panicCallback != nil {
   664  					defer func() {
   665  						if e := recover(); e != nil {
   666  							options.panicCallback(e)
   667  						}
   668  					}()
   669  				}
   670  				if r != nil {
   671  					r(d)
   672  				}
   673  				if r1 != nil {
   674  					r1(d)
   675  				}
   676  			}
   677  		}
   678  	}
   679  	{
   680  		h1 := t.OnConnClose
   681  		h2 := x.OnConnClose
   682  		ret.OnConnClose = func(d DriverConnCloseStartInfo) func(DriverConnCloseDoneInfo) {
   683  			if options.panicCallback != nil {
   684  				defer func() {
   685  					if e := recover(); e != nil {
   686  						options.panicCallback(e)
   687  					}
   688  				}()
   689  			}
   690  			var r, r1 func(DriverConnCloseDoneInfo)
   691  			if h1 != nil {
   692  				r = h1(d)
   693  			}
   694  			if h2 != nil {
   695  				r1 = h2(d)
   696  			}
   697  			return func(d DriverConnCloseDoneInfo) {
   698  				if options.panicCallback != nil {
   699  					defer func() {
   700  						if e := recover(); e != nil {
   701  							options.panicCallback(e)
   702  						}
   703  					}()
   704  				}
   705  				if r != nil {
   706  					r(d)
   707  				}
   708  				if r1 != nil {
   709  					r1(d)
   710  				}
   711  			}
   712  		}
   713  	}
   714  	{
   715  		h1 := t.OnRepeaterWakeUp
   716  		h2 := x.OnRepeaterWakeUp
   717  		ret.OnRepeaterWakeUp = func(d DriverRepeaterWakeUpStartInfo) func(DriverRepeaterWakeUpDoneInfo) {
   718  			if options.panicCallback != nil {
   719  				defer func() {
   720  					if e := recover(); e != nil {
   721  						options.panicCallback(e)
   722  					}
   723  				}()
   724  			}
   725  			var r, r1 func(DriverRepeaterWakeUpDoneInfo)
   726  			if h1 != nil {
   727  				r = h1(d)
   728  			}
   729  			if h2 != nil {
   730  				r1 = h2(d)
   731  			}
   732  			return func(d DriverRepeaterWakeUpDoneInfo) {
   733  				if options.panicCallback != nil {
   734  					defer func() {
   735  						if e := recover(); e != nil {
   736  							options.panicCallback(e)
   737  						}
   738  					}()
   739  				}
   740  				if r != nil {
   741  					r(d)
   742  				}
   743  				if r1 != nil {
   744  					r1(d)
   745  				}
   746  			}
   747  		}
   748  	}
   749  	{
   750  		h1 := t.OnBalancerInit
   751  		h2 := x.OnBalancerInit
   752  		ret.OnBalancerInit = func(d DriverBalancerInitStartInfo) func(DriverBalancerInitDoneInfo) {
   753  			if options.panicCallback != nil {
   754  				defer func() {
   755  					if e := recover(); e != nil {
   756  						options.panicCallback(e)
   757  					}
   758  				}()
   759  			}
   760  			var r, r1 func(DriverBalancerInitDoneInfo)
   761  			if h1 != nil {
   762  				r = h1(d)
   763  			}
   764  			if h2 != nil {
   765  				r1 = h2(d)
   766  			}
   767  			return func(d DriverBalancerInitDoneInfo) {
   768  				if options.panicCallback != nil {
   769  					defer func() {
   770  						if e := recover(); e != nil {
   771  							options.panicCallback(e)
   772  						}
   773  					}()
   774  				}
   775  				if r != nil {
   776  					r(d)
   777  				}
   778  				if r1 != nil {
   779  					r1(d)
   780  				}
   781  			}
   782  		}
   783  	}
   784  	{
   785  		h1 := t.OnBalancerDialEntrypoint
   786  		h2 := x.OnBalancerDialEntrypoint
   787  		ret.OnBalancerDialEntrypoint = func(d DriverBalancerDialEntrypointStartInfo) func(DriverBalancerDialEntrypointDoneInfo) {
   788  			if options.panicCallback != nil {
   789  				defer func() {
   790  					if e := recover(); e != nil {
   791  						options.panicCallback(e)
   792  					}
   793  				}()
   794  			}
   795  			var r, r1 func(DriverBalancerDialEntrypointDoneInfo)
   796  			if h1 != nil {
   797  				r = h1(d)
   798  			}
   799  			if h2 != nil {
   800  				r1 = h2(d)
   801  			}
   802  			return func(d DriverBalancerDialEntrypointDoneInfo) {
   803  				if options.panicCallback != nil {
   804  					defer func() {
   805  						if e := recover(); e != nil {
   806  							options.panicCallback(e)
   807  						}
   808  					}()
   809  				}
   810  				if r != nil {
   811  					r(d)
   812  				}
   813  				if r1 != nil {
   814  					r1(d)
   815  				}
   816  			}
   817  		}
   818  	}
   819  	{
   820  		h1 := t.OnBalancerClose
   821  		h2 := x.OnBalancerClose
   822  		ret.OnBalancerClose = func(d DriverBalancerCloseStartInfo) func(DriverBalancerCloseDoneInfo) {
   823  			if options.panicCallback != nil {
   824  				defer func() {
   825  					if e := recover(); e != nil {
   826  						options.panicCallback(e)
   827  					}
   828  				}()
   829  			}
   830  			var r, r1 func(DriverBalancerCloseDoneInfo)
   831  			if h1 != nil {
   832  				r = h1(d)
   833  			}
   834  			if h2 != nil {
   835  				r1 = h2(d)
   836  			}
   837  			return func(d DriverBalancerCloseDoneInfo) {
   838  				if options.panicCallback != nil {
   839  					defer func() {
   840  						if e := recover(); e != nil {
   841  							options.panicCallback(e)
   842  						}
   843  					}()
   844  				}
   845  				if r != nil {
   846  					r(d)
   847  				}
   848  				if r1 != nil {
   849  					r1(d)
   850  				}
   851  			}
   852  		}
   853  	}
   854  	{
   855  		h1 := t.OnBalancerChooseEndpoint
   856  		h2 := x.OnBalancerChooseEndpoint
   857  		ret.OnBalancerChooseEndpoint = func(d DriverBalancerChooseEndpointStartInfo) func(DriverBalancerChooseEndpointDoneInfo) {
   858  			if options.panicCallback != nil {
   859  				defer func() {
   860  					if e := recover(); e != nil {
   861  						options.panicCallback(e)
   862  					}
   863  				}()
   864  			}
   865  			var r, r1 func(DriverBalancerChooseEndpointDoneInfo)
   866  			if h1 != nil {
   867  				r = h1(d)
   868  			}
   869  			if h2 != nil {
   870  				r1 = h2(d)
   871  			}
   872  			return func(d DriverBalancerChooseEndpointDoneInfo) {
   873  				if options.panicCallback != nil {
   874  					defer func() {
   875  						if e := recover(); e != nil {
   876  							options.panicCallback(e)
   877  						}
   878  					}()
   879  				}
   880  				if r != nil {
   881  					r(d)
   882  				}
   883  				if r1 != nil {
   884  					r1(d)
   885  				}
   886  			}
   887  		}
   888  	}
   889  	{
   890  		h1 := t.OnBalancerClusterDiscoveryAttempt
   891  		h2 := x.OnBalancerClusterDiscoveryAttempt
   892  		ret.OnBalancerClusterDiscoveryAttempt = func(d DriverBalancerClusterDiscoveryAttemptStartInfo) func(DriverBalancerClusterDiscoveryAttemptDoneInfo) {
   893  			if options.panicCallback != nil {
   894  				defer func() {
   895  					if e := recover(); e != nil {
   896  						options.panicCallback(e)
   897  					}
   898  				}()
   899  			}
   900  			var r, r1 func(DriverBalancerClusterDiscoveryAttemptDoneInfo)
   901  			if h1 != nil {
   902  				r = h1(d)
   903  			}
   904  			if h2 != nil {
   905  				r1 = h2(d)
   906  			}
   907  			return func(d DriverBalancerClusterDiscoveryAttemptDoneInfo) {
   908  				if options.panicCallback != nil {
   909  					defer func() {
   910  						if e := recover(); e != nil {
   911  							options.panicCallback(e)
   912  						}
   913  					}()
   914  				}
   915  				if r != nil {
   916  					r(d)
   917  				}
   918  				if r1 != nil {
   919  					r1(d)
   920  				}
   921  			}
   922  		}
   923  	}
   924  	{
   925  		h1 := t.OnBalancerUpdate
   926  		h2 := x.OnBalancerUpdate
   927  		ret.OnBalancerUpdate = func(d DriverBalancerUpdateStartInfo) func(DriverBalancerUpdateDoneInfo) {
   928  			if options.panicCallback != nil {
   929  				defer func() {
   930  					if e := recover(); e != nil {
   931  						options.panicCallback(e)
   932  					}
   933  				}()
   934  			}
   935  			var r, r1 func(DriverBalancerUpdateDoneInfo)
   936  			if h1 != nil {
   937  				r = h1(d)
   938  			}
   939  			if h2 != nil {
   940  				r1 = h2(d)
   941  			}
   942  			return func(d DriverBalancerUpdateDoneInfo) {
   943  				if options.panicCallback != nil {
   944  					defer func() {
   945  						if e := recover(); e != nil {
   946  							options.panicCallback(e)
   947  						}
   948  					}()
   949  				}
   950  				if r != nil {
   951  					r(d)
   952  				}
   953  				if r1 != nil {
   954  					r1(d)
   955  				}
   956  			}
   957  		}
   958  	}
   959  	{
   960  		h1 := t.OnGetCredentials
   961  		h2 := x.OnGetCredentials
   962  		ret.OnGetCredentials = func(d DriverGetCredentialsStartInfo) func(DriverGetCredentialsDoneInfo) {
   963  			if options.panicCallback != nil {
   964  				defer func() {
   965  					if e := recover(); e != nil {
   966  						options.panicCallback(e)
   967  					}
   968  				}()
   969  			}
   970  			var r, r1 func(DriverGetCredentialsDoneInfo)
   971  			if h1 != nil {
   972  				r = h1(d)
   973  			}
   974  			if h2 != nil {
   975  				r1 = h2(d)
   976  			}
   977  			return func(d DriverGetCredentialsDoneInfo) {
   978  				if options.panicCallback != nil {
   979  					defer func() {
   980  						if e := recover(); e != nil {
   981  							options.panicCallback(e)
   982  						}
   983  					}()
   984  				}
   985  				if r != nil {
   986  					r(d)
   987  				}
   988  				if r1 != nil {
   989  					r1(d)
   990  				}
   991  			}
   992  		}
   993  	}
   994  	return &ret
   995  }
   996  func (t *Driver) onInit(d DriverInitStartInfo) func(DriverInitDoneInfo) {
   997  	fn := t.OnInit
   998  	if fn == nil {
   999  		return func(DriverInitDoneInfo) {
  1000  			return
  1001  		}
  1002  	}
  1003  	res := fn(d)
  1004  	if res == nil {
  1005  		return func(DriverInitDoneInfo) {
  1006  			return
  1007  		}
  1008  	}
  1009  	return res
  1010  }
  1011  func (t *Driver) onWith(d DriverWithStartInfo) func(DriverWithDoneInfo) {
  1012  	fn := t.OnWith
  1013  	if fn == nil {
  1014  		return func(DriverWithDoneInfo) {
  1015  			return
  1016  		}
  1017  	}
  1018  	res := fn(d)
  1019  	if res == nil {
  1020  		return func(DriverWithDoneInfo) {
  1021  			return
  1022  		}
  1023  	}
  1024  	return res
  1025  }
  1026  func (t *Driver) onClose(d DriverCloseStartInfo) func(DriverCloseDoneInfo) {
  1027  	fn := t.OnClose
  1028  	if fn == nil {
  1029  		return func(DriverCloseDoneInfo) {
  1030  			return
  1031  		}
  1032  	}
  1033  	res := fn(d)
  1034  	if res == nil {
  1035  		return func(DriverCloseDoneInfo) {
  1036  			return
  1037  		}
  1038  	}
  1039  	return res
  1040  }
  1041  func (t *Driver) onPoolNew(d DriverConnPoolNewStartInfo) func(DriverConnPoolNewDoneInfo) {
  1042  	fn := t.OnPoolNew
  1043  	if fn == nil {
  1044  		return func(DriverConnPoolNewDoneInfo) {
  1045  			return
  1046  		}
  1047  	}
  1048  	res := fn(d)
  1049  	if res == nil {
  1050  		return func(DriverConnPoolNewDoneInfo) {
  1051  			return
  1052  		}
  1053  	}
  1054  	return res
  1055  }
  1056  func (t *Driver) onPoolRelease(d DriverConnPoolReleaseStartInfo) func(DriverConnPoolReleaseDoneInfo) {
  1057  	fn := t.OnPoolRelease
  1058  	if fn == nil {
  1059  		return func(DriverConnPoolReleaseDoneInfo) {
  1060  			return
  1061  		}
  1062  	}
  1063  	res := fn(d)
  1064  	if res == nil {
  1065  		return func(DriverConnPoolReleaseDoneInfo) {
  1066  			return
  1067  		}
  1068  	}
  1069  	return res
  1070  }
  1071  func (t *Driver) onNetRead(d DriverNetReadStartInfo) func(DriverNetReadDoneInfo) {
  1072  	fn := t.OnNetRead
  1073  	if fn == nil {
  1074  		return func(DriverNetReadDoneInfo) {
  1075  			return
  1076  		}
  1077  	}
  1078  	res := fn(d)
  1079  	if res == nil {
  1080  		return func(DriverNetReadDoneInfo) {
  1081  			return
  1082  		}
  1083  	}
  1084  	return res
  1085  }
  1086  func (t *Driver) onNetWrite(d DriverNetWriteStartInfo) func(DriverNetWriteDoneInfo) {
  1087  	fn := t.OnNetWrite
  1088  	if fn == nil {
  1089  		return func(DriverNetWriteDoneInfo) {
  1090  			return
  1091  		}
  1092  	}
  1093  	res := fn(d)
  1094  	if res == nil {
  1095  		return func(DriverNetWriteDoneInfo) {
  1096  			return
  1097  		}
  1098  	}
  1099  	return res
  1100  }
  1101  func (t *Driver) onNetDial(d DriverNetDialStartInfo) func(DriverNetDialDoneInfo) {
  1102  	fn := t.OnNetDial
  1103  	if fn == nil {
  1104  		return func(DriverNetDialDoneInfo) {
  1105  			return
  1106  		}
  1107  	}
  1108  	res := fn(d)
  1109  	if res == nil {
  1110  		return func(DriverNetDialDoneInfo) {
  1111  			return
  1112  		}
  1113  	}
  1114  	return res
  1115  }
  1116  func (t *Driver) onNetClose(d DriverNetCloseStartInfo) func(DriverNetCloseDoneInfo) {
  1117  	fn := t.OnNetClose
  1118  	if fn == nil {
  1119  		return func(DriverNetCloseDoneInfo) {
  1120  			return
  1121  		}
  1122  	}
  1123  	res := fn(d)
  1124  	if res == nil {
  1125  		return func(DriverNetCloseDoneInfo) {
  1126  			return
  1127  		}
  1128  	}
  1129  	return res
  1130  }
  1131  func (t *Driver) onResolve(d DriverResolveStartInfo) func(DriverResolveDoneInfo) {
  1132  	fn := t.OnResolve
  1133  	if fn == nil {
  1134  		return func(DriverResolveDoneInfo) {
  1135  			return
  1136  		}
  1137  	}
  1138  	res := fn(d)
  1139  	if res == nil {
  1140  		return func(DriverResolveDoneInfo) {
  1141  			return
  1142  		}
  1143  	}
  1144  	return res
  1145  }
  1146  func (t *Driver) onConnStateChange(d DriverConnStateChangeStartInfo) func(DriverConnStateChangeDoneInfo) {
  1147  	fn := t.OnConnStateChange
  1148  	if fn == nil {
  1149  		return func(DriverConnStateChangeDoneInfo) {
  1150  			return
  1151  		}
  1152  	}
  1153  	res := fn(d)
  1154  	if res == nil {
  1155  		return func(DriverConnStateChangeDoneInfo) {
  1156  			return
  1157  		}
  1158  	}
  1159  	return res
  1160  }
  1161  func (t *Driver) onConnInvoke(d DriverConnInvokeStartInfo) func(DriverConnInvokeDoneInfo) {
  1162  	fn := t.OnConnInvoke
  1163  	if fn == nil {
  1164  		return func(DriverConnInvokeDoneInfo) {
  1165  			return
  1166  		}
  1167  	}
  1168  	res := fn(d)
  1169  	if res == nil {
  1170  		return func(DriverConnInvokeDoneInfo) {
  1171  			return
  1172  		}
  1173  	}
  1174  	return res
  1175  }
  1176  func (t *Driver) onConnNewStream(d DriverConnNewStreamStartInfo) func(DriverConnNewStreamRecvInfo) func(DriverConnNewStreamDoneInfo) {
  1177  	fn := t.OnConnNewStream
  1178  	if fn == nil {
  1179  		return func(DriverConnNewStreamRecvInfo) func(DriverConnNewStreamDoneInfo) {
  1180  			return func(DriverConnNewStreamDoneInfo) {
  1181  				return
  1182  			}
  1183  		}
  1184  	}
  1185  	res := fn(d)
  1186  	if res == nil {
  1187  		return func(DriverConnNewStreamRecvInfo) func(DriverConnNewStreamDoneInfo) {
  1188  			return func(DriverConnNewStreamDoneInfo) {
  1189  				return
  1190  			}
  1191  		}
  1192  	}
  1193  	return func(d DriverConnNewStreamRecvInfo) func(DriverConnNewStreamDoneInfo) {
  1194  		res := res(d)
  1195  		if res == nil {
  1196  			return func(DriverConnNewStreamDoneInfo) {
  1197  				return
  1198  			}
  1199  		}
  1200  		return res
  1201  	}
  1202  }
  1203  func (t *Driver) onConnTake(d DriverConnTakeStartInfo) func(DriverConnTakeDoneInfo) {
  1204  	fn := t.OnConnTake
  1205  	if fn == nil {
  1206  		return func(DriverConnTakeDoneInfo) {
  1207  			return
  1208  		}
  1209  	}
  1210  	res := fn(d)
  1211  	if res == nil {
  1212  		return func(DriverConnTakeDoneInfo) {
  1213  			return
  1214  		}
  1215  	}
  1216  	return res
  1217  }
  1218  func (t *Driver) onConnDial(d DriverConnDialStartInfo) func(DriverConnDialDoneInfo) {
  1219  	fn := t.OnConnDial
  1220  	if fn == nil {
  1221  		return func(DriverConnDialDoneInfo) {
  1222  			return
  1223  		}
  1224  	}
  1225  	res := fn(d)
  1226  	if res == nil {
  1227  		return func(DriverConnDialDoneInfo) {
  1228  			return
  1229  		}
  1230  	}
  1231  	return res
  1232  }
  1233  func (t *Driver) onConnPark(d DriverConnParkStartInfo) func(DriverConnParkDoneInfo) {
  1234  	fn := t.OnConnPark
  1235  	if fn == nil {
  1236  		return func(DriverConnParkDoneInfo) {
  1237  			return
  1238  		}
  1239  	}
  1240  	res := fn(d)
  1241  	if res == nil {
  1242  		return func(DriverConnParkDoneInfo) {
  1243  			return
  1244  		}
  1245  	}
  1246  	return res
  1247  }
  1248  func (t *Driver) onConnBan(d DriverConnBanStartInfo) func(DriverConnBanDoneInfo) {
  1249  	fn := t.OnConnBan
  1250  	if fn == nil {
  1251  		return func(DriverConnBanDoneInfo) {
  1252  			return
  1253  		}
  1254  	}
  1255  	res := fn(d)
  1256  	if res == nil {
  1257  		return func(DriverConnBanDoneInfo) {
  1258  			return
  1259  		}
  1260  	}
  1261  	return res
  1262  }
  1263  func (t *Driver) onConnAllow(d DriverConnAllowStartInfo) func(DriverConnAllowDoneInfo) {
  1264  	fn := t.OnConnAllow
  1265  	if fn == nil {
  1266  		return func(DriverConnAllowDoneInfo) {
  1267  			return
  1268  		}
  1269  	}
  1270  	res := fn(d)
  1271  	if res == nil {
  1272  		return func(DriverConnAllowDoneInfo) {
  1273  			return
  1274  		}
  1275  	}
  1276  	return res
  1277  }
  1278  func (t *Driver) onConnClose(d DriverConnCloseStartInfo) func(DriverConnCloseDoneInfo) {
  1279  	fn := t.OnConnClose
  1280  	if fn == nil {
  1281  		return func(DriverConnCloseDoneInfo) {
  1282  			return
  1283  		}
  1284  	}
  1285  	res := fn(d)
  1286  	if res == nil {
  1287  		return func(DriverConnCloseDoneInfo) {
  1288  			return
  1289  		}
  1290  	}
  1291  	return res
  1292  }
  1293  func (t *Driver) onRepeaterWakeUp(d DriverRepeaterWakeUpStartInfo) func(DriverRepeaterWakeUpDoneInfo) {
  1294  	fn := t.OnRepeaterWakeUp
  1295  	if fn == nil {
  1296  		return func(DriverRepeaterWakeUpDoneInfo) {
  1297  			return
  1298  		}
  1299  	}
  1300  	res := fn(d)
  1301  	if res == nil {
  1302  		return func(DriverRepeaterWakeUpDoneInfo) {
  1303  			return
  1304  		}
  1305  	}
  1306  	return res
  1307  }
  1308  func (t *Driver) onBalancerInit(d DriverBalancerInitStartInfo) func(DriverBalancerInitDoneInfo) {
  1309  	fn := t.OnBalancerInit
  1310  	if fn == nil {
  1311  		return func(DriverBalancerInitDoneInfo) {
  1312  			return
  1313  		}
  1314  	}
  1315  	res := fn(d)
  1316  	if res == nil {
  1317  		return func(DriverBalancerInitDoneInfo) {
  1318  			return
  1319  		}
  1320  	}
  1321  	return res
  1322  }
  1323  func (t *Driver) onBalancerDialEntrypoint(d DriverBalancerDialEntrypointStartInfo) func(DriverBalancerDialEntrypointDoneInfo) {
  1324  	fn := t.OnBalancerDialEntrypoint
  1325  	if fn == nil {
  1326  		return func(DriverBalancerDialEntrypointDoneInfo) {
  1327  			return
  1328  		}
  1329  	}
  1330  	res := fn(d)
  1331  	if res == nil {
  1332  		return func(DriverBalancerDialEntrypointDoneInfo) {
  1333  			return
  1334  		}
  1335  	}
  1336  	return res
  1337  }
  1338  func (t *Driver) onBalancerClose(d DriverBalancerCloseStartInfo) func(DriverBalancerCloseDoneInfo) {
  1339  	fn := t.OnBalancerClose
  1340  	if fn == nil {
  1341  		return func(DriverBalancerCloseDoneInfo) {
  1342  			return
  1343  		}
  1344  	}
  1345  	res := fn(d)
  1346  	if res == nil {
  1347  		return func(DriverBalancerCloseDoneInfo) {
  1348  			return
  1349  		}
  1350  	}
  1351  	return res
  1352  }
  1353  func (t *Driver) onBalancerChooseEndpoint(d DriverBalancerChooseEndpointStartInfo) func(DriverBalancerChooseEndpointDoneInfo) {
  1354  	fn := t.OnBalancerChooseEndpoint
  1355  	if fn == nil {
  1356  		return func(DriverBalancerChooseEndpointDoneInfo) {
  1357  			return
  1358  		}
  1359  	}
  1360  	res := fn(d)
  1361  	if res == nil {
  1362  		return func(DriverBalancerChooseEndpointDoneInfo) {
  1363  			return
  1364  		}
  1365  	}
  1366  	return res
  1367  }
  1368  func (t *Driver) onBalancerClusterDiscoveryAttempt(d DriverBalancerClusterDiscoveryAttemptStartInfo) func(DriverBalancerClusterDiscoveryAttemptDoneInfo) {
  1369  	fn := t.OnBalancerClusterDiscoveryAttempt
  1370  	if fn == nil {
  1371  		return func(DriverBalancerClusterDiscoveryAttemptDoneInfo) {
  1372  			return
  1373  		}
  1374  	}
  1375  	res := fn(d)
  1376  	if res == nil {
  1377  		return func(DriverBalancerClusterDiscoveryAttemptDoneInfo) {
  1378  			return
  1379  		}
  1380  	}
  1381  	return res
  1382  }
  1383  func (t *Driver) onBalancerUpdate(d DriverBalancerUpdateStartInfo) func(DriverBalancerUpdateDoneInfo) {
  1384  	fn := t.OnBalancerUpdate
  1385  	if fn == nil {
  1386  		return func(DriverBalancerUpdateDoneInfo) {
  1387  			return
  1388  		}
  1389  	}
  1390  	res := fn(d)
  1391  	if res == nil {
  1392  		return func(DriverBalancerUpdateDoneInfo) {
  1393  			return
  1394  		}
  1395  	}
  1396  	return res
  1397  }
  1398  func (t *Driver) onGetCredentials(d DriverGetCredentialsStartInfo) func(DriverGetCredentialsDoneInfo) {
  1399  	fn := t.OnGetCredentials
  1400  	if fn == nil {
  1401  		return func(DriverGetCredentialsDoneInfo) {
  1402  			return
  1403  		}
  1404  	}
  1405  	res := fn(d)
  1406  	if res == nil {
  1407  		return func(DriverGetCredentialsDoneInfo) {
  1408  			return
  1409  		}
  1410  	}
  1411  	return res
  1412  }
  1413  func DriverOnInit(t *Driver, c *context.Context, call call, endpoint string, database string, secure bool) func(error) {
  1414  	var p DriverInitStartInfo
  1415  	p.Context = c
  1416  	p.Call = call
  1417  	p.Endpoint = endpoint
  1418  	p.Database = database
  1419  	p.Secure = secure
  1420  	res := t.onInit(p)
  1421  	return func(e error) {
  1422  		var p DriverInitDoneInfo
  1423  		p.Error = e
  1424  		res(p)
  1425  	}
  1426  }
  1427  func DriverOnWith(t *Driver, c *context.Context, call call, endpoint string, database string, secure bool) func(error) {
  1428  	var p DriverWithStartInfo
  1429  	p.Context = c
  1430  	p.Call = call
  1431  	p.Endpoint = endpoint
  1432  	p.Database = database
  1433  	p.Secure = secure
  1434  	res := t.onWith(p)
  1435  	return func(e error) {
  1436  		var p DriverWithDoneInfo
  1437  		p.Error = e
  1438  		res(p)
  1439  	}
  1440  }
  1441  func DriverOnClose(t *Driver, c *context.Context, call call) func(error) {
  1442  	var p DriverCloseStartInfo
  1443  	p.Context = c
  1444  	p.Call = call
  1445  	res := t.onClose(p)
  1446  	return func(e error) {
  1447  		var p DriverCloseDoneInfo
  1448  		p.Error = e
  1449  		res(p)
  1450  	}
  1451  }
  1452  func DriverOnPoolNew(t *Driver, c *context.Context, call call) func() {
  1453  	var p DriverConnPoolNewStartInfo
  1454  	p.Context = c
  1455  	p.Call = call
  1456  	res := t.onPoolNew(p)
  1457  	return func() {
  1458  		var p DriverConnPoolNewDoneInfo
  1459  		res(p)
  1460  	}
  1461  }
  1462  func DriverOnPoolRelease(t *Driver, c *context.Context, call call) func(error) {
  1463  	var p DriverConnPoolReleaseStartInfo
  1464  	p.Context = c
  1465  	p.Call = call
  1466  	res := t.onPoolRelease(p)
  1467  	return func(e error) {
  1468  		var p DriverConnPoolReleaseDoneInfo
  1469  		p.Error = e
  1470  		res(p)
  1471  	}
  1472  }
  1473  func DriverOnNetRead(t *Driver, call call, address string, buffer int) func(received int, _ error) {
  1474  	var p DriverNetReadStartInfo
  1475  	p.Call = call
  1476  	p.Address = address
  1477  	p.Buffer = buffer
  1478  	res := t.onNetRead(p)
  1479  	return func(received int, e error) {
  1480  		var p DriverNetReadDoneInfo
  1481  		p.Received = received
  1482  		p.Error = e
  1483  		res(p)
  1484  	}
  1485  }
  1486  func DriverOnNetWrite(t *Driver, call call, address string, bytes int) func(sent int, _ error) {
  1487  	var p DriverNetWriteStartInfo
  1488  	p.Call = call
  1489  	p.Address = address
  1490  	p.Bytes = bytes
  1491  	res := t.onNetWrite(p)
  1492  	return func(sent int, e error) {
  1493  		var p DriverNetWriteDoneInfo
  1494  		p.Sent = sent
  1495  		p.Error = e
  1496  		res(p)
  1497  	}
  1498  }
  1499  func DriverOnNetDial(t *Driver, c *context.Context, call call, address string) func(error) {
  1500  	var p DriverNetDialStartInfo
  1501  	p.Context = c
  1502  	p.Call = call
  1503  	p.Address = address
  1504  	res := t.onNetDial(p)
  1505  	return func(e error) {
  1506  		var p DriverNetDialDoneInfo
  1507  		p.Error = e
  1508  		res(p)
  1509  	}
  1510  }
  1511  func DriverOnNetClose(t *Driver, call call, address string) func(error) {
  1512  	var p DriverNetCloseStartInfo
  1513  	p.Call = call
  1514  	p.Address = address
  1515  	res := t.onNetClose(p)
  1516  	return func(e error) {
  1517  		var p DriverNetCloseDoneInfo
  1518  		p.Error = e
  1519  		res(p)
  1520  	}
  1521  }
  1522  func DriverOnResolve(t *Driver, call call, target string, resolved []string) func(error) {
  1523  	var p DriverResolveStartInfo
  1524  	p.Call = call
  1525  	p.Target = target
  1526  	p.Resolved = resolved
  1527  	res := t.onResolve(p)
  1528  	return func(e error) {
  1529  		var p DriverResolveDoneInfo
  1530  		p.Error = e
  1531  		res(p)
  1532  	}
  1533  }
  1534  func DriverOnConnStateChange(t *Driver, c *context.Context, call call, endpoint EndpointInfo, state ConnState) func(state ConnState) {
  1535  	var p DriverConnStateChangeStartInfo
  1536  	p.Context = c
  1537  	p.Call = call
  1538  	p.Endpoint = endpoint
  1539  	p.State = state
  1540  	res := t.onConnStateChange(p)
  1541  	return func(state ConnState) {
  1542  		var p DriverConnStateChangeDoneInfo
  1543  		p.State = state
  1544  		res(p)
  1545  	}
  1546  }
  1547  func DriverOnConnInvoke(t *Driver, c *context.Context, call call, endpoint EndpointInfo, m Method) func(_ error, issues []Issue, opID string, state ConnState, metadata map[string][]string) {
  1548  	var p DriverConnInvokeStartInfo
  1549  	p.Context = c
  1550  	p.Call = call
  1551  	p.Endpoint = endpoint
  1552  	p.Method = m
  1553  	res := t.onConnInvoke(p)
  1554  	return func(e error, issues []Issue, opID string, state ConnState, metadata map[string][]string) {
  1555  		var p DriverConnInvokeDoneInfo
  1556  		p.Error = e
  1557  		p.Issues = issues
  1558  		p.OpID = opID
  1559  		p.State = state
  1560  		p.Metadata = metadata
  1561  		res(p)
  1562  	}
  1563  }
  1564  func DriverOnConnNewStream(t *Driver, c *context.Context, call call, endpoint EndpointInfo, m Method) func(error) func(_ error, state ConnState, metadata map[string][]string) {
  1565  	var p DriverConnNewStreamStartInfo
  1566  	p.Context = c
  1567  	p.Call = call
  1568  	p.Endpoint = endpoint
  1569  	p.Method = m
  1570  	res := t.onConnNewStream(p)
  1571  	return func(e error) func(error, ConnState, map[string][]string) {
  1572  		var p DriverConnNewStreamRecvInfo
  1573  		p.Error = e
  1574  		res := res(p)
  1575  		return func(e error, state ConnState, metadata map[string][]string) {
  1576  			var p DriverConnNewStreamDoneInfo
  1577  			p.Error = e
  1578  			p.State = state
  1579  			p.Metadata = metadata
  1580  			res(p)
  1581  		}
  1582  	}
  1583  }
  1584  func DriverOnConnTake(t *Driver, c *context.Context, call call, endpoint EndpointInfo) func(error) {
  1585  	var p DriverConnTakeStartInfo
  1586  	p.Context = c
  1587  	p.Call = call
  1588  	p.Endpoint = endpoint
  1589  	res := t.onConnTake(p)
  1590  	return func(e error) {
  1591  		var p DriverConnTakeDoneInfo
  1592  		p.Error = e
  1593  		res(p)
  1594  	}
  1595  }
  1596  func DriverOnConnDial(t *Driver, c *context.Context, call call, endpoint EndpointInfo) func(error) {
  1597  	var p DriverConnDialStartInfo
  1598  	p.Context = c
  1599  	p.Call = call
  1600  	p.Endpoint = endpoint
  1601  	res := t.onConnDial(p)
  1602  	return func(e error) {
  1603  		var p DriverConnDialDoneInfo
  1604  		p.Error = e
  1605  		res(p)
  1606  	}
  1607  }
  1608  func DriverOnConnPark(t *Driver, c *context.Context, call call, endpoint EndpointInfo) func(error) {
  1609  	var p DriverConnParkStartInfo
  1610  	p.Context = c
  1611  	p.Call = call
  1612  	p.Endpoint = endpoint
  1613  	res := t.onConnPark(p)
  1614  	return func(e error) {
  1615  		var p DriverConnParkDoneInfo
  1616  		p.Error = e
  1617  		res(p)
  1618  	}
  1619  }
  1620  func DriverOnConnBan(t *Driver, c *context.Context, call call, endpoint EndpointInfo, state ConnState, cause error) func(state ConnState) {
  1621  	var p DriverConnBanStartInfo
  1622  	p.Context = c
  1623  	p.Call = call
  1624  	p.Endpoint = endpoint
  1625  	p.State = state
  1626  	p.Cause = cause
  1627  	res := t.onConnBan(p)
  1628  	return func(state ConnState) {
  1629  		var p DriverConnBanDoneInfo
  1630  		p.State = state
  1631  		res(p)
  1632  	}
  1633  }
  1634  func DriverOnConnAllow(t *Driver, c *context.Context, call call, endpoint EndpointInfo, state ConnState) func(state ConnState) {
  1635  	var p DriverConnAllowStartInfo
  1636  	p.Context = c
  1637  	p.Call = call
  1638  	p.Endpoint = endpoint
  1639  	p.State = state
  1640  	res := t.onConnAllow(p)
  1641  	return func(state ConnState) {
  1642  		var p DriverConnAllowDoneInfo
  1643  		p.State = state
  1644  		res(p)
  1645  	}
  1646  }
  1647  func DriverOnConnClose(t *Driver, c *context.Context, call call, endpoint EndpointInfo) func(error) {
  1648  	var p DriverConnCloseStartInfo
  1649  	p.Context = c
  1650  	p.Call = call
  1651  	p.Endpoint = endpoint
  1652  	res := t.onConnClose(p)
  1653  	return func(e error) {
  1654  		var p DriverConnCloseDoneInfo
  1655  		p.Error = e
  1656  		res(p)
  1657  	}
  1658  }
  1659  func DriverOnRepeaterWakeUp(t *Driver, c *context.Context, call call, name string, event string) func(error) {
  1660  	var p DriverRepeaterWakeUpStartInfo
  1661  	p.Context = c
  1662  	p.Call = call
  1663  	p.Name = name
  1664  	p.Event = event
  1665  	res := t.onRepeaterWakeUp(p)
  1666  	return func(e error) {
  1667  		var p DriverRepeaterWakeUpDoneInfo
  1668  		p.Error = e
  1669  		res(p)
  1670  	}
  1671  }
  1672  func DriverOnBalancerInit(t *Driver, c *context.Context, call call, name string) func(error) {
  1673  	var p DriverBalancerInitStartInfo
  1674  	p.Context = c
  1675  	p.Call = call
  1676  	p.Name = name
  1677  	res := t.onBalancerInit(p)
  1678  	return func(e error) {
  1679  		var p DriverBalancerInitDoneInfo
  1680  		p.Error = e
  1681  		res(p)
  1682  	}
  1683  }
  1684  func DriverOnBalancerDialEntrypoint(t *Driver, c *context.Context, call call, address string) func(error) {
  1685  	var p DriverBalancerDialEntrypointStartInfo
  1686  	p.Context = c
  1687  	p.Call = call
  1688  	p.Address = address
  1689  	res := t.onBalancerDialEntrypoint(p)
  1690  	return func(e error) {
  1691  		var p DriverBalancerDialEntrypointDoneInfo
  1692  		p.Error = e
  1693  		res(p)
  1694  	}
  1695  }
  1696  func DriverOnBalancerClose(t *Driver, c *context.Context, call call) func(error) {
  1697  	var p DriverBalancerCloseStartInfo
  1698  	p.Context = c
  1699  	p.Call = call
  1700  	res := t.onBalancerClose(p)
  1701  	return func(e error) {
  1702  		var p DriverBalancerCloseDoneInfo
  1703  		p.Error = e
  1704  		res(p)
  1705  	}
  1706  }
  1707  func DriverOnBalancerChooseEndpoint(t *Driver, c *context.Context, call call) func(endpoint EndpointInfo, _ error) {
  1708  	var p DriverBalancerChooseEndpointStartInfo
  1709  	p.Context = c
  1710  	p.Call = call
  1711  	res := t.onBalancerChooseEndpoint(p)
  1712  	return func(endpoint EndpointInfo, e error) {
  1713  		var p DriverBalancerChooseEndpointDoneInfo
  1714  		p.Endpoint = endpoint
  1715  		p.Error = e
  1716  		res(p)
  1717  	}
  1718  }
  1719  func DriverOnBalancerClusterDiscoveryAttempt(t *Driver, c *context.Context, call call, address string) func(error) {
  1720  	var p DriverBalancerClusterDiscoveryAttemptStartInfo
  1721  	p.Context = c
  1722  	p.Call = call
  1723  	p.Address = address
  1724  	res := t.onBalancerClusterDiscoveryAttempt(p)
  1725  	return func(e error) {
  1726  		var p DriverBalancerClusterDiscoveryAttemptDoneInfo
  1727  		p.Error = e
  1728  		res(p)
  1729  	}
  1730  }
  1731  func DriverOnBalancerUpdate(t *Driver, c *context.Context, call call, needLocalDC bool) func(endpoints []EndpointInfo, added []EndpointInfo, dropped []EndpointInfo, localDC string, _ error) {
  1732  	var p DriverBalancerUpdateStartInfo
  1733  	p.Context = c
  1734  	p.Call = call
  1735  	p.NeedLocalDC = needLocalDC
  1736  	res := t.onBalancerUpdate(p)
  1737  	return func(endpoints []EndpointInfo, added []EndpointInfo, dropped []EndpointInfo, localDC string, e error) {
  1738  		var p DriverBalancerUpdateDoneInfo
  1739  		p.Endpoints = endpoints
  1740  		p.Added = added
  1741  		p.Dropped = dropped
  1742  		p.LocalDC = localDC
  1743  		p.Error = e
  1744  		res(p)
  1745  	}
  1746  }
  1747  func DriverOnGetCredentials(t *Driver, c *context.Context, call call) func(token string, _ error) {
  1748  	var p DriverGetCredentialsStartInfo
  1749  	p.Context = c
  1750  	p.Call = call
  1751  	res := t.onGetCredentials(p)
  1752  	return func(token string, e error) {
  1753  		var p DriverGetCredentialsDoneInfo
  1754  		p.Token = token
  1755  		p.Error = e
  1756  		res(p)
  1757  	}
  1758  }