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
|
|
|
sfpg-go-dashboard
command
Package main provides a terminal user interface (TUI) dashboard for monitoring sfpg-go server metrics in real-time.
|
Package main provides a terminal user interface (TUI) dashboard for monitoring sfpg-go server metrics in real-time. |
|
sfpg-go-dashboard/client
Package client provides HTTP client functionality for communicating with the sfpg-go server's dashboard and authentication endpoints.
|
Package client provides HTTP client functionality for communicating with the sfpg-go server's dashboard and authentication endpoints. |
|
sfpg-go-dashboard/config
Package config provides configuration parsing for the sfpg-go-dashboard TUI.
|
Package config provides configuration parsing for the sfpg-go-dashboard TUI. |
|
sfpg-go-dashboard/parser
Package parser provides HTML parsing for the sfpg-go dashboard page.
|
Package parser provides HTML parsing for the sfpg-go dashboard page. |
|
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. |
|
cachelite/bodycodec
Package bodycodec provides pluggable HTTP cache body compression codecs.
|
Package bodycodec provides pluggable HTTP cache body compression codecs. |
|
cachelite/bodycodec/gzip
Package gzip provides a bodycodec.Codec implementation using compress/gzip at compression level 6.
|
Package gzip provides a bodycodec.Codec implementation using compress/gzip at compression level 6. |
|
cachelite/bodycodec/zstd
Package zstd provides a bodycodec.Codec implementation using github.com/klauspost/compress/zstd at compression level SpeedFastest.
|
Package zstd provides a bodycodec.Codec implementation using github.com/klauspost/compress/zstd at compression level SpeedFastest. |
|
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. |
|
dque
Package dque is a fast, embedded, type-safe durable queue for Go.
|
Package dque is a fast, embedded, type-safe durable queue for Go. |
|
errors
Package errors provides a small, standard-library-compatible error wrapping package used internally by dque.
|
Package errors provides a small, standard-library-compatible error wrapping package used internally by dque. |
|
flock
Package flock is a lightweight, standard-library-only replacement for github.com/gofrs/flock tailored to the needs of dque.
|
Package flock is a lightweight, standard-library-only replacement for github.com/gofrs/flock tailored to the needs of dque. |
|
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. |
|
getopt
Package getopt parses runtime configuration from environment variables and command-line flags.
|
Package getopt parses runtime configuration from environment variables and command-line flags. |
|
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/cachebatch
Package cachebatch provides batch cache loading with bounded concurrency.
|
Package cachebatch provides batch cache loading with bounded concurrency. |
|
server/cachepreload
Package cachepreload provides cache preloading when folders are opened.
|
Package cachepreload provides cache preloading when folders are opened. |
|
server/conditional
Package conditional provides pure functions for HTTP conditional request matching.
|
Package conditional provides pure functions for HTTP conditional request matching. |
|
server/config
Package config provides configuration loading, validation, persistence, and application for the server.
|
Package config provides configuration loading, validation, persistence, and application for the server. |
|
server/database
Package database wires SQLite connection pools and database lifecycle for the server.
|
Package database wires SQLite connection pools and database lifecycle for the server. |
|
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/logging
Package logging configures structured logging for the server application.
|
Package logging configures structured logging for the server application. |
|
server/metrics
Package metrics provides centralized metrics collection for the dashboard.
|
Package metrics provides centralized metrics collection for the dashboard. |
|
server/middleware
Package middleware provides HTTP middleware for the server (auth, COP, logging).
|
Package middleware provides HTTP middleware for the server (auth, COP, logging). |
|
server/modulestate
Package modulestate tracks active/inactive state for server subsystems.
|
Package modulestate tracks active/inactive state for server subsystems. |
|
server/pathutil
Package pathutil provides path manipulation utilities for the server package.
|
Package pathutil provides path manipulation utilities for the server package. |
|
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, session cookie options, and authentication helpers for the web application.
|
Package session provides session store, session cookie options, and authentication helpers 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. |
|
server/validation
Package validation provides configuration and input validation helpers.
|
Package validation provides configuration and input validation helpers. |
|
testutil
Package testutil provides shared test helpers for HTML parsing and assertions.
|
Package testutil provides shared test helpers for HTML parsing and assertions. |
|
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. |
|
scripts
|
|
|
validate-html-test-assertions
command
Command validate-html-test-assertions detects forbidden HTML assertion patterns in *_test.go files using go/ast.
|
Command validate-html-test-assertions detects forbidden HTML assertion patterns in *_test.go files using go/ast. |
|
validate-hyperscript
command
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.