mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-02 20:49:17 +02:00
* add peers manager * Extend peers manager to support retrieving all peers Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com> * add network map calc * move integrations interface * update management-integrations * merge main and fix * go mod tidy * [management] port forwarding add peer manager fix network map (#3264) * [management] fix testing tools (#3265) * Fix net.IPv4 conversion to []byte * update test to check ipv4 --------- Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com> Co-authored-by: bcmmbaga <bethuelmbaga12@gmail.com> Co-authored-by: Zoltán Papp <zoltan.pmail@gmail.com>
28 lines
766 B
Go
28 lines
766 B
Go
package port_forwarding
|
|
|
|
import (
|
|
"context"
|
|
|
|
nbtypes "github.com/netbirdio/netbird/management/server/types"
|
|
)
|
|
|
|
type Controller interface {
|
|
SendUpdate(ctx context.Context, accountID string, affectedProxyID string, affectedPeerIDs []string)
|
|
GetProxyNetworkMaps(ctx context.Context, accountID string) (map[string]*nbtypes.NetworkMap, error)
|
|
}
|
|
|
|
type ControllerMock struct {
|
|
}
|
|
|
|
func NewControllerMock() *ControllerMock {
|
|
return &ControllerMock{}
|
|
}
|
|
|
|
func (c *ControllerMock) SendUpdate(ctx context.Context, accountID string, affectedProxyID string, affectedPeerIDs []string) {
|
|
// noop
|
|
}
|
|
|
|
func (c *ControllerMock) GetProxyNetworkMaps(ctx context.Context, accountID string) (map[string]*nbtypes.NetworkMap, error) {
|
|
return make(map[string]*nbtypes.NetworkMap), nil
|
|
}
|