repoiface

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package repoiface is a generated GoMock package.

Package repoiface is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountRepository

type AccountRepository interface {
	Create(ctx context.Context, account *models.Account) error
	ModifyPassword(ctx context.Context, account *models.Account) error
	GetById(ctx context.Context, id int64) (*models.Account, error)
	GetByMobile(ctx context.Context, mobile string) (*models.Account, error)
	GetByEmail(ctx context.Context, email string) (*models.Account, error)
	IsMobileExist(ctx context.Context, mobile string) (bool, error)
	IsEmailExist(ctx context.Context, email string) (bool, error)
}

type FileRepository

type FileRepository interface {
	// GetTx returns a transaction for file tables
	GetTx() *gorm.DB
	// Add adds a file to the database
	Add(ctx context.Context, tx *gorm.DB, file *models.File, method filerepo.GetTableNameFunc) error
	// Load loads a file from the database
	Load(ctx context.Context, file *models.File, method filerepo.GetTableNameFunc) error
	// LoadUploaded loads an uploaded file from the database
	LoadUploaded(ctx context.Context, file *models.File, method filerepo.GetTableNameFunc) error
	// LoadByHash loads a file by hash from the database
	LoadByHash(ctx context.Context, file *models.File, method filerepo.GetTableNameFunc) error
	// Remove removes a file from the database
	Remove(ctx context.Context, tx *gorm.DB, file *models.File, method filerepo.GetTableNameFunc) error
	// Update updates a file in the database
	Update(ctx context.Context, tx *gorm.DB, file *models.File, method filerepo.GetTableNameFunc) error
}

type MinioRepository

type MinioRepository interface {
	// PreSignGetUrl returns a pre-signed URL for downloading an object
	PreSignGetUrl(ctx context.Context, bucketName, objectName, fileName string, expireSeconds int64) (string, error)
	// PreSignPutUrl returns a pre-signed URL for uploading an object
	PreSignPutUrl(ctx context.Context, bucketName, objectName string, expireSeconds int64) (string, error)
	// CreateSlicingUpload creates a new multipart upload
	CreateSlicingUpload(ctx context.Context, bucketName, objectName string, options minio.PutObjectOptions) (uploadId string, err error)
	// ListSlicingFileParts lists the parts of a multipart upload
	ListSlicingFileParts(ctx context.Context, bucketName, objectName, uploadId string, partsNum int64) (minio.ListObjectPartsResult, error)
	// PreSignSlicingPutUrl returns a pre-signed URL for uploading a part of a multipart upload
	PreSignSlicingPutUrl(ctx context.Context, bucketName, objectName, uploadId string, parts int64) (string, error)
	// MergeSlices merges the parts of a multipart upload
	MergeSlices(ctx context.Context, bucketName, objectName, uploadId string, parts []minio.CompletePart) error
	// GetObjectHash returns the hash of an object
	GetObjectHash(ctx context.Context, bucketName, objectName string) (string, error)
}

type MockAccountRepository

type MockAccountRepository struct {
	// contains filtered or unexported fields
}

MockAccountRepository is a mock of AccountRepository interface.

func NewMockAccountRepository

func NewMockAccountRepository(ctrl *gomock.Controller) *MockAccountRepository

NewMockAccountRepository creates a new mock instance.

func (*MockAccountRepository) Create

func (m *MockAccountRepository) Create(ctx context.Context, account *models.Account) error

Create mocks base method.

func (*MockAccountRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAccountRepository) GetByEmail

func (m *MockAccountRepository) GetByEmail(ctx context.Context, email string) (*models.Account, error)

GetByEmail mocks base method.

func (*MockAccountRepository) GetById

func (m *MockAccountRepository) GetById(ctx context.Context, id int64) (*models.Account, error)

GetById mocks base method.

func (*MockAccountRepository) GetByMobile

func (m *MockAccountRepository) GetByMobile(ctx context.Context, mobile string) (*models.Account, error)

GetByMobile mocks base method.

func (*MockAccountRepository) IsEmailExist

func (m *MockAccountRepository) IsEmailExist(ctx context.Context, email string) (bool, error)

IsEmailExist mocks base method.

func (*MockAccountRepository) IsMobileExist

func (m *MockAccountRepository) IsMobileExist(ctx context.Context, mobile string) (bool, error)

IsMobileExist mocks base method.

func (*MockAccountRepository) ModifyPassword

func (m *MockAccountRepository) ModifyPassword(ctx context.Context, account *models.Account) error

ModifyPassword mocks base method.

type MockAccountRepositoryMockRecorder

type MockAccountRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockAccountRepositoryMockRecorder is the mock recorder for MockAccountRepository.

