base

package
v0.0.0-...-702f6d9 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contact

func Contact(contactParams types.RouteParams)

func DeleteContact

func DeleteContact(db *gorm.DB, id uuid.UUID) *errors.Error

func GetContact

func GetContact(db *gorm.DB, id uuid.UUID) (*models.Contact, *errors.Error)

func GetContacts

func GetContacts(db *gorm.DB, limit int, page int) ([]models.Contact, *errors.Error)

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 (c *ContactService) GetContact(contactID string) (*models.Contact, *errors.Error)

func (*ContactService) GetContacts

func (c *ContactService) GetContacts(limit string, page string) ([]models.Contact, *errors.Error)

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

Jump to

Keyboard shortcuts

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