Introduce an unexported newBrokerChannelFromConfig

A follow-up wants to pass in a new property from the ClientConfig but it
would be an API breaking change to NewBrokerChannel.

However, it's unclear why NewBrokerChannel is exported at all.  No other
package in the repo depends on it and the known users of the library
probably wouldn't be construct them.

While this patch was being reviewed, a new constructor was added,
NewBrokerChannelWithUTLSSettings, with effectively the same issue.
Both of those exported ones are deleted here.
This commit is contained in:
Arlo Breault 2022-03-10 14:13:35 -05:00
parent 829cacac5f
commit bd636a1374
2 changed files with 17 additions and 25 deletions

View file

@ -131,9 +131,7 @@ func NewSnowflakeClient(config ClientConfig) (*Transport, error) {
}
// Rendezvous with broker using the given parameters.
broker, err := NewBrokerChannelWithUTLSSettings(
config.BrokerURL, config.AmpCacheURL, config.FrontDomain,
config.KeepLocalAddresses, config.UTLSClientID, config.UTLSRemoveSNI)
broker, err := newBrokerChannelFromConfig(config)
if err != nil {
return nil, err
}