func (*MockAccountRepositoryMockRecorder) Create

func (mr *MockAccountRepositoryMockRecorder) Create(ctx, account any) *gomock.Call

Create indicates an expected call of Create.

func (*MockAccountRepositoryMockRecorder) GetByEmail

func (mr *MockAccountRepositoryMockRecorder) GetByEmail(ctx, email any) *gomock.Call

GetByEmail indicates an expected call of GetByEmail.

func (*MockAccountRepositoryMockRecorder) GetById

func (mr *MockAccountRepositoryMockRecorder) GetById(ctx, id any) *gomock.Call

GetById indicates an expected call of GetById.

func (*MockAccountRepositoryMockRecorder) GetByMobile

func (mr *MockAccountRepositoryMockRecorder) GetByMobile(ctx, mobile any) *gomock.Call

GetByMobile indicates an expected call of GetByMobile.

func (*MockAccountRepositoryMockRecorder) IsEmailExist

func (mr *MockAccountRepositoryMockRecorder) IsEmailExist(ctx, email any) *gomock.Call

IsEmailExist indicates an expected call of IsEmailExist.

func (*MockAccountRepositoryMockRecorder) IsMobileExist

func (mr *MockAccountRepositoryMockRecorder) IsMobileExist(ctx, mobile any) *gomock.Call

IsMobileExist indicates an expected call of IsMobileExist.

func (*MockAccountRepositoryMockRecorder) ModifyPassword

func (mr *MockAccountRepositoryMockRecorder) ModifyPassword(ctx, account any) *gomock.Call

ModifyPassword indicates an expected call of ModifyPassword.

type MockVerificationCodeRedisRepository

type MockVerificationCodeRedisRepository struct {
	// contains filtered or unexported fields
}

MockVerificationCodeRedisRepository is a mock of VerificationCodeRedisRepository interface.

func NewMockVerificationCodeRedisRepository

func NewMockVerificationCodeRedisRepository(ctrl *gomock.Controller) *MockVerificationCodeRedisRepository

NewMockVerificationCodeRedisRepository creates a new mock instance.

func (*MockVerificationCodeRedisRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockVerificationCodeRedisRepository) Get

func (m *MockVerificationCodeRedisRepository) Get(ctx context.Context, verificationCodeId int64) (string, error)

Get mocks base method.

func (*MockVerificationCodeRedisRepository) Insert

func (m *MockVerificationCodeRedisRepository) Insert(ctx context.Context, verificationCodeId, expireTime int64, code string) error

Insert mocks base method.

func (*MockVerificationCodeRedisRepository) Remove

func (m *MockVerificationCodeRedisRepository) Remove(ctx context.Context, verificationCodeId int64) error

Remove mocks base method.

type MockVerificationCodeRedisRepositoryMockRecorder

type MockVerificationCodeRedisRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockVerificationCodeRedisRepositoryMockRecorder is the mock recorder for MockVerificationCodeRedisRepository.

func (*MockVerificationCodeRedisRepositoryMockRecorder) Get

func (mr *MockVerificationCodeRedisRepositoryMockRecorder) Get(ctx, verificationCodeId any) *gomock.Call

Get indicates an expected call of Get.

func (*MockVerificationCodeRedisRepositoryMockRecorder) Insert

func (mr *MockVerificationCodeRedisRepositoryMockRecorder) Insert(ctx, verificationCodeId, expireTime, code any) *gomock.Call

Insert indicates an expected call of Insert.

func (*MockVerificationCodeRedisRepositoryMockRecorder) Remove

func (mr *MockVerificationCodeRedisRepositoryMockRecorder) Remove(ctx, verificationCodeId any) *gomock.Call

Remove indicates an expected call of Remove.

type TemplateRepository

type TemplateRepository interface {
	Create(ctx context.Context, template *models.Template) error
	ModifyById(ctx context.Context, template *models.Template) error
	Query(ctx context.Context, limit, offset int, conditions ...gen.Condition) ([]*models.Template, error)
	GetById(ctx context.Context, id int64) (*models.Template, error)
	RemoveById(ctx context.Context, id int64) error
}

type ThirdMessageSendService

type ThirdMessageSendService interface {
	Send(ctx context.Context, sendType api.PostType, to, title, content string) error
}

type VerificationCodeRedisRepository

type VerificationCodeRedisRepository interface {
	Insert(ctx context.Context, verificationCodeId, expireTime int64, code string) error
	Get(ctx context.Context, verificationCodeId int64) (string, error)
	Remove(ctx context.Context, verificationCodeId int64) error
}

Jump to

Keyboard shortcuts

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