From 6185dcb7745ffdb80ac236e09f278b4fadb6b5c1 Mon Sep 17 00:00:00 2001 From: pg9182 <96569817+pg9182@users.noreply.github.com> Date: Sat, 22 Oct 2022 16:55:43 -0400 Subject: pkg/api/api0: Add support for additional serverlist config options --- pkg/api/api0/serverlist.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pkg/api') 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)), } -- cgit v1.2.3