@@ -78,7 +78,11 @@ func NewConnectionManager(cfg ConnectionManagerConfig) *ConnectionManager {
7878 }
7979}
8080
81- func (c * ConnectionManager ) AddHost (address string , port uint , tags ... ConnectionManagerTag ) {
81+ func (c * ConnectionManager ) AddHost (
82+ address string ,
83+ port uint ,
84+ tags ... ConnectionManagerTag ,
85+ ) {
8286 tmpTags := map [ConnectionManagerTag ]bool {}
8387 for _ , tag := range tags {
8488 tmpTags [tag ] = true
@@ -99,12 +103,20 @@ func (c *ConnectionManager) AddHostsFromTopology(topology *TopologyConfig) {
99103 }
100104 for _ , localRoot := range topology .LocalRoots {
101105 for _ , host := range localRoot .AccessPoints {
102- c .AddHost (host .Address , host .Port , ConnectionManagerTagHostLocalRoot )
106+ c .AddHost (
107+ host .Address ,
108+ host .Port ,
109+ ConnectionManagerTagHostLocalRoot ,
110+ )
103111 }
104112 }
105113 for _ , publicRoot := range topology .PublicRoots {
106114 for _ , host := range publicRoot .AccessPoints {
107- c .AddHost (host .Address , host .Port , ConnectionManagerTagHostPublicRoot )
115+ c .AddHost (
116+ host .Address ,
117+ host .Port ,
118+ ConnectionManagerTagHostPublicRoot ,
119+ )
108120 }
109121 }
110122}
@@ -129,13 +141,17 @@ func (c *ConnectionManager) RemoveConnection(connId ConnectionId) {
129141 c .connectionsMutex .Unlock ()
130142}
131143
132- func (c * ConnectionManager ) GetConnectionById (connId ConnectionId ) * ConnectionManagerConnection {
144+ func (c * ConnectionManager ) GetConnectionById (
145+ connId ConnectionId ,
146+ ) * ConnectionManagerConnection {
133147 c .connectionsMutex .Lock ()
134148 defer c .connectionsMutex .Unlock ()
135149 return c .connections [connId ]
136150}
137151
138- func (c * ConnectionManager ) GetConnectionsByTags (tags ... ConnectionManagerTag ) []* ConnectionManagerConnection {
152+ func (c * ConnectionManager ) GetConnectionsByTags (
153+ tags ... ConnectionManagerTag ,
154+ ) []* ConnectionManagerConnection {
139155 var ret []* ConnectionManagerConnection
140156 c .connectionsMutex .Lock ()
141157 for _ , conn := range c .connections {
0 commit comments