mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-27 02:24:30 +01:00
6ae27c9a9b
* feature: add User entity to Account * test: new file store creation test * test: add FileStore persist-restore tests * test: add GetOrCreateAccountByUser Accountmanager test * refactor: rename account manager users file * refactor: use userId instead of accountId when handling Management HTTP API * fix: new account creation for every request * fix: golint * chore: add account creator to Account Entity to identify who created the account. * chore: use xid ID generator for account IDs * fix: test failures * test: check that CreatedBy is stored when account is stored * chore: add account copy method * test: remove test for non existent GetOrCreateAccount func * chore: add accounts conversion function * fix: golint * refactor: simplify admin user creation * refactor: move migration script to a separate package
14 lines
481 B
Go
14 lines
481 B
Go
package server
|
|
|
|
type Store interface {
|
|
GetPeer(peerKey string) (*Peer, error)
|
|
DeletePeer(accountId string, peerKey string) (*Peer, error)
|
|
SavePeer(accountId string, peer *Peer) error
|
|
GetAccount(accountId string) (*Account, error)
|
|
GetUserAccount(userId string) (*Account, error)
|
|
GetAccountPeers(accountId string) ([]*Peer, error)
|
|
GetPeerAccount(peerKey string) (*Account, error)
|
|
GetAccountBySetupKey(setupKey string) (*Account, error)
|
|
SaveAccount(account *Account) error
|
|
}
|