Documentation ¶
Index ¶
- func Contact(contactParams types.RouteParams)
- func DeleteContact(db *gorm.DB, id uuid.UUID) *errors.Error
- func GetContact(db *gorm.DB, id uuid.UUID) (*models.Contact, *errors.Error)
- func GetContacts(db *gorm.DB, limit int, page int) ([]models.Contact, *errors.Error)
- type ContactController
- type ContactService
- type ContactServiceInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contact ¶
func Contact(contactParams types.RouteParams)
Types ¶
type ContactController ¶
type ContactController struct {
// contains filtered or unexported fields
}
func NewContactController ¶
func NewContactController(contactService ContactServiceInterface) *ContactController
func (*ContactController) DeleteContact ¶
func (co *ContactController) DeleteContact(c *fiber.Ctx) error
DeleteContact godoc
@Summary Deletes a contact @Description Deletes a contact @ID delete-contact @Tags contact @Accept json @Produce json @Param contactID path string true "Contact ID" @Success 201 {object} models.Contact @Failure 400 {string} errors.Error @Failure 404 {string} errors.Error @Failure 500 {string} errors.Error @Router /contacts/{contactID}/ [delete]
func (*ContactController) GetContact ¶
func (co *ContactController) GetContact(c *fiber.Ctx) error
GetContact godoc
@Summary Retrieves a contact @Description Retrieves a contact by id @ID get-contact @Tags contact @Accept json @Produce json @Param contactID path string true "Contact ID" @Success 201 {object} models.Contact @Failure 400 {string} errors.Error @Failure 404 {string} errors.Error @Failure 500 {string} errors.Error @Router /contacts/{contactID}/ [get]
func (*ContactController) GetContacts ¶
func (co *ContactController) GetContacts(c *fiber.Ctx) error
GetContacts godoc
@Summary Retrieve all contacts @Description Retrieves all contacts @ID get-contacts @Tags contact @Produce json @Param limit query int false "Limit" @Param page query int false "Page" @Success 200 {object} []models.Contact @Failure 400 {string} errors.Error @Failure 404 {string} errors.Error @Failure 500 {string} errors.Error @Router /contacts/ [get]
type ContactService ¶
type ContactService struct {
types.ServiceParams
}
func (*ContactService) DeleteContact ¶
func (c *ContactService) DeleteContact(contactID string) *errors.Error
func (*ContactService) GetContact ¶
func (*ContactService) GetContacts ¶
type ContactServiceInterface ¶
type ContactServiceInterface interface { GetContacts(limit string, page string) ([]models.Contact, *errors.Error) GetContact(contactID string) (*models.Contact, *errors.Error) DeleteContact(contactID string) *errors.Error }
func NewContactService ¶
func NewContactService(serviceParams types.ServiceParams) ContactServiceInterface