Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(db bun.IDB) http.HandlerFunc
Handler lists the older texts of a note, without the texts: GET /api/notes/{id}/versions. @Summary List the versions of a note @Tags notes @Produce json @Param id path string true "uuid" @Success 200 {array} domain.NoteVersion @Failure 404 {object} respond.Failure @Failure 403 {object} respond.Failure @Failure 500 {object} respond.Failure @Router /api/notes/{id}/versions [get]
func Keep ¶
func Keep(db bun.IDB) http.HandlerFunc
Keep keeps a text refused by a 409 as a version marked conflict: POST /api/notes/{id}/versions (#78). It answers 204 when the text is the note's: nothing to keep. @Summary Keep a text refused by a conflict as a version @Tags notes @Accept json @Produce json @Param id path string true "uuid" @Param body body Body true "body" @Success 201 {object} domain.NoteVersion @Success 204 @Failure 400 {object} respond.Failure @Failure 404 {object} respond.Failure @Failure 413 {object} respond.Failure @Failure 500 {object} respond.Failure @Router /api/notes/{id}/versions [post]
func Read ¶
func Read(db bun.IDB) http.HandlerFunc
Read answers one version of a note with its text: GET /api/notes/{id}/versions/{version} (#99). @Summary Read a version of a note @Tags notes @Produce json @Param id path string true "uuid" @Param version path string true "uuid" @Success 200 {object} domain.NoteVersion @Failure 400 {object} respond.Failure @Failure 404 {object} respond.Failure @Failure 403 {object} respond.Failure @Failure 500 {object} respond.Failure @Router /api/notes/{id}/versions/{version} [get]