handler

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: MIT-0 Imports: 32 Imported by: 0 modules, 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 handler serves the application's embedded pages and assets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Healthz

func Healthz(log *slog.Logger, ping func(context.Context) error) http.Handler

Healthz checks readiness with a two-second deadline. The check must honor cancellation; a missing check reports unavailable.

func New

func New(cfg config.Config, log *slog.Logger, accounts *store.Store, ping func(context.Context) error, opts ...Option) (http.Handler, []string, error)

New builds the HTTP stack and reports the registered protected route patterns.

Types

type Option

type Option func(*site)

Option supplies a collaborator for the admin page.

func WithBackups

func WithBackups(newest func() (time.Time, bool, error)) Option

WithBackups sets the lookup behind the admin page's newest-backup line. Omit it when backups are disabled.

func WithJobs added in v0.3.0

func WithJobs(queue *jobs.Queue, delivering bool) Option

WithJobs supplies the queue and whether its mail transport delivers messages.

func WithoutBackups

func WithoutBackups(note string) Option

WithoutBackups sets the line the admin page shows when the application makes no backups itself. The database variant words it, because "turned off" is true for one and misleading for the other. Without it the page says so plainly.

Jump to

Keyboard shortcuts

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