// Code generated by gtrace. DO NOT EDIT.

package gtrace

import (
	"context"
	"time"

	"github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Coordination"
	"github.com/ydb-platform/ydb-go-sdk/v3/trace"
)

// coordinationComposeOptions is a holder of options
type coordinationComposeOptions struct {
	panicCallback func(e interface{})
}

// CoordinationOption specified Coordination compose option
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
type CoordinationComposeOption func(o *coordinationComposeOptions)

// WithCoordinationPanicCallback specified behavior on panic
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func WithCoordinationPanicCallback(cb func(e interface{})) CoordinationComposeOption {
	return func(o *coordinationComposeOptions) {
		o.panicCallback = cb
	}
}

// Compose returns a new Coordination which has functional fields composed both from lhs and rhs.
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func Compose(lhs *trace.Coordination, rhs *trace.Coordination, opts ...CoordinationComposeOption) *trace.Coordination {
	if lhs == nil {
		return rhs
	}
	var ret trace.Coordination
	options := coordinationComposeOptions{}
	for _, opt := range opts {
		if opt != nil {
			opt(&options)
		}
	}
	{
		h1 := lhs.OnNew
		h2 := rhs.OnNew
		ret.OnNew = func(c trace.CoordinationNewStartInfo) func(trace.CoordinationNewDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.CoordinationNewDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c trace.CoordinationNewDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := lhs.OnCreateNode
		h2 := rhs.OnCreateNode
		ret.OnCreateNode = func(c trace.CoordinationCreateNodeStartInfo) func(trace.CoordinationCreateNodeDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.CoordinationCreateNodeDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c trace.CoordinationCreateNodeDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := lhs.OnAlterNode
		h2 := rhs.OnAlterNode
		ret.OnAlterNode = func(c trace.CoordinationAlterNodeStartInfo) func(trace.CoordinationAlterNodeDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.CoordinationAlterNodeDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c trace.CoordinationAlterNodeDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := lhs.OnDropNode
		h2 := rhs.OnDropNode
		ret.OnDropNode = func(c trace.CoordinationDropNodeStartInfo) func(trace.CoordinationDropNodeDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.CoordinationDropNodeDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c trace.CoordinationDropNodeDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := lhs.OnDescribeNode
		h2 := rhs.OnDescribeNode
		ret.OnDescribeNode = func(c trace.CoordinationDescribeNodeStartInfo) func(trace.CoordinationDescribeNodeDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.CoordinationDescribeNodeDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c trace.CoordinationDescribeNodeDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := lhs.OnSession
		h2 := rhs.OnSession
		ret.OnSession = func(c trace.CoordinationSessionStartInfo) func(trace.CoordinationSessionDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.CoordinationSessionDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c trace.CoordinationSessionDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := lhs.OnClose
		h2 := rhs.OnClose
		ret.OnClose = func(c trace.CoordinationCloseStartInfo) func(trace.CoordinationCloseDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.CoordinationCloseDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c trace.CoordinationCloseDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := lhs.OnSessionNewStream
		h2 := rhs.OnSessionNewStream
		ret.OnSessionNewStream = func(c trace.CoordinationSessionNewStreamStartInfo) func(trace.CoordinationSessionNewStreamDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.CoordinationSessionNewStreamDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c trace.CoordinationSessionNewStreamDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := lhs.OnSessionStarted
		h2 := rhs.OnSessionStarted
		ret.OnSessionStarted = func(c trace.CoordinationSessionStartedInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := lhs.OnSessionStartTimeout
		h2 := rhs.OnSessionStartTimeout
		ret.OnSessionStartTimeout = func(c trace.CoordinationSessionStartTimeoutInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := lhs.OnSessionKeepAliveTimeout
		h2 := rhs.OnSessionKeepAliveTimeout
		ret.OnSessionKeepAliveTimeout = func(c trace.CoordinationSessionKeepAliveTimeoutInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := lhs.OnSessionStopped
		h2 := rhs.OnSessionStopped
		ret.OnSessionStopped = func(c trace.CoordinationSessionStoppedInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := lhs.OnSessionStopTimeout
		h2 := rhs.OnSessionStopTimeout
		ret.OnSessionStopTimeout = func(c trace.CoordinationSessionStopTimeoutInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := lhs.OnSessionClientTimeout
		h2 := rhs.OnSessionClientTimeout
		ret.OnSessionClientTimeout = func(c trace.CoordinationSessionClientTimeoutInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := lhs.OnSessionServerExpire
		h2 := rhs.OnSessionServerExpire
		ret.OnSessionServerExpire = func(c trace.CoordinationSessionServerExpireInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := lhs.OnSessionServerError
		h2 := rhs.OnSessionServerError
		ret.OnSessionServerError = func(c trace.CoordinationSessionServerErrorInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := lhs.OnSessionReceive
		h2 := rhs.OnSessionReceive
		ret.OnSessionReceive = func(c trace.CoordinationSessionReceiveStartInfo) func(trace.CoordinationSessionReceiveDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.CoordinationSessionReceiveDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c trace.CoordinationSessionReceiveDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := lhs.OnSessionReceiveUnexpected
		h2 := rhs.OnSessionReceiveUnexpected
		ret.OnSessionReceiveUnexpected = func(c trace.CoordinationSessionReceiveUnexpectedInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := lhs.OnSessionStop
		h2 := rhs.OnSessionStop
		ret.OnSessionStop = func(c trace.CoordinationSessionStopInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := lhs.OnSessionStart
		h2 := rhs.OnSessionStart
		ret.OnSessionStart = func(c trace.CoordinationSessionStartStartInfo) func(trace.CoordinationSessionStartDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.CoordinationSessionStartDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c trace.CoordinationSessionStartDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := lhs.OnSessionSend
		h2 := rhs.OnSessionSend
		ret.OnSessionSend = func(c trace.CoordinationSessionSendStartInfo) func(trace.CoordinationSessionSendDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.CoordinationSessionSendDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c trace.CoordinationSessionSendDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	return &ret
}
func onNew(t *trace.Coordination, c trace.CoordinationNewStartInfo) func(trace.CoordinationNewDoneInfo) {
	fn := t.OnNew
	if fn == nil {
		return func(trace.CoordinationNewDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(trace.CoordinationNewDoneInfo) {
			return
		}
	}
	return res
}
func onCreateNode(t *trace.Coordination, c trace.CoordinationCreateNodeStartInfo) func(trace.CoordinationCreateNodeDoneInfo) {
	fn := t.OnCreateNode
	if fn == nil {
		return func(trace.CoordinationCreateNodeDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(trace.CoordinationCreateNodeDoneInfo) {
			return
		}
	}
	return res
}
func onAlterNode(t *trace.Coordination, c trace.CoordinationAlterNodeStartInfo) func(trace.CoordinationAlterNodeDoneInfo) {
	fn := t.OnAlterNode
	if fn == nil {
		return func(trace.CoordinationAlterNodeDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(trace.CoordinationAlterNodeDoneInfo) {
			return
		}
	}
	return res
}
func onDropNode(t *trace.Coordination, c trace.CoordinationDropNodeStartInfo) func(trace.CoordinationDropNodeDoneInfo) {
	fn := t.OnDropNode
	if fn == nil {
		return func(trace.CoordinationDropNodeDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(trace.CoordinationDropNodeDoneInfo) {
			return
		}
	}
	return res
}
func onDescribeNode(t *trace.Coordination, c trace.CoordinationDescribeNodeStartInfo) func(trace.CoordinationDescribeNodeDoneInfo) {
	fn := t.OnDescribeNode
	if fn == nil {
		return func(trace.CoordinationDescribeNodeDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(trace.CoordinationDescribeNodeDoneInfo) {
			return
		}
	}
	return res
}
func onSession(t *trace.Coordination, c trace.CoordinationSessionStartInfo) func(trace.CoordinationSessionDoneInfo) {
	fn := t.OnSession
	if fn == nil {
		return func(trace.CoordinationSessionDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(trace.CoordinationSessionDoneInfo) {
			return
		}
	}
	return res
}
func onClose(t *trace.Coordination, c trace.CoordinationCloseStartInfo) func(trace.CoordinationCloseDoneInfo) {
	fn := t.OnClose
	if fn == nil {
		return func(trace.CoordinationCloseDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(trace.CoordinationCloseDoneInfo) {
			return
		}
	}
	return res
}
func onSessionNewStream(t *trace.Coordination, c trace.CoordinationSessionNewStreamStartInfo) func(trace.CoordinationSessionNewStreamDoneInfo) {
	fn := t.OnSessionNewStream
	if fn == nil {
		return func(trace.CoordinationSessionNewStreamDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(trace.CoordinationSessionNewStreamDoneInfo) {
			return
		}
	}
	return res
}
func onSessionStarted(t *trace.Coordination, c trace.CoordinationSessionStartedInfo) {
	fn := t.OnSessionStarted
	if fn == nil {
		return
	}
	fn(c)
}
func onSessionStartTimeout(t *trace.Coordination, c trace.CoordinationSessionStartTimeoutInfo) {
	fn := t.OnSessionStartTimeout
	if fn == nil {
		return
	}
	fn(c)
}
func onSessionKeepAliveTimeout(t *trace.Coordination, c trace.CoordinationSessionKeepAliveTimeoutInfo) {
	fn := t.OnSessionKeepAliveTimeout
	if fn == nil {
		return
	}
	fn(c)
}
func onSessionStopped(t *trace.Coordination, c trace.CoordinationSessionStoppedInfo) {
	fn := t.OnSessionStopped
	if fn == nil {
		return
	}
	fn(c)
}
func onSessionStopTimeout(t *trace.Coordination, c trace.CoordinationSessionStopTimeoutInfo) {
	fn := t.OnSessionStopTimeout
	if fn == nil {
		return
	}
	fn(c)
}
func onSessionClientTimeout(t *trace.Coordination, c trace.CoordinationSessionClientTimeoutInfo) {
	fn := t.OnSessionClientTimeout
	if fn == nil {
		return
	}
	fn(c)
}
func onSessionServerExpire(t *trace.Coordination, c trace.CoordinationSessionServerExpireInfo) {
	fn := t.OnSessionServerExpire
	if fn == nil {
		return
	}
	fn(c)
}
func onSessionServerError(t *trace.Coordination, c trace.CoordinationSessionServerErrorInfo) {
	fn := t.OnSessionServerError
	if fn == nil {
		return
	}
	fn(c)
}
func onSessionReceive(t *trace.Coordination, c trace.CoordinationSessionReceiveStartInfo) func(trace.CoordinationSessionReceiveDoneInfo) {
	fn := t.OnSessionReceive
	if fn == nil {
		return func(trace.CoordinationSessionReceiveDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(trace.CoordinationSessionReceiveDoneInfo) {
			return
		}
	}
	return res
}
func onSessionReceiveUnexpected(t *trace.Coordination, c trace.CoordinationSessionReceiveUnexpectedInfo) {
	fn := t.OnSessionReceiveUnexpected
	if fn == nil {
		return
	}
	fn(c)
}
func onSessionStop(t *trace.Coordination, c trace.CoordinationSessionStopInfo) {
	fn := t.OnSessionStop
	if fn == nil {
		return
	}
	fn(c)
}
func onSessionStart(t *trace.Coordination, c trace.CoordinationSessionStartStartInfo) func(trace.CoordinationSessionStartDoneInfo) {
	fn := t.OnSessionStart
	if fn == nil {
		return func(trace.CoordinationSessionStartDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(trace.CoordinationSessionStartDoneInfo) {
			return
		}
	}
	return res
}
func onSessionSend(t *trace.Coordination, c trace.CoordinationSessionSendStartInfo) func(trace.CoordinationSessionSendDoneInfo) {
	fn := t.OnSessionSend
	if fn == nil {
		return func(trace.CoordinationSessionSendDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(trace.CoordinationSessionSendDoneInfo) {
			return
		}
	}
	return res
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnNew(t *trace.Coordination, c *context.Context, c1 trace.Call) func() {
	var p trace.CoordinationNewStartInfo
	p.Context = c
	p.Call = c1
	res := onNew(t, p)
	return func() {
		var p trace.CoordinationNewDoneInfo
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnCreateNode(t *trace.Coordination, c *context.Context, c1 trace.Call, path string) func(error) {
	var p trace.CoordinationCreateNodeStartInfo
	p.Context = c
	p.Call = c1
	p.Path = path
	res := onCreateNode(t, p)
	return func(e error) {
		var p trace.CoordinationCreateNodeDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnAlterNode(t *trace.Coordination, c *context.Context, c1 trace.Call, path string) func(error) {
	var p trace.CoordinationAlterNodeStartInfo
	p.Context = c
	p.Call = c1
	p.Path = path
	res := onAlterNode(t, p)
	return func(e error) {
		var p trace.CoordinationAlterNodeDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnDropNode(t *trace.Coordination, c *context.Context, c1 trace.Call, path string) func(error) {
	var p trace.CoordinationDropNodeStartInfo
	p.Context = c
	p.Call = c1
	p.Path = path
	res := onDropNode(t, p)
	return func(e error) {
		var p trace.CoordinationDropNodeDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnDescribeNode(t *trace.Coordination, c *context.Context, c1 trace.Call, path string) func(error) {
	var p trace.CoordinationDescribeNodeStartInfo
	p.Context = c
	p.Call = c1
	p.Path = path
	res := onDescribeNode(t, p)
	return func(e error) {
		var p trace.CoordinationDescribeNodeDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSession(t *trace.Coordination, c *context.Context, c1 trace.Call, path string) func(error) {
	var p trace.CoordinationSessionStartInfo
	p.Context = c
	p.Call = c1
	p.Path = path
	res := onSession(t, p)
	return func(e error) {
		var p trace.CoordinationSessionDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnClose(t *trace.Coordination, c *context.Context, c1 trace.Call) func(error) {
	var p trace.CoordinationCloseStartInfo
	p.Context = c
	p.Call = c1
	res := onClose(t, p)
	return func(e error) {
		var p trace.CoordinationCloseDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionNewStream(t *trace.Coordination, c *context.Context, c1 trace.Call) func(error) {
	var p trace.CoordinationSessionNewStreamStartInfo
	p.Context = c
	p.Call = c1
	res := onSessionNewStream(t, p)
	return func(e error) {
		var p trace.CoordinationSessionNewStreamDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionStarted(t *trace.Coordination, sessionID uint64, expectedSessionID uint64) {
	var p trace.CoordinationSessionStartedInfo
	p.SessionID = sessionID
	p.ExpectedSessionID = expectedSessionID
	onSessionStarted(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionStartTimeout(t *trace.Coordination, timeout time.Duration) {
	var p trace.CoordinationSessionStartTimeoutInfo
	p.Timeout = timeout
	onSessionStartTimeout(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionKeepAliveTimeout(t *trace.Coordination, lastGoodResponseTime time.Time, timeout time.Duration) {
	var p trace.CoordinationSessionKeepAliveTimeoutInfo
	p.LastGoodResponseTime = lastGoodResponseTime
	p.Timeout = timeout
	onSessionKeepAliveTimeout(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionStopped(t *trace.Coordination, sessionID uint64, expectedSessionID uint64) {
	var p trace.CoordinationSessionStoppedInfo
	p.SessionID = sessionID
	p.ExpectedSessionID = expectedSessionID
	onSessionStopped(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionStopTimeout(t *trace.Coordination, timeout time.Duration) {
	var p trace.CoordinationSessionStopTimeoutInfo
	p.Timeout = timeout
	onSessionStopTimeout(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionClientTimeout(t *trace.Coordination, lastGoodResponseTime time.Time, timeout time.Duration) {
	var p trace.CoordinationSessionClientTimeoutInfo
	p.LastGoodResponseTime = lastGoodResponseTime
	p.Timeout = timeout
	onSessionClientTimeout(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionServerExpire(t *trace.Coordination, failure *Ydb_Coordination.SessionResponse_Failure) {
	var p trace.CoordinationSessionServerExpireInfo
	p.Failure = failure
	onSessionServerExpire(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionServerError(t *trace.Coordination, failure *Ydb_Coordination.SessionResponse_Failure) {
	var p trace.CoordinationSessionServerErrorInfo
	p.Failure = failure
	onSessionServerError(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionReceive(t *trace.Coordination) func(response *Ydb_Coordination.SessionResponse, _ error) {
	var p trace.CoordinationSessionReceiveStartInfo
	res := onSessionReceive(t, p)
	return func(response *Ydb_Coordination.SessionResponse, e error) {
		var p trace.CoordinationSessionReceiveDoneInfo
		p.Response = response
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionReceiveUnexpected(t *trace.Coordination, response *Ydb_Coordination.SessionResponse) {
	var p trace.CoordinationSessionReceiveUnexpectedInfo
	p.Response = response
	onSessionReceiveUnexpected(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionStop(t *trace.Coordination, sessionID uint64) {
	var p trace.CoordinationSessionStopInfo
	p.SessionID = sessionID
	onSessionStop(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionStart(t *trace.Coordination) func(error) {
	var p trace.CoordinationSessionStartStartInfo
	res := onSessionStart(t, p)
	return func(e error) {
		var p trace.CoordinationSessionStartDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionSend(t *trace.Coordination, request *Ydb_Coordination.SessionRequest) func(error) {
	var p trace.CoordinationSessionSendStartInfo
	p.Request = request
	res := onSessionSend(t, p)
	return func(e error) {
		var p trace.CoordinationSessionSendDoneInfo
		p.Error = e
		res(p)
	}
}
