mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-20 17:26:40 +00:00
Export account manager events store (#1295)
* Expose account manager StoreEvent to integrations * Add account manager StoreEvent mock
This commit is contained in:
@@ -67,6 +67,7 @@ type MockAccountManager struct {
|
||||
CreateUserFunc func(accountID, userID string, key *server.UserInfo) (*server.UserInfo, error)
|
||||
GetAccountFromTokenFunc func(claims jwtclaims.AuthorizationClaims) (*server.Account, *server.User, error)
|
||||
GetDNSDomainFunc func() string
|
||||
StoreEventFunc func(initiatorID, targetID, accountID string, activityID activity.Activity, meta map[string]any)
|
||||
GetEventsFunc func(accountID, userID string) ([]*activity.Event, error)
|
||||
GetDNSSettingsFunc func(accountID, userID string) (*server.DNSSettings, error)
|
||||
SaveDNSSettingsFunc func(accountID, userID string, dnsSettingsToSave *server.DNSSettings) error
|
||||
@@ -592,3 +593,10 @@ func (am *MockAccountManager) GetAllConnectedPeers() (map[string]struct{}, error
|
||||
}
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetAllConnectedPeers is not implemented")
|
||||
}
|
||||
|
||||
// StoreEvent mocks StoreEvent of the AccountManager interface
|
||||
func (am *MockAccountManager) StoreEvent(initiatorID, targetID, accountID string, activityID activity.Activity, meta map[string]any) {
|
||||
if am.StoreEventFunc != nil {
|
||||
am.StoreEventFunc(initiatorID, targetID, accountID, activityID, meta)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user