Documentation ¶
Index ¶
- type Driver
- type Module
- type PaginatedPetsList
- type Pet
- type PetDriver
- func (d *PetDriver) DeletePetByID(id string) error
- func (d *PetDriver) FindAllPets() ([]Pet, error)
- func (d *PetDriver) FindPetById(id string) (*Pet, error)
- func (d *PetDriver) FindPetByNameAndOwnerID(name string, ownerID string) (*Pet, error)
- func (d *PetDriver) FindPetTreatments(petID string) ([]Treatment, error)
- func (d *PetDriver) FindPetsByName(name string) ([]Pet, error)
- func (d *PetDriver) FindPetsByOwnerID(ownerID, page, limit string) (PaginatedPetsList, error)
- func (d *PetDriver) FindPetsByVaccineNextDate(date []string) ([]Pet, error)
- func (d *PetDriver) FindPetsTreatments(userID string) ([]Pet, error)
- func (d *PetDriver) FindPetsWithUpcomingVaccines(userID string, dateRange string) ([]Pet, error)
- func (d *PetDriver) InsertPet(pet *Pet) (*Pet, error)
- func (d *PetDriver) UpdatePet(id string, pet *Pet) (*Pet, error)
- func (d *PetDriver) UpdatePetTreatments(pet *Pet) (*Pet, error)
- type PetDriverMock
- func (d *PetDriverMock) DeletePetByID(id string) error
- func (d *PetDriverMock) FindAllPets() ([]Pet, error)
- func (d *PetDriverMock) FindPetById(id string) (*Pet, error)
- func (d *PetDriverMock) FindPetByNameAndOwnerID(name string, ownerID string) (*Pet, error)
- func (d *PetDriverMock) FindPetTreatments(petID string) ([]Treatment, error)
- func (d *PetDriverMock) FindPetsByName(name string) ([]Pet, error)
- func (d *PetDriverMock) FindPetsByOwnerID(ownerID, page, limit string) (PaginatedPetsList, error)
- func (d *PetDriverMock) FindPetsByVaccineNextDate(date []string) ([]Pet, error)
- func (d *PetDriverMock) FindPetsTreatments(userID string) ([]Pet, error)
- func (d *PetDriverMock) FindPetsWithUpcomingVaccines(userID string, dateRange string) ([]Pet, error)
- func (d *PetDriverMock) InsertPet(pet *Pet) (*Pet, error)
- func (d *PetDriverMock) UpdatePet(id string, pet *Pet) (*Pet, error)
- func (d *PetDriverMock) UpdatePetTreatments(pet *Pet) (*Pet, error)
- type State
- type Treatment
- type TypeTreatment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver interface { FindAllPets() ([]Pet, error) FindPetsByName(name string) ([]Pet, error) FindPetById(id string) (*Pet, error) InsertPet(pet *Pet) (*Pet, error) UpdatePet(id string, pet *Pet) (*Pet, error) UpdatePetTreatments(pet *Pet) (*Pet, error) DeletePetByID(id string) error FindPetsByOwnerID(ownerID string, page string, limit string) (PaginatedPetsList, error) FindPetByNameAndOwnerID(name string, ownerID string) (*Pet, error) FindPetsByVaccineNextDate(date []string) ([]Pet, error) FindPetTreatments(petID string) ([]Treatment, error) FindPetsWithUpcomingVaccines(userID string, dateRange string) ([]Pet, error) FindPetsTreatments(userID string) ([]Pet, error) }
type Module ¶
type Module struct { Handler *handler // contains filtered or unexported fields }
func (*Module) RegisterRoutes ¶
type PaginatedPetsList ¶
type Pet ¶
type Pet struct { ID string `json:"id" bson:"_id"` Name string `validate:"required,max=50" json:"name" bson:"name"` Species string `validate:"required,max=50" json:"species" bson:"species"` Sex string `validate:"required,max=50" json:"sex" bson:"sex"` Birthdate string `validate:"required,date" json:"birthdate" bson:"birthdate"` Age string `json:"age,omitempty" bson:"age"` OwnerID string `json:"ownerId" bson:"ownerId"` Treatments []Treatment `json:"treatments" bson:"treatments"` }
type PetDriver ¶
type PetDriver struct {
// contains filtered or unexported fields
}
func (*PetDriver) DeletePetByID ¶
func (*PetDriver) FindAllPets ¶
func (*PetDriver) FindPetByNameAndOwnerID ¶
func (*PetDriver) FindPetTreatments ¶
func (*PetDriver) FindPetsByOwnerID ¶
func (d *PetDriver) FindPetsByOwnerID(ownerID, page, limit string) (PaginatedPetsList, error)
func (*PetDriver) FindPetsByVaccineNextDate ¶
func (*PetDriver) FindPetsTreatments ¶
func (*PetDriver) FindPetsWithUpcomingVaccines ¶
type PetDriverMock ¶
type PetDriverMock struct { UpdatePetTreatmentsCalled bool UpdatePetTreatmentsPet *Pet UpdatePetTreatmentsErr error FindPetByIdCalled bool FindPetByIdPet *Pet FindPetByIdErr error FindPetByIdPetId string FindPetByNameAndOwnerIDCalled bool FindPetByNameAndOwnerIDPet *Pet FindPetByNameAndOwnerIDErr error FindPetByNameAndOwnerIDName string FindPetByNameAndOwnerIDOwnerId string FindPetsByOwnerIDCalled bool FindPetsByOwnerIDLimit string FindPetsByOwnerIDPage string FindPetsByOwnerIDPets []Pet FindPetsByOwnerIDErr error FindPetsByOwnerIDOwnerId string DeletePetByIDCalled bool DeletePetByIDErr error DeletePetByIDPetId string InsertPetCalled bool InsertPetErr error InsertPetPet *Pet UpdatePetCalled bool UpdatePetErr error UpdatePetPet *Pet }
func (*PetDriverMock) DeletePetByID ¶
func (d *PetDriverMock) DeletePetByID(id string) error
func (*PetDriverMock) FindAllPets ¶
func (d *PetDriverMock) FindAllPets() ([]Pet, error)
func (*PetDriverMock) FindPetById ¶
func (d *PetDriverMock) FindPetById(id string) (*Pet, error)
func (*PetDriverMock) FindPetByNameAndOwnerID ¶
func (d *PetDriverMock) FindPetByNameAndOwnerID(name string, ownerID string) (*Pet, error)
func (*PetDriverMock) FindPetTreatments ¶
func (d *PetDriverMock) FindPetTreatments(petID string) ([]Treatment, error)
func (*PetDriverMock) FindPetsByName ¶
func (d *PetDriverMock) FindPetsByName(name string) ([]Pet, error)
func (*PetDriverMock) FindPetsByOwnerID ¶
func (d *PetDriverMock) FindPetsByOwnerID(ownerID, page, limit string) (PaginatedPetsList, error)
func (*PetDriverMock) FindPetsByVaccineNextDate ¶
func (d *PetDriverMock) FindPetsByVaccineNextDate(date []string) ([]Pet, error)
func (*PetDriverMock) FindPetsTreatments ¶
func (d *PetDriverMock) FindPetsTreatments(userID string) ([]Pet, error)
func (*PetDriverMock) FindPetsWithUpcomingVaccines ¶
func (d *PetDriverMock) FindPetsWithUpcomingVaccines(userID string, dateRange string) ([]Pet, error)
func (*PetDriverMock) UpdatePet ¶
func (d *PetDriverMock) UpdatePet(id string, pet *Pet) (*Pet, error)
func (*PetDriverMock) UpdatePetTreatments ¶
func (d *PetDriverMock) UpdatePetTreatments(pet *Pet) (*Pet, error)
type Treatment ¶
type Treatment struct { ID string `json:"id" bson:"_id"` Name string `validate:"required,max=50" json:"name" bson:"name"` AdditionalInformation string `validate:"max=100" json:"additionalInfo,omitempty" bson:"additionalInfo"` Date string `validate:"required,date" json:"date" bson:"date"` Next string `validate:"required,date" json:"next" bson:"next"` Veterinary string `validate:"max=100" json:"veterinary,omitempty" bson:"veterinary"` TypeTreatment TypeTreatment `json:"type" bson:"type"` State State `json:"state,omitempty" bson:"state"` }
type TypeTreatment ¶
type TypeTreatment string
const ( Vaccine TypeTreatment = "vaccine" Medicine TypeTreatment = "medicine" )
Click to show internal directories.
Click to hide internal directories.