aboutsummaryrefslogtreecommitdiff
path: root/pkg/api/api0
diff options
context:
space:
mode:
authorpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-15 07:49:59 -0400
committerpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-15 07:49:59 -0400
commitb9eb96c060c1278abfddb06885edc2e93c50ed53 (patch)
treea72e3960516d70309e145d9b31fed1068f38159e /pkg/api/api0
parentaf3091087e412460d84ae456e2ec9faaa1111398 (diff)
downloadAtlas-b9eb96c060c1278abfddb06885edc2e93c50ed53.tar.gz
Atlas-b9eb96c060c1278abfddb06885edc2e93c50ed53.zip
pkg/api/api0: Remove unused ServerList.GetServerCountByIP()
Diffstat (limited to 'pkg/api/api0')
-rw-r--r--pkg/api/api0/serverlist.go19
1 files changed, 0 insertions, 19 deletions
diff --git a/pkg/api/api0/serverlist.go b/pkg/api/api0/serverlist.go
index ba51223..d0cf66b 100644
--- a/pkg/api/api0/serverlist.go
+++ b/pkg/api/api0/serverlist.go
@@ -404,25 +404,6 @@ func (s *ServerList) DeleteServerByID(id string) bool {
return live
}
-// GetServerCountByIP gets the number of live servers for the given IP address.
-// If ip is the zero netip.Addr, the total number of live servers are returned.
-func (s *ServerList) GetServerCountByIP(ip netip.Addr) int {
- // take a read lock on the server list
- s.mu.RLock()
- defer s.mu.RUnlock()
-
- // count the servers
- var n int
- if s.servers1 != nil {
- for _, srv := range s.servers1 {
- if !ip.IsValid() || srv.Addr.Addr() != ip {
- n++
- }
- }
- }
- return n
-}
-
var (
ErrServerListDuplicateAuthAddr = errors.New("already have server with auth addr")
ErrServerListUpdateServerDead = errors.New("no server found")