@@ -3,23 +3,20 @@ package topicoptions
33import (
44 "time"
55
6- "github.com/ydb-platform/ydb-go-sdk/v3/internal/config"
76 "github.com/ydb-platform/ydb-go-sdk/v3/internal/topic"
87 "github.com/ydb-platform/ydb-go-sdk/v3/trace"
98)
109
1110// TopicOption
1211//
1312// Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
14- type TopicOption func (c * topic.Config )
13+ type TopicOption = topic. Option // func(c *topic.Config)
1514
1615// WithTrace defines trace over persqueue client calls
1716//
1817// Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
1918func WithTrace (trace trace.Topic , opts ... trace.TopicComposeOption ) TopicOption { //nolint:gocritic
20- return func (c * topic.Config ) {
21- c .Trace = c .Trace .Compose (& trace , opts ... )
22- }
19+ return topic .PublicWithTrace (trace , opts ... )
2320}
2421
2522// WithOperationTimeout set the maximum amount of time a YDB server will process
@@ -30,9 +27,7 @@ func WithTrace(trace trace.Topic, opts ...trace.TopicComposeOption) TopicOption
3027//
3128// Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
3229func WithOperationTimeout (operationTimeout time.Duration ) TopicOption {
33- return func (c * topic.Config ) {
34- config .SetOperationTimeout (& c .Common , operationTimeout )
35- }
30+ return topic .PublicWithOperationTimeout (operationTimeout )
3631}
3732
3833// WithOperationCancelAfter set the maximum amount of time a YDB server will process an
@@ -43,7 +38,5 @@ func WithOperationTimeout(operationTimeout time.Duration) TopicOption {
4338//
4439// Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
4540func WithOperationCancelAfter (operationCancelAfter time.Duration ) TopicOption {
46- return func (c * topic.Config ) {
47- config .SetOperationCancelAfter (& c .Common , operationCancelAfter )
48- }
41+ return topic .PublicWithOperationCancelAfter (operationCancelAfter )
4942}
0 commit comments