Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HealthController ¶
type HealthController struct { }
func NewHealthController ¶
func NewHealthController() *HealthController
func (*HealthController) HealthCheck ¶
func (controller *HealthController) HealthCheck(writer http.ResponseWriter, request *http.Request)
type PetController ¶
type PetController struct {
// contains filtered or unexported fields
}
func NewPetController ¶
func NewPetController(petCrudService *PetCrudService, petStatsService *domain.PetStatsService) *PetController
func (*PetController) CreatePet ¶
func (petcontroller *PetController) CreatePet(writer http.ResponseWriter, request *http.Request)
CreatePet godoc @Summary Create a pet @Description Create a pet providing a pet model @Tags PetController @Accept json @Produce json @Param pet body PetDto true "pet" @Success 200 {object} PetDto @Failure 400 {object} string @Failure 500 {object} string @Router /CreatePet [post]
func (*PetController) ListPets ¶
func (petcontroller *PetController) ListPets(writer http.ResponseWriter, request *http.Request)
ListPets godoc @Summary List all pets @Description List all pets in the storage @Tags PetController @Accept json @Produce json @Success 200 {array} PetDto @Failure 400 {object} string @Failure 500 {object} string @Router /ListPets [get]
func (*PetController) PetsKpi ¶
func (petcontroller *PetController) PetsKpi(writer http.ResponseWriter, request *http.Request)
PetsKpi godoc @Summary Get pets Kpi @Description Get predominant species in the storage. Get average age and std deviation for the provided "species" parameter @Tags PetController @Accept json @Produce json @Param species query string true "species to get average age and std deviation from" @Success 200 {object} KpiDto @Failure 400 {object} string @Failure 500 {object} string @Router /Kpis [get]
type PetCrudService ¶
type PetCrudService struct {
// contains filtered or unexported fields
}
func NewPetCrudService ¶
func NewPetCrudService(petRepository domain.IPetRepository) *PetCrudService
func (*PetCrudService) CreatePet ¶
func (service *PetCrudService) CreatePet(pet *PetDto) error
func (*PetCrudService) GetPets ¶
func (service *PetCrudService) GetPets() (*[]PetDto, error)
type PetDto ¶
type PetDto struct { Id int `json:"-"` Name string `json:"name" example:"luke"` Species string `json:"species" example:"dog"` Gender string `json:"gender" example:"male"` Age int `json:"age" example:"2"` Dob time.Time `json:"dob" example:"2020-05-01T00:00:00Z"` }