Documentation
¶
Overview ¶
Package main is the entry point for SFPG (Simple Fast Photo Gallery). It parses command-line options, handles special commands (--unlock-account, --increment-etag), and starts the HTTP server with graceful shutdown handling.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
gendemoimage
command
Package main provides a demo image generator for testing the SFPG gallery application.
|
Package main provides a demo image generator for testing the SFPG gallery application. |
|
internal
|
|
|
cachelite
Package cachelite provides an SQLite-backed HTTP response cache with middleware, optional asynchronous write batching, and pooled HTTPCacheEntry to reduce allocations.
|
Package cachelite provides an SQLite-backed HTTP response cache with middleware, optional asynchronous write batching, and pooled HTTPCacheEntry to reduce allocations. |
|
coords
Package coords provides functions for parsing latitude and longitude coordinates in various string formats.
|
Package coords provides functions for parsing latitude and longitude coordinates in various string formats. |
|
dbconnpool
Package dbconnpool provides a connection pool for SQLite databases using database/sql.
|
Package dbconnpool provides a connection pool for SQLite databases using database/sql. |
|
gallerydb
Package gallerydb provides the database access layer for the application.
|
Package gallerydb provides the database access layer for the application. |
|
gallerylib
Package gallerylib provides the business logic for importing and managing gallery content in the database.
|
Package gallerylib provides the business logic for importing and managing gallery content in the database. |
|
gen-test-files
Package gentestfiles provides utilities for generating test files with valid content based on their file extensions.
|
Package gentestfiles provides utilities for generating test files with valid content based on their file extensions. |
|
gensyncpool
Package gensyncpool provides a type-safe generic wrapper around sync.Pool that applies a caller-provided reset function when objects are *returned* to the pool (Put), matching conventional sync.Pool usage patterns.
|
Package gensyncpool provides a type-safe generic wrapper around sync.Pool that applies a caller-provided reset function when objects are *returned* to the pool (Put), matching conventional sync.Pool usage patterns. |
|
humanize
Package humanize provides utilities for formatting numbers into human-readable forms.
|
Package humanize provides utilities for formatting numbers into human-readable forms. |
|
log
Package log provides structured logging functionality with file and console output.
|
Package log provides structured logging functionality with file and console output. |
|
multihandler
Package multihandler provides a slog.Handler implementation that dispatches log records to multiple underlying slog.Handler instances.
|
Package multihandler provides a slog.Handler implementation that dispatches log records to multiple underlying slog.Handler instances. |
|
parallelwalkdir
Package parallelwalkdir provides utilities to traverse a directory structure in parallel, with support for symbolic links and loop detection.
|
Package parallelwalkdir provides utilities to traverse a directory structure in parallel, with support for symbolic links and loop detection. |
|
profiler
Package profiler provides profiling support for the application using github.com/pkg/profile.
|
Package profiler provides profiling support for the application using github.com/pkg/profile. |
|
queue
Package queue provides a generic, thread-safe, dynamically resizing double-ended queue (deque).
|
Package queue provides a generic, thread-safe, dynamically resizing double-ended queue (deque). |
|
scheduler
Package scheduler provides an in-memory asynchronous task scheduler with configurable concurrency limits.
|
Package scheduler provides an in-memory asynchronous task scheduler with configurable concurrency limits. |
|
server
Package server provides the core HTTP server, routing, middleware, and handlers for the web application.
|
Package server provides the core HTTP server, routing, middleware, and handlers for the web application. |
|
server/auth
Package auth provides authentication services for the application.
|
Package auth provides authentication services for the application. |
|
server/cachepreload
Package cachepreload provides cache preloading when folders are opened.
|
Package cachepreload provides cache preloading when folders are opened. |
|
server/compress
Package compress provides pure functions for content encoding negotiation and compression decision making.
|
Package compress provides pure functions for content encoding negotiation and compression decision making. |
|
server/conditional
Package conditional provides pure functions for HTTP conditional request matching.
|
Package conditional provides pure functions for HTTP conditional request matching. |
|
server/files
Package files provides file discovery, metadata extraction, and thumbnail generation for the photo gallery.
|
Package files provides file discovery, metadata extraction, and thumbnail generation for the photo gallery. |
|
server/handlers
Package handlers provides HTTP request handlers for the web application.
|
Package handlers provides HTTP request handlers for the web application. |
|
server/interfaces
Package interfaces holds shared contracts consumed by both the server orchestrator (App) and the handlers package.
|
Package interfaces holds shared contracts consumed by both the server orchestrator (App) and the handlers package. |
|
server/metrics
Package metrics provides centralized metrics collection for the dashboard.
|
Package metrics provides centralized metrics collection for the dashboard. |
|
server/pathutil
Package pathutil provides path manipulation utilities for the server package.
|
Package pathutil provides path manipulation utilities for the server package. |
|
server/restart
Package restart provides pure functions for determining server restart requirements.
|
Package restart provides pure functions for determining server restart requirements. |
|
server/security
Package security provides pure functions for security and lockout calculations.
|
Package security provides pure functions for security and lockout calculations. |
|
server/session
Package session provides session store, CSRF token handling, and session cookie options for the web application.
|
Package session provides session store, CSRF token handling, and session cookie options for the web application. |
|
server/template
Package template provides pure functions for building template data maps.
|
Package template provides pure functions for building template data maps. |
|
server/ui
Package ui provides HTML template rendering and cache version management for the application's user interface.
|
Package ui provides HTML template rendering and cache version management for the application's user interface. |
|
testutil
Package testutil provides helper functions for benchmarking the HTTP cache
|
Package testutil provides helper functions for benchmarking the HTTP cache |
|
thumbnail
Package thumbnail provides functionality for generating image thumbnails and computing image hashes (MD5, pHash).
|
Package thumbnail provides functionality for generating image thumbnails and computing image hashes (MD5, pHash). |
|
workerpool
Package workerpool provides a dynamic pool of workers that can be used to process tasks concurrently.
|
Package workerpool provides a dynamic pool of workers that can be used to process tasks concurrently. |
|
writebatcher
Package writebatcher provides a generic, transaction-batching write serializer for database operations.
|
Package writebatcher provides a generic, transaction-batching write serializer for database operations. |
|
Package migrations embeds SQL migration files into the Go binary.
|
Package migrations embeds SQL migration files into the Go binary. |
|
cmd/validate-hyperscript/main.go
|
cmd/validate-hyperscript/main.go |
|
Package web embeds static web assets and HTML templates into the Go binary.
|
Package web embeds static web assets and HTML templates into the Go binary. |
Click to show internal directories.
Click to hide internal directories.