2021-07-30 17:46:38 +02:00
|
|
|
package server
|
|
|
|
|
2022-08-18 18:22:15 +02:00
|
|
|
import (
|
|
|
|
"github.com/netbirdio/netbird/route"
|
|
|
|
"net/netip"
|
|
|
|
)
|
|
|
|
|
2021-07-30 17:46:38 +02:00
|
|
|
type Store interface {
|
2021-08-23 21:43:05 +02:00
|
|
|
GetPeer(peerKey string) (*Peer, error)
|
|
|
|
DeletePeer(accountId string, peerKey string) (*Peer, error)
|
|
|
|
SavePeer(accountId string, peer *Peer) error
|
2022-05-21 15:21:39 +02:00
|
|
|
GetAllAccounts() []*Account
|
2021-07-30 17:46:38 +02:00
|
|
|
GetAccount(accountId string) (*Account, error)
|
2021-12-27 13:17:15 +01:00
|
|
|
GetUserAccount(userId string) (*Account, error)
|
2021-09-07 18:36:46 +02:00
|
|
|
GetAccountPeers(accountId string) ([]*Peer, error)
|
2021-08-23 21:43:05 +02:00
|
|
|
GetPeerAccount(peerKey string) (*Account, error)
|
2022-05-21 15:21:39 +02:00
|
|
|
GetPeerSrcRules(accountId, peerKey string) ([]*Rule, error)
|
|
|
|
GetPeerDstRules(accountId, peerKey string) ([]*Rule, error)
|
2021-07-30 17:46:38 +02:00
|
|
|
GetAccountBySetupKey(setupKey string) (*Account, error)
|
2022-03-01 15:22:18 +01:00
|
|
|
GetAccountByPrivateDomain(domain string) (*Account, error)
|
2021-07-30 17:46:38 +02:00
|
|
|
SaveAccount(account *Account) error
|
2022-08-18 18:22:15 +02:00
|
|
|
GetPeerRoutes(peerKey string) ([]*route.Route, error)
|
|
|
|
GetRoutesByPrefix(accountID string, prefix netip.Prefix) ([]*route.Route, error)
|
2022-10-16 13:33:46 +02:00
|
|
|
GetInstallationID() string
|
|
|
|
SaveInstallationID(id string) error
|
2021-07-30 17:46:38 +02:00
|
|
|
}
|