File tree Expand file tree Collapse file tree 2 files changed +9
-19
lines changed
examples/topic/topicreader
internal/topic/topiclistenerinternal Expand file tree Collapse file tree 2 files changed +9
-19
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ func (h *TopicEventsHandler) OnStartPartitionSessionRequest(
6363 h .m .Unlock ()
6464
6565 log .Printf ("Started read partition %v/%v" , event .PartitionSession .TopicPath , event .PartitionSession .PartitionID )
66- event .Confirm (
66+ event .ConfirmWithParams (
6767 topiclistener.StartPartitionSessionConfirm {}.
6868 WithReadOffet (offset ).
6969 WithCommitOffset (offset ),
Original file line number Diff line number Diff line change @@ -56,15 +56,12 @@ type PublicStartPartitionSessionEvent struct {
5656// Confirm
5757//
5858// Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
59- func (e * PublicStartPartitionSessionEvent ) Confirm (opts ... PublicStartPartitionSessionConfirm ) {
60- switch len (opts ) {
61- case 0 :
62- e .respChan <- PublicStartPartitionSessionConfirm {}
63- case 1 :
64- e .respChan <- opts [0 ]
65- default :
66- panic ("Confirm accept only zero or one confirm parameters" )
67- }
59+ func (e * PublicStartPartitionSessionEvent ) Confirm () {
60+ e .ConfirmWithParams (PublicStartPartitionSessionConfirm {})
61+ }
62+
63+ func (e * PublicStartPartitionSessionEvent ) ConfirmWithParams (p PublicStartPartitionSessionConfirm ) {
64+ e .respChan <- p
6865}
6966
7067// PublicStartPartitionSessionConfirm
@@ -117,15 +114,8 @@ type PublicStopPartitionSessionEvent struct {
117114// Confirm
118115//
119116// Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
120- func (e * PublicStopPartitionSessionEvent ) Confirm (options ... PublicStopPartitionSessionConfirm ) {
121- switch len (options ) {
122- case 0 :
123- e .resp <- PublicStopPartitionSessionConfirm {}
124- case 1 :
125- e .resp <- options [0 ]
126- default :
127- panic ("Confirm accept only zero or one confirm parameters" )
128- }
117+ func (e * PublicStopPartitionSessionEvent ) Confirm () {
118+ e .resp <- PublicStopPartitionSessionConfirm {}
129119}
130120
131121// PublicStopPartitionSessionConfirm
You can’t perform that action at this time.
0 commit comments