Versions in this module Expand all Collapse all v0 v0.1.0 Feb 23, 2026 Changes in this version + func ConnectDB(cfg Config) (*pgxpool.Pool, error) + func Transaction(ctx context.Context, pool *pgxpool.Pool, fn TransactionFunc) error + func TransactionWithJobs(ctx context.Context, pool *pgxpool.Pool, client *river.Client[pgx.Tx], ...) error + type App struct + func New(cfg Config) *App + func (a *App) Listen(addr string) error + func (a *App) Pool() *pgxpool.Pool + func (a *App) RegisterAPIRoutes(fn func(huma.API)) *App + func (a *App) RegisterHTMLRoutes(fn func(chi.Router)) *App + func (a *App) RegisterPublicRoutes(fn func(chi.Router)) *App + func (a *App) RequireAuth() *App + func (a *App) UseAPIKeyStore(ks auth.APIKeyStore) *App + func (a *App) UseOAuth(cfg auth.OAuthConfig, findOrCreateUser auth.UserFinder) *App + func (a *App) UsePasswordAuth(authenticateUser auth.PasswordAuthenticator) *App + func (a *App) UsePool(pool *pgxpool.Pool) *App + func (a *App) UseRecovery(mw func(http.Handler) http.Handler) *App + func (a *App) UseTokenStore(ts auth.TokenStore) *App + type Config struct + func LoadConfig(path string) (Config, error) + func (c Config) DatabaseURL() string + func (c Config) ServerAddr() string + type DB interface + Exec func(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error) + Query func(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error) + QueryRow func(ctx context.Context, sql string, args ...interface{}) pgx.Row + type Error struct + Code string + Detail string + Err error + Message string + Status int + func BadRequest(message string) *Error + func Forbidden(message string) *Error + func ForeignKeyViolation(field string) *Error + func InternalError(err error) *Error + func NewValidationError(errs interface{}) *Error + func NotFound(resource string, id any) *Error + func Unauthorized(message string) *Error + func UniqueViolation(field string) *Error + func (e *Error) Error() string + func (e *Error) GetStatus() int + func (e *Error) Unwrap() error + type TransactionFunc func(ctx context.Context, tx pgx.Tx) error