mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-06 21:49:08 +02:00
[client] Extract peer status recorder into its own package
Move the Status recorder and its state types out of the peer package into client/internal/peer/status, split by struct across recorder.go, peer_state.go, full_status.go, events.go, notifier.go and route.go instead of one 1600-line file. Rename the type Status -> Recorder (NewRecorder already implied it; avoids status.Status stutter). Split conn_status.go: the ConnStatus type and its constants move to the status package, connStatusInputs stays with the peer event loop. The peer package references the status package directly; a transitional status_alias.go re-exports the moved symbols for the ~50 external callers still using peer.Status/State/ConnStatus, to be removed once they are migrated.
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/netbirdio/netbird/client/iface"
|
||||
"github.com/netbirdio/netbird/client/internal/peer/guard"
|
||||
"github.com/netbirdio/netbird/client/internal/peer/ice"
|
||||
"github.com/netbirdio/netbird/client/internal/peer/status"
|
||||
"github.com/netbirdio/netbird/client/internal/stdnet"
|
||||
"github.com/netbirdio/netbird/util"
|
||||
)
|
||||
@@ -69,7 +70,7 @@ func TestConn_GetKey(t *testing.T) {
|
||||
func TestConn_DiscardMessagesWhenNotOpened(t *testing.T) {
|
||||
swWatcher := guard.NewSRWatcher(nil, nil, nil, connConf.ICEConfig)
|
||||
sd := ServiceDependencies{
|
||||
StatusRecorder: NewRecorder("https://mgm"),
|
||||
StatusRecorder: status.NewRecorder("https://mgm"),
|
||||
SrWatcher: swWatcher,
|
||||
}
|
||||
conn, err := NewConn(connConf, sd)
|
||||
|
||||
Reference in New Issue
Block a user