mocks

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mocks is a package that contains the mocks for the microservice

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockCalendarClient added in v0.4.0

type MockCalendarClient struct {
	mock.Mock
}

MockCalendarClient provides a mock implementation of CalendarClient

func (*MockCalendarClient) CreateCalendar added in v0.4.0

CreateCalendar creates a calendar

func (*MockCalendarClient) DeleteUserData added in v0.4.0

DeleteUserData deletes user data

type MockDraftMailRepository

type MockDraftMailRepository struct {
	mock.Mock
}

MockDraftMailRepository provides a mock implementation of DraftMailRepositoryInterface

func (*MockDraftMailRepository) Create

Create creates a new draft mail

func (*MockDraftMailRepository) Delete

Delete soft deletes a draft mail by marking it as trashed

func (*MockDraftMailRepository) GetAll

func (m *MockDraftMailRepository) GetAll(ctx context.Context, userID primitive.ObjectID, page, limit int64) ([]*models.SendMail, int64, error)

GetAll retrieves draft mails for a user. If page and limit are >0, returns paginated results and total count. If page or limit <=0, returns all draft mails and total count.

func (*MockDraftMailRepository) GetByID

GetByID retrieves a draft mail by its ID

func (*MockDraftMailRepository) GetSince added in v0.3.0

func (m *MockDraftMailRepository) GetSince(ctx context.Context, userID primitive.ObjectID, since time.Time, page, limit int64) ([]*models.SendMail, int64, error)

GetSince retrieves draft mails where updated_at is after the specified time for a specific user. If page and limit are >0, returns paginated results and total count. If page or limit <=0, returns all draft mails and total count.

func (*MockDraftMailRepository) Trash

Trash soft deletes a draft mail by marking it as trashed

func (*MockDraftMailRepository) Update

Update updates a draft mail by its ID

type MockFolderRepository

type MockFolderRepository struct {
	mock.Mock
}

MockFolderRepository provides a mock implementation of FolderRepositoryInterface

func (*MockFolderRepository) Create

func (m *MockFolderRepository) Create(ctx context.Context, folder *models.Folder) (*models.Folder, error)

Create creates a new folder

func (*MockFolderRepository) Delete

Delete removes a folder

func (*MockFolderRepository) DeleteByUserID

func (m *MockFolderRepository) DeleteByUserID(ctx context.Context, userID primitive.ObjectID) error

DeleteByUserID deletes all folders for a specific user

func (*MockFolderRepository) GetAll

GetAll retrieves all folders for a user

func (*MockFolderRepository) Update

Update modifies an existing folder

type MockMailRepository

type MockMailRepository struct {
	mock.Mock
}

MockMailRepository provides a mock implementation of MailRepositoryInterface

func (*MockMailRepository) CleanupTrash

func (m *MockMailRepository) CleanupTrash(ctx context.Context, userID *primitive.ObjectID, days *int) error

CleanupTrash cleans up trash mails

func (*MockMailRepository) Create

func (m *MockMailRepository) Create(ctx context.Context, mail *models.Mail) (*models.Mail, error)

Create creates a new mail

func (*MockMailRepository) CreateMany

func (m *MockMailRepository) CreateMany(ctx context.Context, mails []models.Mail) (bool, error)

CreateMany creates multiple mails

func (*MockMailRepository) GetAll

func (m *MockMailRepository) GetAll(ctx context.Context, userID primitive.ObjectID, page, limit int64) ([]*models.Mail, int64, error)

GetAll retrieves mails for a user. If page and limit are >0, returns paginated results and total count. If page or limit <=0, returns all mails and total count.

func (*MockMailRepository) GetByID

GetByID retrieves a mail by its ID

func (*MockMailRepository) GetSince added in v0.3.0

func (m *MockMailRepository) GetSince(ctx context.Context, userID primitive.ObjectID, since time.Time, page, limit int64) ([]*models.Mail, int64, error)

GetSince retrieves mails where updated_at is after the specified time for a specific user. If page and limit are >0, returns paginated results and total count. If page or limit <=0, returns all mails and total count.

func (*MockMailRepository) Update

func (m *MockMailRepository) Update(ctx context.Context, mail *models.Mail) error

Update updates a mail object. This method is used by controller tests to mock mail updates.

type MockSendMailRepository

type MockSendMailRepository struct {
	mock.Mock
}

MockSendMailRepository provides a mock implementation of SendMailRepositoryInterface

func (*MockSendMailRepository) Create

func (m *MockSendMailRepository) Create(ctx context.Context, sendMail *models.SendMail) (*models.SendMail, error)

Create creates a new send mail

func (*MockSendMailRepository) Delete

Delete soft deletes a send mail by marking it as trashed

func (*MockSendMailRepository) GetAll

func (m *MockSendMailRepository) GetAll(ctx context.Context, userID primitive.ObjectID, page, limit int64) ([]*models.SendMail, int64, error)

GetAll retrieves send mails for a user. If page and limit are >0, returns paginated results and total count. If page or limit <=0, returns all send mails and total count.

func (*MockSendMailRepository) GetByID

GetByID retrieves a send mail by its ID

func (*MockSendMailRepository) GetSince added in v0.4.0

func (m *MockSendMailRepository) GetSince(ctx context.Context, userID primitive.ObjectID, sinceTime time.Time, page, limit int64) ([]*models.SendMail, int64, error)

GetSince retrieves send mails where updated_at is after the specified time for a specific user. If page and limit are >0, returns paginated results and total count. If page or limit <=0, returns all send mails and total count.

func (*MockSendMailRepository) Update

Update updates a send mail by its ID

type MockTagRepository

type MockTagRepository struct {
	mock.Mock
}

MockTagRepository provides a mock implementation of TagRepository

func (*MockTagRepository) Create

func (m *MockTagRepository) Create(ctx context.Context, tag *models.Tag) (*models.Tag, error)

Create creates a new tag

func (*MockTagRepository) Delete

Delete deletes a tag by ID

func (*MockTagRepository) DeleteByUserID

func (m *MockTagRepository) DeleteByUserID(ctx context.Context, userID primitive.ObjectID) error

DeleteByUserID deletes all tags for a specific user

func (*MockTagRepository) GetAll

func (m *MockTagRepository) GetAll(ctx context.Context, userID *primitive.ObjectID) ([]*models.Tag, error)

GetAll gets all tags

func (*MockTagRepository) GetByID

GetByID gets a tag by ID

func (*MockTagRepository) Update

func (m *MockTagRepository) Update(ctx context.Context, tag *models.Tag) (*models.Tag, error)

Update updates a tag with the given ID

type MockUserClient

type MockUserClient struct {
	mock.Mock
}

MockUserClient provides a mock implementation of UserClient

func (*MockUserClient) GetUserDevices

GetUserDevices gets the devices for a user

func (*MockUserClient) GetUserPublicKey

GetUserPublicKey gets the public key for a user

Jump to

Keyboard shortcuts

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