api

package
v1.10.0 Latest Latest
Warning

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

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

Overview

Package api is the HTTP API: one folder per route, each calling the same processes as the CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(db bun.IDB, store silo.Store, origin, addUserMode string) http.Handler

New gives the API, reachable by web pages from origin only (none when empty), and by logged-in accounts only. The images of the notes are in store. addUserMode is how accounts are created, one of domain.AddUserModes.

Types

This section is empty.

Directories

Path Synopsis
Package readsearch is the API route running a saved search.
Package readsearch is the API route running a saved search.
services
auth
Package auth lets through the requests of a logged-in account only, and tells the routes which one.
Package auth lets through the requests of a logged-in account only, and tells the routes which one.
compress
Package compress sends the big JSON answers of the API as gzip: on Tailscale from a phone, weight costs more than the server's time.
Package compress sends the big JSON answers of the API as gzip: on Tailscale from a phone, weight costs more than the server's time.
guard
Package guard keeps the web pages of other sites away from the API: they could use the session cookie.
Package guard keeps the web pages of other sites away from the API: they could use the session cookie.
plan
Package plan refuses the routes of a paid feature to the accounts whose plan lacks it.
Package plan refuses the routes of a paid feature to the accounts whose plan lacks it.
respond
Package respond is what every route shares: reading the request, writing JSON, turning process errors into statuses.
Package respond is what every route shares: reading the request, writing JSON, turning process errors into statuses.
throttle
Package throttle makes a key wait longer after each try in a row: wrong passwords at the login and on the OAuth consent page, accounts created from one address at the sign-up.
Package throttle makes a key wait longer after each try in a row: wrong passwords at the login and on the OAuth consent page, accounts created from one address at the sign-up.
Package users is the account routes an admin uses, and the self-service sign-up: the rest of an account's own routes are in login/.
Package users is the account routes an admin uses, and the self-service sign-up: the rest of an account's own routes are in login/.

Jump to

Keyboard shortcuts

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