mocks

package
v0.1.0-rc.12 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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