github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/driver_string.go (about) 1 package ydb 2 3 import ( 4 "fmt" 5 6 "github.com/ydb-platform/ydb-go-sdk/v3/internal/xstring" 7 ) 8 9 // String returns string representation of Driver 10 func (d *Driver) String() string { 11 buffer := xstring.Buffer() 12 defer buffer.Free() 13 buffer.WriteString("Driver{") 14 fmt.Fprintf(buffer, "Endpoint:%q,", d.config.Endpoint()) 15 fmt.Fprintf(buffer, "Database:%q,", d.config.Database()) 16 fmt.Fprintf(buffer, "Secure:%v", d.config.Secure()) 17 if c, has := d.config.Credentials().(fmt.Stringer); has { 18 fmt.Fprintf(buffer, ",Credentials:%v", c.String()) 19 } 20 buffer.WriteByte('}') 21 22 return buffer.String() 23 }