service

package
v0.0.0-...-9727936 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package service holds the errors every service returns. The services themselves live in pkg/service/<area>; see docs/architecture.md.

Transports map these errors to responses in one place each: gogo ginhelpers.Status for HTML and API pages, actionMessage in pkg/web/app for JSON actions.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound: the thing doesn't exist, or the actor may not know it
	// exists. Visibility failures on reads return this, not ErrForbidden.
	ErrNotFound = apperr.ErrNotFound
	// ErrForbidden: the actor can see the thing but may not do this to it.
	ErrForbidden = apperr.ErrForbidden
	// ErrNeedsLogin: an anonymous actor would be allowed after logging in.
	ErrNeedsLogin = apperr.ErrNeedsLogin
	// ErrConflict: the change collides with existing state (a taken
	// username, a duplicate invitation). Wrap it with the reason:
	// fmt.Errorf("%w: username is taken", service.ErrConflict).
	ErrConflict = apperr.ErrConflict
)

Functions

func Invalid

func Invalid(field, message string) error

Invalid returns a ValidationError for field.

Types

type ValidationError

type ValidationError = apperr.ValidationError

ValidationError rejects an input. Message is shown to the user as is, so it reads as a sentence. Field names the input field, or is empty when the error is about the input as a whole.

Directories

Path Synopsis
Package accounts holds everything about who a user is and how they get in: signup, the waiting list, invitations, login credentials, passwords, the settings page, user styles, API keys, feed tokens and the registration switch.
Package accounts holds everything about who a user is and how they get in: signup, the waiting list, invitations, login credentials, passwords, the settings page, user styles, API keys, feed tokens and the registration switch.
Package connections manages who is connected to whom: whitelist grants (people allowed to connect without mediation), connections themselves and mediation requests, where common connections vouch for a stranger.
Package connections manages who is connected to whom: whitelist grants (people allowed to connect without mediation), connections themselves and mediation requests, where common connections vouch for a stranger.
Package feeds manages RSS subscriptions: what a user follows, the items the poller delivers to them, and dismissing an item.
Package feeds manages RSS subscriptions: what a user follows, the items the poller delivers to them, and dismissing an item.
Package graph answers how two users are connected.
Package graph answers how two users are connected.
Package media handles media uploads.
Package media handles media uploads.
Package posts is everything users do with posts: write, edit, autosave, publish and delete them, comment on them, prompt others to write, export and import a blog, and the API v1 that does the same for scripts.
Package posts is everything users do with posts: write, edit, autosave, publish and delete them, comment on them, prompt others to write, export and import a blog, and the API v1 that does the same for scripts.
Package reading decides who may read what: a single post with its comments, a user's journal, the explore page, the feed and the RSS feeds built from them.
Package reading decides who may read what: a single post with its comments, a user's journal, the explore page, the feed and the RSS feeds built from them.
Package registry builds every service over one store.
Package registry builds every service over one store.
Package shares manages share links: a secret URL that shows one published post to anybody who has it, logged in or not.
Package shares manages share links: a secret URL that shows one published post to anybody who has it, logged in or not.

Jump to

Keyboard shortcuts

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