MCPcopy Create free account
hub / github.com/datastax/cql-proxy / Add

Method Add

proxycore/mockcluster.go:333–352  ·  view source on GitHub ↗
(host MockHost)

Source from the content-addressed store, hash-verified

331}
332
333func (s *MockServer) Add(host MockHost) {
334 s.mu.Lock()
335 defer s.mu.Unlock()
336 if host.equal(s.local) {
337 return
338 }
339 for _, peer := range s.peers {
340 if host.equal(peer) {
341 return
342 }
343 }
344 s.peers = append(s.peers, host)
345 s.Event(&message.TopologyChangeEvent{
346 ChangeType: primitive.TopologyChangeTypeNewNode,
347 Address: &primitive.Inet{
348 Addr: net.ParseIP(host.IP),
349 Port: int32(host.Port),
350 },
351 })
352}
353
354func (s *MockServer) Remove(host MockHost) {
355 if host.equal(s.local) {

Callers 15

buildNodesMethod · 0.45
StoreMethod · 0.45
listenAndServeMethod · 0.45
generateTestAddrFunction · 0.45
setupProxyTestWithConfigFunction · 0.45
TestRun_HealthChecksFunction · 0.45
TestRun_ProxyTLSFunction · 0.45
TestConnectPoolFunction · 0.45
TestClientConn_InflightFunction · 0.45

Calls 2

EventMethod · 0.95
equalMethod · 0.45

Tested by 11

generateTestAddrFunction · 0.36
setupProxyTestWithConfigFunction · 0.36
TestRun_HealthChecksFunction · 0.36
TestRun_ProxyTLSFunction · 0.36
TestConnectPoolFunction · 0.36
TestClientConn_InflightFunction · 0.36
TestConnectSessionFunction · 0.36