readversions

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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]

Types

type Body

type Body struct {
	Content string `json:"content"`
}

Body is the text an edit could not save.

Jump to

Keyboard shortcuts

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