Documentation ¶
Index ¶
- type Controller
- func (c *Controller) ArchiveNote(w http.ResponseWriter, r *http.Request)
- func (c *Controller) CreateNote(w http.ResponseWriter, r *http.Request)
- func (c *Controller) DeleteNote(w http.ResponseWriter, r *http.Request)
- func (c *Controller) GetNote(w http.ResponseWriter, r *http.Request)
- func (c *Controller) GetNotes(w http.ResponseWriter, r *http.Request)
- func (c *Controller) UnArchiveNote(w http.ResponseWriter, r *http.Request)
- func (c *Controller) UpdateNote(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController() *Controller
func (*Controller) ArchiveNote ¶
func (c *Controller) ArchiveNote(w http.ResponseWriter, r *http.Request)
ArchiveNote Archive a note @Summary Archive note by id note @Description Archive note by id note. Note should be owned by current user and status should be active @Tags notes @Accept json @Produce json @Param noteId path string true "note id (uuid)" @Success 200 @Failure 400 {object} response.Error @Router /v1/note/{noteId}/archive [patch] @Security bearerToken
func (*Controller) CreateNote ¶
func (c *Controller) CreateNote(w http.ResponseWriter, r *http.Request)
CreateNote create new notes for user @Summary Creates note @Description Creates a new note for currently logged in user @Tags notes @Accept json @Produce json @Param body body request.CreateNoteRequest true "add note" @Success 200 {object} response.CreateNoteResponse "new created note id" @Failure 400 {object} response.Error @Router /v1/note [post] @Security bearerToken
func (*Controller) DeleteNote ¶
func (c *Controller) DeleteNote(w http.ResponseWriter, r *http.Request)
DeleteNote delete a note @Summary Delete note @Description Delete a note. Note should be owned by current user @Tags notes @Accept json @Produce json @Param noteId path string true "note id (uuid)" @Failure 400 {object} response.Error @Success 200 @Router /v1/note/{noteId} [delete] @Security bearerToken
func (*Controller) GetNote ¶
func (c *Controller) GetNote(w http.ResponseWriter, r *http.Request)
GetNote Get a note @Summary Get note by id note @Description Get note by id note. Note should be owned by current user @Tags notes @Accept json @Produce json @Param noteId path string true "note id (uuid)" @Success 200 {object} response.GetNoteResponse "note" @Failure 400 {object} response.Error @Router /v1/note/{noteId} [get] @Security bearerToken
func (*Controller) GetNotes ¶
func (c *Controller) GetNotes(w http.ResponseWriter, r *http.Request)
GetNotes Get notes @Summary Get notes of current user @Description Get notes of current user. Only returning the active notes, to get the archived notes, use archived query param @Tags notes @Accept json @Produce json @Param archived query boolean false "archived notes" @Success 200 {object} response.GetNotesResponse "notes" @Failure 400 {object} response.Error @Router /v1/note [get] @Security bearerToken
func (*Controller) UnArchiveNote ¶
func (c *Controller) UnArchiveNote(w http.ResponseWriter, r *http.Request)
UnArchiveNote UnArchive a note @Summary UnArchive note by id note @Description UnArchive note by id note. Note should be owned by current user and status should be archived @Tags notes @Accept json @Produce json @Param noteId path string true "note id (uuid)" @Success 200 @Failure 400 {object} response.Error @Router /v1/note/{noteId}/unarchive [patch] @Security bearerToken
func (*Controller) UpdateNote ¶
func (c *Controller) UpdateNote(w http.ResponseWriter, r *http.Request)
UpdateNote update a note @Summary Update note @Description Update title/content of a note. Note should be owned by current user @Tags notes @Accept json @Produce json @Param noteId path string true "note id (uuid)" @Param body body request.UpdateNoteRequest true "update note" @Failure 400 {object} response.Error @Success 200 @Router /v1/note/{noteId} [put] @Security bearerToken