login

package
v1.18.3 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 18 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 AddToken

func AddToken(db bun.IDB) http.HandlerFunc

AddToken gives the account logged in a new API token, shown once in the answer: POST /api/me/tokens. @Summary Create an API token for the account logged in @Tags account @Accept json @Produce json @Param body body createapitoken.Input true "body" @Success 201 {object} createapitoken.Result @Failure 400 {object} respond.Failure @Failure 401 {object} respond.Failure @Failure 403 {object} respond.Failure @Failure 500 {object} respond.Failure @Router /api/me/tokens [post]

func DeleteData

func DeleteData(db bun.IDB) http.HandlerFunc

DeleteData deletes for good every note, folder, tag and image of the account logged in: DELETE /api/me/data. The account, its settings and its sessions stay. @Summary Delete every note, folder, tag and image of the account logged in @Tags account @Success 204 @Failure 401 {object} respond.Failure @Failure 500 {object} respond.Failure @Router /api/me/data [delete]

func EditMe

func EditMe(db bun.IDB) http.HandlerFunc

EditMe changes the settings of the account logged in: PATCH /api/me. @Summary Change the settings of the account logged in @Tags account @Accept json @Produce json @Param body body edituser.Input true "body" @Success 200 {object} domain.User @Failure 400 {object} respond.Failure @Failure 401 {object} respond.Failure @Failure 403 {object} respond.Failure @Failure 409 {object} respond.Failure @Failure 413 {object} respond.Failure @Failure 500 {object} respond.Failure @Router /api/me [patch]

func EditPassword

func EditPassword(db bun.IDB) http.HandlerFunc

EditPassword changes the password of the account logged in, and logs its other devices out: PATCH /api/me/password. @Summary Change the password of the account logged in @Tags account @Accept json @Param body body editpassword.Input true "body" @Success 204 @Failure 400 {object} respond.Failure @Failure 401 {object} respond.Failure @Failure 429 {object} respond.Failure @Failure 500 {object} respond.Failure @Router /api/me/password [patch]

func Handler

func Handler(db bun.IDB) http.HandlerFunc

Handler logs in: POST /api/login. The session token goes in an HttpOnly cookie, in the body only when the input asks it (the CLI). @Summary Log in @Tags account @Accept json @Produce json @Param body body createsession.Input true "body" @Success 200 {object} createsession.Result @Failure 400 {object} respond.Failure @Failure 401 {object} respond.Failure @Failure 429 {object} respond.Failure @Failure 500 {object} respond.Failure @Router /api/login [post]

func Logout

func Logout(db bun.IDB) http.HandlerFunc

Logout logs this device out: POST /api/logout. @Summary Log out @Tags account @Success 204 @Failure 401 {object} respond.Failure @Failure 500 {object} respond.Failure @Router /api/logout [post]

func Me

func Me(db bun.IDB) http.HandlerFunc

Me is the account logged in: GET /api/me. @Summary The account logged in @Tags account @Produce json @Success 200 {object} domain.User @Failure 401 {object} respond.Failure @Router /api/me [get]

func RevokeToken

func RevokeToken(db bun.IDB) http.HandlerFunc

RevokeToken revokes an API token of the account logged in: DELETE /api/me/tokens/{id}. @Summary Revoke an API token of the account logged in @Tags account @Param id path string true "uuid" @Success 204 @Failure 401 {object} respond.Failure @Failure 403 {object} respond.Failure @Failure 404 {object} respond.Failure @Failure 500 {object} respond.Failure @Router /api/me/tokens/{id} [delete]

func Stats

func Stats(db bun.IDB) http.HandlerFunc

Stats counts the live notes of the account logged in and the bytes its notes take in the base: GET /api/me/stats. @Summary Count the notes of the account logged in and their size in the base @Tags account @Produce json @Success 200 {object} countnotes.Stats @Failure 401 {object} respond.Failure @Failure 500 {object} respond.Failure @Router /api/me/stats [get]

func Tokens

func Tokens(db bun.IDB) http.HandlerFunc

Tokens lists the API tokens of the account logged in, never the tokens themselves: GET /api/me/tokens. @Summary List the API tokens of the account logged in @Tags account @Produce json @Success 200 {array} domain.APIToken @Failure 401 {object} respond.Failure @Failure 403 {object} respond.Failure @Failure 500 {object} respond.Failure @Router /api/me/tokens [get]

Types

This section is empty.

Jump to

Keyboard shortcuts

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