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) AddAccount(accountId, userId, domain string) (*server.Account, 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) 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) UpdatePeerMeta(peerKey string, meta server.PeerSystemMeta) 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 *util.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) AddAccountFunc func(accountId, userId, domain string) (*server.Account, 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) 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 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 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 }
func (*MockAccountManager) AccountExists ¶
func (am *MockAccountManager) AccountExists(accountId string) (*bool, error)
func (*MockAccountManager) AddAccount ¶
func (am *MockAccountManager) AddAccount( accountId, userId, domain string, ) (*server.Account, error)
func (*MockAccountManager) AddSetupKey ¶
func (am *MockAccountManager) AddSetupKey( accountId string, keyName string, keyType server.SetupKeyType, expiresIn *util.Duration, ) (*server.SetupKey, error)
func (*MockAccountManager) DeleteGroup ¶
func (am *MockAccountManager) DeleteGroup(accountID, groupID string) error
func (*MockAccountManager) DeletePeer ¶
func (*MockAccountManager) DeleteRule ¶
func (am *MockAccountManager) DeleteRule(accountID, ruleID string) error
func (*MockAccountManager) GetAccountById ¶
func (am *MockAccountManager) GetAccountById(accountId string) (*server.Account, error)
func (*MockAccountManager) GetAccountByUser ¶
func (am *MockAccountManager) GetAccountByUser(userId string) (*server.Account, error)
func (*MockAccountManager) GetAccountByUserOrAccountId ¶
func (am *MockAccountManager) GetAccountByUserOrAccountId( userId, accountId, domain string, ) (*server.Account, error)
func (*MockAccountManager) GetAccountWithAuthorizationClaims ¶
func (am *MockAccountManager) GetAccountWithAuthorizationClaims( claims jwtclaims.AuthorizationClaims, ) (*server.Account, error)
func (*MockAccountManager) GetGroup ¶
func (am *MockAccountManager) GetGroup(accountID, groupID string) (*server.Group, error)
func (*MockAccountManager) GetNetworkMap ¶
func (am *MockAccountManager) GetNetworkMap(peerKey string) (*server.NetworkMap, error)
func (*MockAccountManager) GetOrCreateAccountByUser ¶
func (am *MockAccountManager) GetOrCreateAccountByUser( userId, domain string, ) (*server.Account, error)
func (*MockAccountManager) GetPeer ¶
func (am *MockAccountManager) GetPeer(peerKey string) (*server.Peer, error)
func (*MockAccountManager) GetPeerByIP ¶
func (*MockAccountManager) GetRule ¶
func (am *MockAccountManager) GetRule(accountID, ruleID string) (*server.Rule, error)
func (*MockAccountManager) GetUsersFromAccount ¶
func (am *MockAccountManager) GetUsersFromAccount(accountID string) ([]*server.UserInfo, error)
func (*MockAccountManager) GroupAddPeer ¶
func (am *MockAccountManager) GroupAddPeer(accountID, groupID, peerKey string) error
func (*MockAccountManager) GroupDeletePeer ¶
func (am *MockAccountManager) GroupDeletePeer(accountID, groupID, peerKey string) error
func (*MockAccountManager) GroupListPeers ¶
func (am *MockAccountManager) GroupListPeers(accountID, groupID string) ([]*server.Peer, error)
func (*MockAccountManager) IsUserAdmin ¶ added in v0.6.0
func (am *MockAccountManager) IsUserAdmin(claims jwtclaims.AuthorizationClaims) (bool, error)
func (*MockAccountManager) ListGroups ¶
func (am *MockAccountManager) ListGroups(accountID string) ([]*server.Group, error)
func (*MockAccountManager) ListRules ¶
func (am *MockAccountManager) ListRules(accountID string) ([]*server.Rule, error)
func (*MockAccountManager) MarkPeerConnected ¶
func (am *MockAccountManager) MarkPeerConnected(peerKey string, connected bool) error
func (*MockAccountManager) RenamePeer ¶
func (*MockAccountManager) RenameSetupKey ¶
func (*MockAccountManager) RevokeSetupKey ¶
func (*MockAccountManager) SaveGroup ¶
func (am *MockAccountManager) SaveGroup(accountID string, group *server.Group) error
func (*MockAccountManager) SaveRule ¶
func (am *MockAccountManager) SaveRule(accountID string, rule *server.Rule) error
func (*MockAccountManager) UpdatePeerMeta ¶
func (am *MockAccountManager) UpdatePeerMeta(peerKey string, meta server.PeerSystemMeta) error
Click to show internal directories.
Click to hide internal directories.