e_repository

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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)

Jump to

Keyboard shortcuts

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