Files
at-container-registry/pkg/appview/handlers/base.go
T

45 lines
1.2 KiB
Go

package handlers
import (
"database/sql"
"html/template"
"atcr.io/pkg/appview/db"
"atcr.io/pkg/appview/holdhealth"
"atcr.io/pkg/appview/readme"
"atcr.io/pkg/auth/oauth"
"github.com/bluesky-social/indigo/atproto/identity"
)
// BaseUIHandler contains all dependencies for UI handlers.
// Handlers embed this and use whatever fields they need.
// Route registration becomes simply &Handler{base} for everything.
type BaseUIHandler struct {
// Display
Templates *template.Template
RegistryURL string // Docker registry domain (e.g., "buoy.cr" or "atcr.io")
SiteURL string // Website domain (e.g., "seamark.dev" or "atcr.io")
// Database (handlers choose which to use)
DB *sql.DB // Write access
ReadOnlyDB *sql.DB // Read-only access
// Services
Refresher *oauth.Refresher
HealthChecker *holdhealth.Checker
ReadmeFetcher *readme.Fetcher
Directory identity.Directory
// Stores
SessionStore *db.SessionStore
DeviceStore *db.DeviceStore
OAuthStore *db.OAuthStore
// Config
DefaultHoldDID string
CompanyName string
Jurisdiction string
ClientName string // Full name: "AT Container Registry"
ClientShortName string // Short name: "ATCR"
}