Documentation ¶
Index ¶
- type CommonRepository
- type LoggingRepository
- func (lr *LoggingRepository[T]) Create(ctx context.Context, entity T) error
- func (lr *LoggingRepository[T]) Delete(ctx context.Context, id string) error
- func (lr *LoggingRepository[T]) GetAll(ctx context.Context) ([]T, error)
- func (lr *LoggingRepository[T]) GetByFilter(ctx context.Context, filter map[string]interface{}) ([]T, error)
- func (lr *LoggingRepository[T]) GetByID(ctx context.Context, id string) (T, error)
- func (lr *LoggingRepository[T]) Update(ctx context.Context, id string, entity T) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonRepository ¶
type CommonRepository[T model.Entity] interface { GetAll(ctx context.Context) ([]T, error) GetByFilter(ctx context.Context, filter map[string]interface{}) ([]T, error) GetByID(ctx context.Context, id string) (T, error) Create(ctx context.Context, entity T) error Update(ctx context.Context, id string, entity T) error Delete(ctx context.Context, id string) error }
func NewMongoRepository ¶
func NewMongoRepository[T model.Entity](collection db.CollectionInterface) CommonRepository[T]
func NewMongoRepositoryUoW ¶
func NewMongoRepositoryUoW[T model.Entity](collection db.CollectionInterface, uoW uow.UnitOfWork) CommonRepository[T]
type LoggingRepository ¶
func NewLoggingRepository ¶
func NewLoggingRepository[T model.Entity](r CommonRepository[T]) *LoggingRepository[T]
func (*LoggingRepository[T]) Create ¶
func (lr *LoggingRepository[T]) Create(ctx context.Context, entity T) error
func (*LoggingRepository[T]) Delete ¶
func (lr *LoggingRepository[T]) Delete(ctx context.Context, id string) error
func (*LoggingRepository[T]) GetAll ¶
func (lr *LoggingRepository[T]) GetAll(ctx context.Context) ([]T, error)
func (*LoggingRepository[T]) GetByFilter ¶
func (lr *LoggingRepository[T]) GetByFilter(ctx context.Context, filter map[string]interface{}) ([]T, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.