[GODRIVER-1209] Create LocalAddresser interface and make topology.Connection implement it Created: 29/Jul/19  Updated: 28/Oct/23  Resolved: 08/Aug/19

Status: Closed
Project: Go Driver
Component/s: Core API
Affects Version/s: None
Fix Version/s: 1.1.0

Type: New Feature Priority: Major - P3
Reporter: Matthew Chiaravalloti Assignee: Emmanuel Eppinger (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends

 Description   

The BI Connector uses the local address of a Connection to filter current operations on the server. The new Connection interface does not provide access to the underlying net.Conn's local address. This ticket should add a LocalAddresser interface to the driver package that has a LocalAddress() method. It can return a net.Addr or a string; the BIC only needs the address as a string:

c, err := server.Connection(ctx)
connAddrs = append(connAddrs, c.LocalAddr().String())

so returning a string directly is fine (we would just skip the trailing .String() call).

The old version of the go driver used by BI Connector had a LocalAddr method on the Connection type that returned a net.Addr which was just the underlying net.Conn's LocalAddr() result.



 Comments   
Comment by Githook User [ 08/Aug/19 ]

Author:

{'name': 'Emmanuel Eppinger', 'email': 'manny.eppinger@mongodb.com', 'username': 'eppingere'}

Message: Add LocalAddresser interface

GODRIVER-1209

Change-Id: I4d16f802f401ed4e0609888ac73cb66f393d3431
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/49b74f64604fe781c59882c34db1ae6315f7d819

Comment by Emmanuel Eppinger (Inactive) [ 02/Aug/19 ]

https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/463969

Generated at Thu Feb 08 08:35:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.