Versions in this module Expand all Collapse all v0 v0.1.1 Jul 14, 2024 v0.1.0 Jul 13, 2024 Changes in this version + func ErrorMiddleware(logger *zap.Logger) fiber.Handler + func RespondWithError(ctx *fiber.Ctx, err error) error + type AddTargetNotesRequest struct + Notes []string + func (r AddTargetNotesRequest) Validate() error + type AddTargetRequest struct + Country string + Name string + func (r AddTargetRequest) Validate() error + type AddTargetsRequest struct + Targets []AddTargetRequest + func (r AddTargetsRequest) Params() []dto.CreateTargetParams + func (r AddTargetsRequest) Validate() error + type BaseResponse struct + Ok bool + type Cat struct + Breed string + CreatedAt time.Time + ExperienceYears int16 + ID int + Name string + Salary int + UpdatedAt time.Time + func CatFromModel(cat *models.Cat) Cat + type CreateCatRequest struct + Breed string + Experience int + Name string + Salary int + func (r CreateCatRequest) Validate() error + type CreateCatResponse struct + ID int + type CreateMissionRequest struct + Targets []AddTargetRequest + func (r CreateMissionRequest) Params() dto.CreateMissionParams + func (r CreateMissionRequest) Validate() error + type CreateMissionResponse struct + ID int + type Error struct + Code codes.Code + Message string + Metadata map[string]any + Ok bool + type GetCatResponse struct + Cat Cat + type GetCatsResponse struct + Cats []Cat + type GetMissionResponse struct + Mission MissionFull + type GetMissionTargetsResponse struct + Targets []TargetFull + type GetMissionsRequest struct + CatID *int + type GetMissionsResponse struct + Missions []Mission + type GetTargetResponse struct + Target TargetFull + type Handler struct + func (h Handler) AddMissionTargets(ctx *fiber.Ctx) error + func (h Handler) AddTargetNote(ctx *fiber.Ctx) error + func (h Handler) CompleteMissionByID(ctx *fiber.Ctx) error + func (h Handler) CompleteTargetByID(ctx *fiber.Ctx) error + func (h Handler) CreateCat(ctx *fiber.Ctx) error + func (h Handler) CreateMission(ctx *fiber.Ctx) error + func (h Handler) DeleteCatByID(ctx *fiber.Ctx) error + func (h Handler) DeleteMissionByID(ctx *fiber.Ctx) error + func (h Handler) DeleteTargetByID(ctx *fiber.Ctx) error + func (h Handler) GetCatByID(ctx *fiber.Ctx) error + func (h Handler) GetCats(ctx *fiber.Ctx) error + func (h Handler) GetMissionByID(ctx *fiber.Ctx) error + func (h Handler) GetMissionTargets(ctx *fiber.Ctx) error + func (h Handler) GetMissions(ctx *fiber.Ctx) error + func (h Handler) GetTargetByID(ctx *fiber.Ctx) error + func (h Handler) UpdateCatByID(ctx *fiber.Ctx) error + func (h Handler) UpdateMissionByID(ctx *fiber.Ctx) error + type Mission struct + AssignedCatID *int + CreatedAt time.Time + ID int + IsCompleted bool + UpdatedAt time.Time + func MissionFromModel(mission *models.Mission) Mission + type MissionFull struct + Targets []Target + func MissionFullFromModel(missionFull *models.MissionFull) MissionFull + type Note struct + Content string + CreatedAt time.Time + ID int + TargetID int + func NoteFromModel(note *models.Note) Note + type Server struct + func NewServer(cfg *config.Config, logger *zap.Logger, service Service) *Server + func (s *Server) Shutdown() error + func (s *Server) Start() error + type Service interface + AddCat func(ctx context.Context, params dto.CreateCatParams) (catID int, err error) + AddMissionTargets func(ctx context.Context, missionID int, newTargets []dto.CreateTargetParams) (err error) + AddTargetNote func(ctx context.Context, missionID int, targetID int, contents []string) (err error) + CompleteTargetByID func(ctx context.Context, missionID int, targetID int) (err error) + CreateMission func(ctx context.Context, params dto.CreateMissionParams) (missionID int, err error) + DeleteCatByID func(ctx context.Context, catID int) error + DeleteMissionByID func(ctx context.Context, missionID int) (err error) + DeleteTargetByID func(ctx context.Context, missionID int, targetID int) (err error) + GetCatByID func(ctx context.Context, catID int) (*models.Cat, error) + GetCats func(ctx context.Context) ([]*models.Cat, error) + GetMissionByID func(ctx context.Context, missionID int) (out *models.MissionFull, err error) + GetMissions func(ctx context.Context, params dto.GetMissionsParams) ([]*models.Mission, error) + GetTargetByID func(ctx context.Context, missionID int, targetID int) (out *models.TargetFull, err error) + GetTargetsByMissionID func(ctx context.Context, missionID int) (out []*models.TargetFull, err error) + UpdateCatByID func(ctx context.Context, params dto.UpdateCatParams) error + UpdateMissionByID func(ctx context.Context, params dto.UpdateMissionParams) (err error) + type Target struct + Country string + CreatedAt time.Time + ID int + IsCompleted bool + MissionID int + Name string + UpdatedAt time.Time + func TargetFromModel(target *models.Target) Target + type TargetFull struct + Notes []Note + func TargetFullFromModel(targetFull *models.TargetFull) TargetFull + type UpdateCatRequest struct + CatID int + ExperienceYears *int + Name *string + Salary *int + func (r UpdateCatRequest) Validate() error + type UpdateMissionRequest struct + AssignedCatID *int + func (r UpdateMissionRequest) Validate() error