mocks

package
v0.1.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2025 License: AGPL-3.0 Imports: 8 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

type MockS3Service

type MockS3Service struct {
	mock.Mock
}

MockS3Service provides a mock implementation of S3Service

func (*MockS3Service) BulkDeleteFiles

func (m *MockS3Service) BulkDeleteFiles(ctx context.Context, uploadedKeys []string)

BulkDeleteFiles deletes multiple files from S3

func (*MockS3Service) BulkUploadFiles

func (m *MockS3Service) BulkUploadFiles(ctx context.Context, payloads []*s3.PutObjectInput) ([]string, error)

BulkUploadFiles uploads multiple files given a list of payloads

func (*MockS3Service) DeleteFile

func (m *MockS3Service) DeleteFile(ctx context.Context, s3Path, filename, s3Key *string) error

DeleteFile deletes a file from S3

func (*MockS3Service) FileExists

func (m *MockS3Service) FileExists(ctx context.Context, s3Path, filename string) (bool, error)

FileExists checks if a file exists in S3

func (*MockS3Service) GeneratePreSignedDownloadURL

func (m *MockS3Service) GeneratePreSignedDownloadURL(ctx context.Context, s3Path, filename string, expirationSeconds int64) (string, error)

GeneratePreSignedDownloadURL generates a presigned download URL

func (*MockS3Service) GenerateUploadPayload

func (m *MockS3Service) GenerateUploadPayload(ctx context.Context, data []byte, s3Path, filename string, metadata map[string]string) (*s3.PutObjectInput, error)

GenerateUploadPayload generates a payload for uploading a file to S3

func (*MockS3Service) UploadFile

func (m *MockS3Service) UploadFile(ctx context.Context, data []byte, s3Path, filename string, metadata map[string]string) error

UploadFile uploads a file to S3 with the given path and filename

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

GetUserPublicKey gets the public key for a user

type MockUserRepository

type MockUserRepository struct {
	mock.Mock
}

MockUserRepository provides a mock implementation of UserRepositoryInterface

func (*MockUserRepository) AddPurchase

func (m *MockUserRepository) AddPurchase(ctx *gin.Context, userID primitive.ObjectID, purchase *models.PurchaseEntity) error

AddPurchase adds a purchase to a user

func (*MockUserRepository) Create

Create creates a new user

func (*MockUserRepository) Delete

func (m *MockUserRepository) Delete(ctx context.Context, id string) error

Delete deletes a user by ID

func (*MockUserRepository) FindByEmail

func (m *MockUserRepository) FindByEmail(ctx context.Context, email string) (*models.UserEntity, error)

FindByEmail finds a user by email

func (*MockUserRepository) FindByID

FindByID finds a user by ID

func (*MockUserRepository) GetByID

GetByID gets a user by ID

func (*MockUserRepository) ResetAllUserData

func (m *MockUserRepository) ResetAllUserData(ctx *gin.Context, userID primitive.ObjectID) error

ResetAllUserData resets all user data

func (*MockUserRepository) Update

Update updates a user with the given ID

Jump to

Keyboard shortcuts

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