From 1f6fc919860c5557906f218c59ac86b2ecfabdbd Mon Sep 17 00:00:00 2001 From: Martin Sucha Date: Mon, 29 Jan 2024 12:45:31 +0100 Subject: [PATCH] Add Session.AllHosts We need to be able to iterate HostInfos from a client. --- session.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/session.go b/session.go index 3422a2c2c..0d1e9af24 100644 --- a/session.go +++ b/session.go @@ -407,6 +407,11 @@ func (s *Session) reconnectDownedHosts(intv time.Duration) { } } +// AllHosts returns all hosts currently in the token ring. +func (s *Session) AllHosts() []*HostInfo { + return s.ring.allHosts() +} + // SetConsistency sets the default consistency level for this session. This // setting can also be changed on a per-query basis and the default value // is Quorum.