worryg0d commented on PR #1793:
URL: 
https://github.com/apache/cassandra-gocql-driver/pull/1793#issuecomment-2615197832

   Hello @jameshartig, thanks a lot for your feedback.
   
   > If you already had a host id there's no way for a user to construct a 
*HostInfo.
   
   You have a point, I really forgot that we can't easily create `HostInfo` obj 
outside the driver. Then I see two ways how to solve it:
   1. Add `NewHostInfo(hostId string)` constructor. It is the easiest solution 
and `hostId` is enough to get conn pool from `queryExecutor.pool`.
   2. Introduce a new type `Host` which will mostly duplicate `HostInfo` with 
public fields. We can't make the fields of `HostInfo` public because they're 
protected by the mutex. With a new type users will able to easily construct 
`Host` and users may easily get access to the host metadata with 
`session.GetHosts() ([]Host, err)`.
   
   Honestly, I'd prefer the first one because with the second we'll have two 
`Host` and `HostInfo` types that both hold the same fields, but the one is used 
for internal and can't be created outside gocql and another that is mostly the 
same but is not used internally...


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to