mongodb

package
v0.0.0-...-6eddc5e Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PET_COLLECTION   = "pets"
	OWNER_COLLECTION = "owners"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OwnerRepository

type OwnerRepository struct {
	// contains filtered or unexported fields
}

func NewOwnerRepository

func NewOwnerRepository(db *mongo.Database) *OwnerRepository

func (*OwnerRepository) Create

func (r *OwnerRepository) Create(owner models.Owner) (*models.Owner, error)

func (*OwnerRepository) FindByUserId

func (r *OwnerRepository) FindByUserId(userId string) (*models.Owner, error)

type PetRepository

type PetRepository struct {
	// contains filtered or unexported fields
}

func NewPetRepository

func NewPetRepository(db *mongo.Database) *PetRepository

func (*PetRepository) Create

func (r *PetRepository) Create(profile models.Pet) (*models.Pet, error)

func (*PetRepository) Delete

func (r *PetRepository) Delete(id string) error

func (*PetRepository) FindAll

func (r *PetRepository) FindAll() ([]models.Pet, error)

func (*PetRepository) FindById

func (r *PetRepository) FindById(id string) (*models.Pet, error)

func (*PetRepository) FindByIdAndOwnerId

func (r *PetRepository) FindByIdAndOwnerId(id, ownerId string) (*models.Pet, error)

func (*PetRepository) FindByOwnerId

func (r *PetRepository) FindByOwnerId(ownerId string) ([]models.Pet, error)

func (*PetRepository) Update

func (r *PetRepository) Update(profile models.Pet) (*models.Pet, error)

Jump to

Keyboard shortcuts

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