Documentation ¶
Index ¶
- func New(f MockFunc) repositories.Repository
- type MockFunc
- type MockRepository
- func (m *MockRepository) Count(ctx context.Context, conditions repositories.Conditions) int
- func (m *MockRepository) CreateOne(ctx context.Context, entity repositories.Entity) (repositories.Entity, error)
- func (m *MockRepository) Find(ctx context.Context, conditions repositories.Conditions) (repositories.EntitySlice, error)
- func (m *MockRepository) FindOne(ctx context.Context, s string) (repositories.Entity, error)
- func (m *MockRepository) RemoveByID(ctx context.Context, s string) error
- func (m *MockRepository) UpdateByID(ctx context.Context, s string, entity repositories.Entity) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(f MockFunc) repositories.Repository
Types ¶
type MockFunc ¶
type MockFunc struct { FindOne func(context.Context, string) (repositories.Entity, error) Find func(context.Context, repositories.Conditions) (repositories.EntitySlice, error) Count func(context.Context, repositories.Conditions) int CreateOne func(context.Context, repositories.Entity) (repositories.Entity, error) UpdateByID func(context.Context, string, repositories.Entity) error RemoveByID func(context.Context, string) error }
type MockRepository ¶
type MockRepository struct {
// contains filtered or unexported fields
}
func (*MockRepository) Count ¶
func (m *MockRepository) Count(ctx context.Context, conditions repositories.Conditions) int
func (*MockRepository) CreateOne ¶
func (m *MockRepository) CreateOne(ctx context.Context, entity repositories.Entity) (repositories.Entity, error)
func (*MockRepository) Find ¶
func (m *MockRepository) Find(ctx context.Context, conditions repositories.Conditions) (repositories.EntitySlice, error)
func (*MockRepository) FindOne ¶
func (m *MockRepository) FindOne(ctx context.Context, s string) (repositories.Entity, error)
func (*MockRepository) RemoveByID ¶
func (m *MockRepository) RemoveByID(ctx context.Context, s string) error
func (*MockRepository) UpdateByID ¶
func (m *MockRepository) UpdateByID(ctx context.Context, s string, entity repositories.Entity) error
Click to show internal directories.
Click to hide internal directories.