mock_server

package
v0.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

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 (ManagementServiceServerMock) IsHealthy

func (m ManagementServiceServerMock) IsHealthy(ctx context.Context, empty *proto.Empty) (*proto.Empty, error)

func (ManagementServiceServerMock) Login

func (ManagementServiceServerMock) Sync

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) AddPeer

func (am *MockAccountManager) AddPeer(
	setupKey string,
	userId string,
	peer *server.Peer,
) (*server.Peer, 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 (am *MockAccountManager) DeletePeer(accountId string, peerKey string) (*server.Peer, error)

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 (am *MockAccountManager) GetPeerByIP(accountId string, peerIP string) (*server.Peer, error)

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 (am *MockAccountManager) RenamePeer(
	accountId string,
	peerKey string,
	newName string,
) (*server.Peer, error)

func (*MockAccountManager) RenameSetupKey

func (am *MockAccountManager) RenameSetupKey(
	accountId string,
	keyId string,
	newName string,
) (*server.SetupKey, error)

func (*MockAccountManager) RevokeSetupKey

func (am *MockAccountManager) RevokeSetupKey(
	accountId string,
	keyId string,
) (*server.SetupKey, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL