This commit is contained in:
Bartal Læarsson
2026-06-25 12:42:23 +01:00
parent d97576f41c
commit aa3ef18f1a
6 changed files with 1 additions and 35 deletions
+1 -2
View File
@@ -15,7 +15,6 @@ import (
"abuse_registration_poc/internal/store"
)
// Version is injected by Taskfile through -ldflags.
var Version = "dev"
func main() {
@@ -60,7 +59,7 @@ func main() {
ReadHeaderTimeout: 5 * time.Second,
}
log.Printf("starting Abuse Registration POC on port %s", cfg.API.Port)
log.Printf("starting go api on port %s", cfg.API.Port)
time.Sleep(100 * time.Millisecond)
if err := server.ListenAndServe(); err != nil {
log.Fatalf("ERROR: Failed to start server: %v", err)
-24
View File
@@ -1,24 +0,0 @@
# Data model
This POC intentionally uses a very small anonymous registration object.
```json
{
"id": "bb8d39a6-8fef-48af-9f9c-27a41c8f8baf",
"registered_at": "1989-04-13T15:22:00Z",
"gender": "female",
"location": "Tórshavn",
"abuse_type": "psychological",
"status": "new"
}
```
Notes:
- `id` is a UUID string generated by the server.
- There is no name field.
- `registered_at` defaults to `time.Now().UTC()` when omitted on create or update.
- Base synthetic data uses dates from 1988 through 1991.
- Data resets to 546 base rows every 10 minutes.
- `location` must be one of the fixed Faroese towns/villages in `internal/models/registration.go`.
- `PUT /api/v1/registrations/{uuid}` is used for update. There is no `PATCH` endpoint.
-2
View File
@@ -14,8 +14,6 @@ const (
DefaultDatasetSize = 546
)
// ApiKey mirrors the original API's JWT utility style: utils.GenerateToken and
// utils.VerifyToken read the signing secret from config.
var ApiKey = DefaultJWTSecret
type Config struct {
-1
View File
@@ -26,7 +26,6 @@ var AbuseCategories = []string{
var Genders = []string{"female", "male", "non_binary", "unknown"}
var Statuses = []string{"new", "open", "referred", "closed"}
// FaroeLocations is the fixed set of accepted location values for this POC.
var FaroeLocations = []string{
"Akrar", "Argir", "Ánirnar", "Árnafjørður", "Bøur", "Dalur", "Depil", "Eiði",
"Elduvík", "Fámjin", "Froðba", "Fuglafjørður", "Funningsfjørður", "Funningur",
-6
View File
@@ -5,15 +5,9 @@ import (
"io/fs"
)
// Templates contains all server-rendered HTML templates.
//
//go:embed templates/index.html
var Templates embed.FS
// Assets contains every browser asset needed by the POC page.
// The production binary serves these files from memory, so the server does not
// depend on a static/ directory beside the executable.
//
//go:embed static/* static/css/* static/js/* favicon.ico
var Assets embed.FS
BIN
View File
Binary file not shown.