Documentation ¶
Index ¶
- type ManagementServiceServerMock
- func (m ManagementServiceServerMock) GetDeviceAuthorizationFlow(ctx context.Context, req *proto.EncryptedMessage) (*proto.EncryptedMessage, error)
- func (m ManagementServiceServerMock) GetServerKey(ctx context.Context, empty *proto.Empty) (*proto.ServerKeyResponse, error)
- func (m ManagementServiceServerMock) IsHealthy(ctx context.Context, empty *proto.Empty) (*proto.Empty, error)
- func (m ManagementServiceServerMock) Login(ctx context.Context, req *proto.EncryptedMessage) (*proto.EncryptedMessage, error)
- func (m ManagementServiceServerMock) Sync(msg *proto.EncryptedMessage, sync proto.ManagementService_SyncServer) error
- type MockAccountManager
- func (am *MockAccountManager) AccountExists(accountId string) (*bool, error)
- func (am *MockAccountManager) AddPeer(setupKey string, userId string, peer *server.Peer) (*server.Peer, error)
- func (am *MockAccountManager) AddSetupKey(accountId string, keyName string, keyType server.SetupKeyType, ...) (*server.SetupKey, error)
- func (am *MockAccountManager) DeleteGroup(accountID, groupID string) error
- func (am *MockAccountManager) DeletePeer(accountId string, peerKey string) (*server.Peer, error)
- func (am *MockAccountManager) DeleteRule(accountID, ruleID string) error
- func (am *MockAccountManager) GetAccountById(accountId string) (*server.Account, error)
- func (am *MockAccountManager) GetAccountByUser(userId string) (*server.Account, error)
- func (am *MockAccountManager) GetAccountByUserOrAccountId(userId, accountId, domain string) (*server.Account, error)
- func (am *MockAccountManager) GetAccountWithAuthorizationClaims(claims jwtclaims.AuthorizationClaims) (*server.Account, error)
- func (am *MockAccountManager) GetGroup(accountID, groupID string) (*server.Group, error)
- func (am *MockAccountManager) GetNetworkMap(peerKey string) (*server.NetworkMap, error)
- func (am *MockAccountManager) GetOrCreateAccountByUser(userId, domain string) (*server.Account, error)
- func (am *MockAccountManager) GetPeer(peerKey string) (*server.Peer, error)
- func (am *MockAccountManager) GetPeerByIP(accountId string, peerIP string) (*server.Peer, error)
- func (am *MockAccountManager) GetPeerNetwork(peerKey string) (*server.Network, error)
- func (am *MockAccountManager) GetRule(accountID, ruleID string) (*server.Rule, error)
- func (am *MockAccountManager) GetUsersFromAccount(accountID string) ([]*server.UserInfo, error)
- func (am *MockAccountManager) GroupAddPeer(accountID, groupID, peerKey string) error
- func (am *MockAccountManager) GroupDeletePeer(accountID, groupID, peerKey string) error
- func (am *MockAccountManager) GroupListPeers(accountID, groupID string) ([]*server.Peer, error)
- func (am *MockAccountManager) IsUserAdmin(claims jwtclaims.AuthorizationClaims) (bool, error)
- func (am *MockAccountManager) ListGroups(accountID string) ([]*server.Group, error)
- func (am *MockAccountManager) ListRules(accountID string) ([]*server.Rule, error)
- func (am *MockAccountManager) MarkPeerConnected(peerKey string, connected bool) error
- func (am *MockAccountManager) RenamePeer(accountId string, peerKey string, newName string) (*server.Peer, error)
- func (am *MockAccountManager) RenameSetupKey(accountId string, keyId string, newName string) (*server.SetupKey, error)
- func (am *MockAccountManager) RevokeSetupKey(accountId string, keyId string) (*server.SetupKey, error)
- func (am *MockAccountManager) SaveGroup(accountID string, group *server.Group) error
- func (am *MockAccountManager) SaveRule(accountID string, rule *server.Rule) error
- func (am *MockAccountManager) UpdateGroup(accountID string, groupID string, operations []server.GroupUpdateOperation) (*server.Group, error)
- func (am *MockAccountManager) UpdatePeer(accountID string, peer *server.Peer) (*server.Peer, error)
- func (am *MockAccountManager) UpdatePeerMeta(peerKey string, meta server.PeerSystemMeta) error
- func (am *MockAccountManager) UpdatePeerSSHKey(peerKey string, sshKey string) error
- func (am *MockAccountManager) UpdateRule(accountID string, ruleID string, operations []server.RuleUpdateOperation) (*server.Rule, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ManagementServiceServerMock ¶
type ManagementServiceServerMock struct { proto.UnimplementedManagementServiceServer LoginFunc func(context.Context, *proto.EncryptedMessage) (*proto.EncryptedMessage, error) SyncFunc func(*proto.EncryptedMessage, proto.ManagementService_SyncServer) GetServerKeyFunc func(context.Context, *proto.Empty) (*proto.ServerKeyResponse, error) IsHealthyFunc func(context.Context, *proto.Empty) (*proto.Empty, error) GetDeviceAuthorizationFlowFunc func(ctx context.Context, req *proto.EncryptedMessage) (*proto.EncryptedMessage, error) }
func (ManagementServiceServerMock) GetDeviceAuthorizationFlow ¶
func (m ManagementServiceServerMock) GetDeviceAuthorizationFlow(ctx context.Context, req *proto.EncryptedMessage) (*proto.EncryptedMessage, error)
func (ManagementServiceServerMock) GetServerKey ¶
func (m ManagementServiceServerMock) GetServerKey(ctx context.Context, empty *proto.Empty) (*proto.ServerKeyResponse, error)
func (ManagementServiceServerMock) Login ¶
func (m ManagementServiceServerMock) Login(ctx context.Context, req *proto.EncryptedMessage) (*proto.EncryptedMessage, error)
func (ManagementServiceServerMock) Sync ¶
func (m ManagementServiceServerMock) Sync(msg *proto.EncryptedMessage, sync proto.ManagementService_SyncServer) error
type MockAccountManager ¶
type MockAccountManager struct { GetOrCreateAccountByUserFunc func(userId, domain string) (*server.Account, error) GetAccountByUserFunc func(userId string) (*server.Account, error) AddSetupKeyFunc func(accountId string, keyName string, keyType server.SetupKeyType, expiresIn time.Duration) (*server.SetupKey, error) RevokeSetupKeyFunc func(accountId string, keyId string) (*server.SetupKey, error) RenameSetupKeyFunc func(accountId string, keyId string, newName string) (*server.SetupKey, error) GetAccountByIdFunc func(accountId string) (*server.Account, error) GetAccountByUserOrAccountIdFunc func(userId, accountId, domain string) (*server.Account, error) GetAccountWithAuthorizationClaimsFunc func(claims jwtclaims.AuthorizationClaims) (*server.Account, error) IsUserAdminFunc func(claims jwtclaims.AuthorizationClaims) (bool, error) AccountExistsFunc func(accountId string) (*bool, error) GetPeerFunc func(peerKey string) (*server.Peer, error) MarkPeerConnectedFunc func(peerKey string, connected bool) error RenamePeerFunc func(accountId string, peerKey string, newName string) (*server.Peer, error) DeletePeerFunc func(accountId string, peerKey string) (*server.Peer, error) GetPeerByIPFunc func(accountId string, peerIP string) (*server.Peer, error) GetNetworkMapFunc func(peerKey string) (*server.NetworkMap, error) GetPeerNetworkFunc func(peerKey string) (*server.Network, error) AddPeerFunc func(setupKey string, userId string, peer *server.Peer) (*server.Peer, error) GetGroupFunc func(accountID, groupID string) (*server.Group, error) SaveGroupFunc func(accountID string, group *server.Group) error UpdateGroupFunc func(accountID string, groupID string, operations []server.GroupUpdateOperation) (*server.Group, error) DeleteGroupFunc func(accountID, groupID string) error ListGroupsFunc func(accountID string) ([]*server.Group, error) GroupAddPeerFunc func(accountID, groupID, peerKey string) error GroupDeletePeerFunc func(accountID, groupID, peerKey string) error GroupListPeersFunc func(accountID, groupID string) ([]*server.Peer, error) GetRuleFunc func(accountID, ruleID string) (*server.Rule, error) SaveRuleFunc func(accountID string, rule *server.Rule) error UpdateRuleFunc func(accountID string, ruleID string, operations []server.RuleUpdateOperation) (*server.Rule, error) DeleteRuleFunc func(accountID, ruleID string) error ListRulesFunc func(accountID string) ([]*server.Rule, error) GetUsersFromAccountFunc func(accountID string) ([]*server.UserInfo, error) UpdatePeerMetaFunc func(peerKey string, meta server.PeerSystemMeta) error UpdatePeerSSHKeyFunc func(peerKey string, sshKey string) error UpdatePeerFunc func(accountID string, peer *server.Peer) (*server.Peer, error) }
func (*MockAccountManager) AccountExists ¶
func (am *MockAccountManager) AccountExists(accountId string) (*bool, error)
AccountExists mock implementation of AccountExists from server.AccountManager interface
func (*MockAccountManager) AddPeer ¶
func (am *MockAccountManager) AddPeer( setupKey string, userId string, peer *server.Peer, ) (*server.Peer, error)
AddPeer mock implementation of AddPeer from server.AccountManager interface
func (*MockAccountManager) AddSetupKey ¶
func (am *MockAccountManager) AddSetupKey( accountId string, keyName string, keyType server.SetupKeyType, expiresIn time.Duration, ) (*server.SetupKey, error)
AddSetupKey mock implementation of AddSetupKey from server.AccountManager interface
func (*MockAccountManager) DeleteGroup ¶
func (am *MockAccountManager) DeleteGroup(accountID, groupID string) error
DeleteGroup mock implementation of DeleteGroup from server.AccountManager interface
func (*MockAccountManager) DeletePeer ¶
DeletePeer mock implementation of DeletePeer from server.AccountManager interface
func (*MockAccountManager) DeleteRule ¶
func (am *MockAccountManager) DeleteRule(accountID, ruleID string) error
DeleteRule mock implementation of DeleteRule from server.AccountManager interface
func (*MockAccountManager) GetAccountById ¶
func (am *MockAccountManager) GetAccountById(accountId string) (*server.Account, error)
GetAccountById mock implementation of GetAccountById from server.AccountManager interface
func (*MockAccountManager) GetAccountByUser ¶
func (am *MockAccountManager) GetAccountByUser(userId string) (*server.Account, error)
GetAccountByUser mock implementation of GetAccountByUser from server.AccountManager interface
func (*MockAccountManager) GetAccountByUserOrAccountId ¶
func (am *MockAccountManager) GetAccountByUserOrAccountId( userId, accountId, domain string, ) (*server.Account, error)
GetAccountByUserOrAccountId mock implementation of GetAccountByUserOrAccountId from server.AccountManager interface
func (*MockAccountManager) GetAccountWithAuthorizationClaims ¶
func (am *MockAccountManager) GetAccountWithAuthorizationClaims( claims jwtclaims.AuthorizationClaims, ) (*server.Account, error)
GetAccountWithAuthorizationClaims mock implementation of GetAccountWithAuthorizationClaims from server.AccountManager interface
func (*MockAccountManager) GetGroup ¶
func (am *MockAccountManager) GetGroup(accountID, groupID string) (*server.Group, error)
GetGroup mock implementation of GetGroup from server.AccountManager interface
func (*MockAccountManager) GetNetworkMap ¶
func (am *MockAccountManager) GetNetworkMap(peerKey string) (*server.NetworkMap, error)
GetNetworkMap mock implementation of GetNetworkMap from server.AccountManager interface
func (*MockAccountManager) GetOrCreateAccountByUser ¶
func (am *MockAccountManager) GetOrCreateAccountByUser( userId, domain string, ) (*server.Account, error)
GetOrCreateAccountByUser mock implementation of GetOrCreateAccountByUser from server.AccountManager interface
func (*MockAccountManager) GetPeer ¶
func (am *MockAccountManager) GetPeer(peerKey string) (*server.Peer, error)
GetPeer mock implementation of GetPeer from server.AccountManager interface
func (*MockAccountManager) GetPeerByIP ¶
GetPeerByIP mock implementation of GetPeerByIP from server.AccountManager interface
func (*MockAccountManager) GetPeerNetwork ¶
func (am *MockAccountManager) GetPeerNetwork(peerKey string) (*server.Network, error)
GetPeerNetwork mock implementation of GetPeerNetwork from server.AccountManager interface
func (*MockAccountManager) GetRule ¶
func (am *MockAccountManager) GetRule(accountID, ruleID string) (*server.Rule, error)
GetRule mock implementation of GetRule from server.AccountManager interface
func (*MockAccountManager) GetUsersFromAccount ¶
func (am *MockAccountManager) GetUsersFromAccount(accountID string) ([]*server.UserInfo, error)
GetUsersFromAccount mock implementation of GetUsersFromAccount from server.AccountManager interface
func (*MockAccountManager) GroupAddPeer ¶
func (am *MockAccountManager) GroupAddPeer(accountID, groupID, peerKey string) error
GroupAddPeer mock implementation of GroupAddPeer from server.AccountManager interface
func (*MockAccountManager) GroupDeletePeer ¶
func (am *MockAccountManager) GroupDeletePeer(accountID, groupID, peerKey string) error
GroupDeletePeer mock implementation of GroupDeletePeer from server.AccountManager interface
func (*MockAccountManager) GroupListPeers ¶
func (am *MockAccountManager) GroupListPeers(accountID, groupID string) ([]*server.Peer, error)
GroupListPeers mock implementation of GroupListPeers from server.AccountManager interface
func (*MockAccountManager) IsUserAdmin ¶
func (am *MockAccountManager) IsUserAdmin(claims jwtclaims.AuthorizationClaims) (bool, error)
IsUserAdmin mock implementation of IsUserAdmin from server.AccountManager interface
func (*MockAccountManager) ListGroups ¶
func (am *MockAccountManager) ListGroups(accountID string) ([]*server.Group, error)
ListGroups mock implementation of ListGroups from server.AccountManager interface
func (*MockAccountManager) ListRules ¶
func (am *MockAccountManager) ListRules(accountID string) ([]*server.Rule, error)
ListRules mock implementation of ListRules from server.AccountManager interface
func (*MockAccountManager) MarkPeerConnected ¶
func (am *MockAccountManager) MarkPeerConnected(peerKey string, connected bool) error
MarkPeerConnected mock implementation of MarkPeerConnected from server.AccountManager interface
func (*MockAccountManager) RenamePeer ¶
func (am *MockAccountManager) RenamePeer( accountId string, peerKey string, newName string, ) (*server.Peer, error)
RenamePeer mock implementation of RenamePeer from server.AccountManager interface
func (*MockAccountManager) RenameSetupKey ¶
func (am *MockAccountManager) RenameSetupKey( accountId string, keyId string, newName string, ) (*server.SetupKey, error)
RenameSetupKey mock implementation of RenameSetupKey from server.AccountManager interface
func (*MockAccountManager) RevokeSetupKey ¶
func (am *MockAccountManager) RevokeSetupKey( accountId string, keyId string, ) (*server.SetupKey, error)
RevokeSetupKey mock implementation of RevokeSetupKey from server.AccountManager interface
func (*MockAccountManager) SaveGroup ¶
func (am *MockAccountManager) SaveGroup(accountID string, group *server.Group) error
SaveGroup mock implementation of SaveGroup from server.AccountManager interface
func (*MockAccountManager) SaveRule ¶
func (am *MockAccountManager) SaveRule(accountID string, rule *server.Rule) error
SaveRule mock implementation of SaveRule from server.AccountManager interface
func (*MockAccountManager) UpdateGroup ¶
func (am *MockAccountManager) UpdateGroup(accountID string, groupID string, operations []server.GroupUpdateOperation) (*server.Group, error)
UpdateGroup mock implementation of UpdateGroup from server.AccountManager interface
func (*MockAccountManager) UpdatePeer ¶
UpdatePeer mocks UpdatePeerFunc function of the account manager
func (*MockAccountManager) UpdatePeerMeta ¶
func (am *MockAccountManager) UpdatePeerMeta(peerKey string, meta server.PeerSystemMeta) error
UpdatePeerMeta mock implementation of UpdatePeerMeta from server.AccountManager interface
func (*MockAccountManager) UpdatePeerSSHKey ¶
func (am *MockAccountManager) UpdatePeerSSHKey(peerKey string, sshKey string) error
UpdatePeerSSHKey mocks UpdatePeerSSHKey function of the account manager
func (*MockAccountManager) UpdateRule ¶
func (am *MockAccountManager) UpdateRule(accountID string, ruleID string, operations []server.RuleUpdateOperation) (*server.Rule, error)
UpdateRule mock implementation of UpdateRule from server.AccountManager interface