From 025c29bcd279b5448908df7c3a1a997a64095641 Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Mon, 1 Apr 2024 17:20:15 +0300 Subject: [PATCH] client: imp code --- internal/client/client.go | 8 ++++---- internal/client/runtimeindex.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/client/client.go b/internal/client/client.go index 3f987a5a..d3ead923 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -146,8 +146,8 @@ func (r *Runtime) SetWHOIS(info *whois.Info) { r.whois = info } -// Unset clears a cs information. -func (r *Runtime) Unset(cs Source) { +// unset clears a cs information. +func (r *Runtime) unset(cs Source) { switch cs { case SourceWHOIS: r.whois = nil @@ -162,8 +162,8 @@ func (r *Runtime) Unset(cs Source) { } } -// IsEmpty returns true if there is no information from any source. -func (r *Runtime) IsEmpty() (ok bool) { +// isEmpty returns true if there is no information from any source. +func (r *Runtime) isEmpty() (ok bool) { return r.whois == nil && r.arp == nil && r.rdns == nil && diff --git a/internal/client/runtimeindex.go b/internal/client/runtimeindex.go index 606cd94f..300fdca0 100644 --- a/internal/client/runtimeindex.go +++ b/internal/client/runtimeindex.go @@ -51,9 +51,9 @@ func (ri *RuntimeIndex) Delete(ip netip.Addr) { // the specified source and returns the number of removed clients. func (ri *RuntimeIndex) DeleteBySource(src Source) (n int) { for ip, rc := range ri.index { - rc.Unset(src) + rc.unset(src) - if rc.IsEmpty() { + if rc.isEmpty() { delete(ri.index, ip) n++ }