mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-29 15:59:10 +01:00
Fix account moc
This commit is contained in:
@@ -2,11 +2,12 @@ package mock_server
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/netbirdio/netbird/shared/auth"
|
|
||||||
"net"
|
"net"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/netbirdio/netbird/shared/auth"
|
||||||
|
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
|
||||||
@@ -142,13 +143,13 @@ func (am *MockAccountManager) CreatePeerJob(ctx context.Context, accountID, peer
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (am *MockAccountManager) GetAllPeerJobs(ctx context.Context, accountID, userID, peerID string) ([]*types.Job, error) {
|
func (am *MockAccountManager) GetAllPeerJobs(ctx context.Context, accountID, userID, peerID string) ([]*types.Job, error) {
|
||||||
if am.GetAllPeerJobs != nil {
|
if am.GetAllPeerJobsFunc != nil {
|
||||||
return am.GetAllPeerJobsFunc(ctx, accountID, userID, peerID)
|
return am.GetAllPeerJobsFunc(ctx, accountID, userID, peerID)
|
||||||
}
|
}
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetAllJobs is not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetAllJobs is not implemented")
|
||||||
}
|
}
|
||||||
func (am *MockAccountManager) GetPeerJobByID(ctx context.Context, accountID, userID, peerID, jobID string) (*types.Job, error) {
|
func (am *MockAccountManager) GetPeerJobByID(ctx context.Context, accountID, userID, peerID, jobID string) (*types.Job, error) {
|
||||||
if am.GetPeerJobByID != nil {
|
if am.GetPeerJobByIDFunc != nil {
|
||||||
return am.GetPeerJobByIDFunc(ctx, accountID, userID, peerID, jobID)
|
return am.GetPeerJobByIDFunc(ctx, accountID, userID, peerID, jobID)
|
||||||
}
|
}
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetPeerJobByID is not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetPeerJobByID is not implemented")
|
||||||
|
|||||||
Reference in New Issue
Block a user