api

package
v0.0.0-...-4d14c86 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 45 Imported by: 0

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, 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, 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
⌂ 换网址