aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-22 16:55:43 -0400
committerpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-22 16:55:43 -0400
commit6185dcb7745ffdb80ac236e09f278b4fadb6b5c1 (patch)
tree10545ac98561ae88b132064261da3c569e88da22
parent83bf5336da7a80cd832b7d9b30d5e010e0db6dfd (diff)
downloadAtlas-6185dcb7745ffdb80ac236e09f278b4fadb6b5c1.tar.gz
Atlas-6185dcb7745ffdb80ac236e09f278b4fadb6b5c1.zip
pkg/api/api0: Add support for additional serverlist config options
-rw-r--r--pkg/api/api0/serverlist.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/api/api0/serverlist.go b/pkg/api/api0/serverlist.go
index e48de17..7ae8f89 100644
--- a/pkg/api/api0/serverlist.go
+++ b/pkg/api/api0/serverlist.go
@@ -25,6 +25,7 @@ type ServerList struct {
verifyTime time.Duration
deadTime time.Duration
ghostTime time.Duration
+ cfg ServerListConfig
// servers
mu sync.RWMutex // must be held while modifying the order and maps below
@@ -50,6 +51,9 @@ type ServerList struct {
__clock func() time.Time
}
+type ServerListConfig struct {
+}
+
type Server struct {
Order uint64
ID string // unique, must not be modified after creation
@@ -133,7 +137,7 @@ type ServerListLimit struct {
//
// If both are nonzero, they must be positive, and deadTime must be less than
// ghostTime. Otherwise, NewServerList will panic.
-func NewServerList(deadTime, ghostTime, verifyTime time.Duration) *ServerList {
+func NewServerList(deadTime, ghostTime, verifyTime time.Duration, cfg ServerListConfig) *ServerList {
if verifyTime < 0 {
panic("api0: serverlist: verifyTime must be >= 0")
}
@@ -153,6 +157,7 @@ func NewServerList(deadTime, ghostTime, verifyTime time.Duration) *ServerList {
verifyTime: verifyTime,
deadTime: deadTime,
ghostTime: ghostTime,
+ cfg: cfg,
csUpdateCv: sync.NewCond(new(sync.Mutex)),
csgzUpdateCv: sync.NewCond(new(sync.Mutex)),
}