trusch commented on a change in pull request #43: [CALCITE-3248] add Connector 
implementation
URL: https://github.com/apache/calcite-avatica-go/pull/43#discussion_r313714862
 
 

 ##########
 File path: driver.go
 ##########
 @@ -47,26 +48,28 @@ import (
 // Driver is exported to allow it to be used directly.
 type Driver struct{}
 
-// Open a Connection to the server.
-// See https://github.com/apache/calcite-avatica-go#dsn for more information
-// on how the DSN is formatted.
-func (a *Driver) Open(dsn string) (driver.Conn, error) {
+// Connector implements the driver.Connector interface
+type Connector struct {
+       Infos  map[string]string
+       Client *http.Client
+
+       dsn string
+}
+
+// NewConnector creates a new connector
+func NewConnector(dsn string) driver.Connector {
+       return &Connector{nil, nil, dsn}
+}
 
-       config, err := ParseDSN(dsn)
+func (c *Connector) Connect(context.Context) (driver.Conn, error) {
+
+       config, err := ParseDSN(c.dsn)
 
        if err != nil {
                return nil, fmt.Errorf("Unable to open connection: %s", err)
        }
 
-       httpClient, err := NewHTTPClient(config.endpoint, httpClientAuthConfig{
-               authenticationType:  config.authentication,
-               username:            config.avaticaUser,
-               password:            config.avaticaPassword,
-               principal:           config.principal,
-               keytab:              config.keytab,
-               krb5Conf:            config.krb5Conf,
-               krb5CredentialCache: config.krb5CredentialCache,
-       })
+       httpClient, err := NewHTTPClient(config.endpoint, c.Client)
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to