2025-06-10 13:02:08 +02:00
|
|
|
package peers
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
2025-06-11 15:31:09 +02:00
|
|
|
"github.com/netbirdio/management-refactor/internals/controllers/network_map"
|
2025-06-10 13:02:08 +02:00
|
|
|
"github.com/netbirdio/management-refactor/internals/shared/db"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type Manager interface {
|
2025-06-11 15:31:09 +02:00
|
|
|
SetNetworkMapController(networkMapController network_map.Controller)
|
2025-06-10 13:02:08 +02:00
|
|
|
GetPeer(ctx context.Context, tx db.Transaction, strength db.LockingStrength, accountID, peerID string) (*Peer, error)
|
|
|
|
|
GetPeers(ctx context.Context, tx db.Transaction, strength db.LockingStrength, accountID string) ([]*Peer, error)
|
|
|
|
|
GetFilteredPeers(ctx context.Context, tx db.Transaction, strength db.LockingStrength, accountID, nameFilter, ipFilter string) ([]*Peer, error)
|
|
|
|
|
UpdatePeer(ctx context.Context, tx db.Transaction, peer *Peer) error
|
2025-06-11 23:24:35 +02:00
|
|
|
GetAllEphemeralPeers(ctx context.Context, tx db.Transaction, strength db.LockingStrength) ([]*Peer, error)
|
|
|
|
|
DeletePeer(ctx context.Context, tx db.Transaction, accountID, peerID string) error
|
2025-06-10 13:02:08 +02:00
|
|
|
}
|