repository

package
v0.0.0-...-c17fed3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: GPL-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 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

type LoggingRepository[T model.Entity] struct {
	// contains filtered or unexported fields
}

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)

func (*LoggingRepository[T]) GetByID

func (lr *LoggingRepository[T]) GetByID(ctx context.Context, id string) (T, error)

func (*LoggingRepository[T]) Update

func (lr *LoggingRepository[T]) Update(ctx context.Context, id string, entity T) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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