Documentation
¶
Index ¶
- type Repository
- func (r Repository[T]) Create(payload T) primitive.ObjectID
- func (r Repository[T]) Delete(id primitive.ObjectID)
- func (r Repository[T]) FindAll() []T
- func (r Repository[T]) FindByID(id primitive.ObjectID) *T
- func (r Repository[T]) FindOne(query primitive.M) *T
- func (r Repository[T]) Update(id primitive.ObjectID, payload T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository[T any] struct { // contains filtered or unexported fields }
func NewRepository ¶
func NewRepository[T any](collection string) Repository[T]
func (Repository[T]) Create ¶
func (r Repository[T]) Create(payload T) primitive.ObjectID
func (Repository[T]) Delete ¶
func (r Repository[T]) Delete(id primitive.ObjectID)
func (Repository[T]) FindAll ¶
func (r Repository[T]) FindAll() []T
func (Repository[T]) FindByID ¶
func (r Repository[T]) FindByID(id primitive.ObjectID) *T
func (Repository[T]) FindOne ¶
func (r Repository[T]) FindOne(query primitive.M) *T
func (Repository[T]) Update ¶
func (r Repository[T]) Update(id primitive.ObjectID, payload T)
Click to show internal directories.
Click to hide internal directories.