mirror of
https://github.com/netbirdio/netbird.git
synced 2025-02-02 19:39:17 +01:00
18 lines
759 B
Go
18 lines
759 B
Go
package server
|
|
|
|
type Store interface {
|
|
GetAllAccounts() []*Account
|
|
GetAccount(accountID string) (*Account, error)
|
|
GetAccountByUser(userID string) (*Account, error)
|
|
GetAccountByPeerPubKey(peerKey string) (*Account, error)
|
|
GetAccountBySetupKey(setupKey string) (*Account, error) //todo use key hash later
|
|
GetAccountByPrivateDomain(domain string) (*Account, error)
|
|
SaveAccount(account *Account) error
|
|
GetInstallationID() string
|
|
SaveInstallationID(id string) error
|
|
// AcquireAccountLock should attempt to acquire account lock and return a function that releases the lock
|
|
AcquireAccountLock(accountID string) func()
|
|
// AcquireGlobalLock should attempt to acquire a global lock and return a function that releases the lock
|
|
AcquireGlobalLock() func()
|
|
}
|