initial commit from original sev version

This commit is contained in:
Bartal Læarsson
2026-06-25 12:03:26 +01:00
commit 9c157cc5a0
31 changed files with 468875 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
package handlers
import (
"html/template"
"abuse_registration_poc/internal/auth"
"abuse_registration_poc/internal/store"
"abuse_registration_poc/internal/web"
)
type Dependencies struct {
Store *store.MemoryStore
Users *auth.UserStore
Version string
AppName string
BaseURL string
}
type Handler struct {
store *store.MemoryStore
users *auth.UserStore
index *template.Template
version string
appName string
baseURL string
}
func New(deps Dependencies) (*Handler, error) {
index, err := template.ParseFS(web.Templates, "templates/index.html")
if err != nil {
return nil, err
}
return &Handler{
store: deps.Store,
users: deps.Users,
index: index,
version: deps.Version,
appName: deps.AppName,
baseURL: deps.BaseURL,
}, nil
}