Skip to content

Commit 23bcaa8

Browse files
author
Alex Bitkov
committed
implement String() for Driver
1 parent aec710b commit 23bcaa8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

driver.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package ydb
33
import (
44
"context"
55
"errors"
6+
"fmt"
67
"os"
78
"sync"
89

@@ -210,6 +211,16 @@ func (d *Driver) Topic() topic.Client {
210211
return d.topic
211212
}
212213

214+
// String returns string representation of Driver
215+
func (d *Driver) String() string {
216+
return fmt.Sprintf(
217+
"Driver{User: %s, Endpoint: %s, Database: %s, IsSecure }",
218+
d.userInfo.User,
219+
d.config.Endpoint(),
220+
d.config.Database(),
221+
)
222+
}
223+
213224
// Open connects to database by DSN and return driver runtime holder
214225
//
215226
// DSN accept Driver string like

0 commit comments

Comments
 (0)