66 "github.com/ydb-platform/ydb-go-genproto/Ydb_Topic_V1"
77 "google.golang.org/grpc"
88
9+ "github.com/ydb-platform/ydb-go-sdk/v3/credentials"
910 "github.com/ydb-platform/ydb-go-sdk/v3/internal/grpcwrapper/rawtopic"
1011 "github.com/ydb-platform/ydb-go-sdk/v3/internal/grpcwrapper/rawtopic/rawtopiccommon"
1112 "github.com/ydb-platform/ydb-go-sdk/v3/internal/grpcwrapper/rawydb"
@@ -18,11 +19,12 @@ import (
1819
1920type Client struct {
2021 cfg topic.Config
22+ cred credentials.Credentials
2123 defaultOperationParams rawydb.OperationParams
2224 rawClient rawtopic.Client
2325}
2426
25- func New (conn grpc.ClientConnInterface , opts ... topicoptions.TopicOption ) * Client {
27+ func New (conn grpc.ClientConnInterface , cred credentials. Credentials , opts ... topicoptions.TopicOption ) * Client {
2628 rawClient := rawtopic .NewClient (Ydb_Topic_V1 .NewTopicServiceClient (conn ))
2729
2830 cfg := newTopicConfig (opts ... )
@@ -32,6 +34,7 @@ func New(conn grpc.ClientConnInterface, opts ...topicoptions.TopicOption) *Clien
3234
3335 return & Client {
3436 cfg : cfg ,
37+ cred : cred ,
3538 defaultOperationParams : defaultOperationParams ,
3639 rawClient : rawClient ,
3740 }
@@ -160,7 +163,10 @@ func (c *Client) StartReader(
160163 return c .rawClient .StreamRead (ctx )
161164 }
162165
163- defaultOpts := []topicoptions.ReaderOption {topicoptions .WithCommonConfig (c .cfg .Common )}
166+ defaultOpts := []topicoptions.ReaderOption {
167+ topicoptions .WithCommonConfig (c .cfg .Common ),
168+ topicreaderinternal .WithCredentials (c .cred ),
169+ }
164170 opts = append (defaultOpts , opts ... )
165171
166172 internalReader := topicreaderinternal .NewReader (connector , consumer , readSelectors , opts ... )
0 commit comments