cleanup
This commit is contained in:
+1
-2
@@ -15,7 +15,6 @@ import (
|
|||||||
"abuse_registration_poc/internal/store"
|
"abuse_registration_poc/internal/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Version is injected by Taskfile through -ldflags.
|
|
||||||
var Version = "dev"
|
var Version = "dev"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -60,7 +59,7 @@ func main() {
|
|||||||
ReadHeaderTimeout: 5 * time.Second,
|
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)
|
time.Sleep(100 * time.Millisecond)
|
||||||
if err := server.ListenAndServe(); err != nil {
|
if err := server.ListenAndServe(); err != nil {
|
||||||
log.Fatalf("ERROR: Failed to start server: %v", err)
|
log.Fatalf("ERROR: Failed to start server: %v", err)
|
||||||
|
|||||||
@@ -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.
|
|
||||||
@@ -14,8 +14,6 @@ const (
|
|||||||
DefaultDatasetSize = 546
|
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
|
var ApiKey = DefaultJWTSecret
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ var AbuseCategories = []string{
|
|||||||
var Genders = []string{"female", "male", "non_binary", "unknown"}
|
var Genders = []string{"female", "male", "non_binary", "unknown"}
|
||||||
var Statuses = []string{"new", "open", "referred", "closed"}
|
var Statuses = []string{"new", "open", "referred", "closed"}
|
||||||
|
|
||||||
// FaroeLocations is the fixed set of accepted location values for this POC.
|
|
||||||
var FaroeLocations = []string{
|
var FaroeLocations = []string{
|
||||||
"Akrar", "Argir", "Ánirnar", "Árnafjørður", "Bøur", "Dalur", "Depil", "Eiði",
|
"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",
|
"Elduvík", "Fámjin", "Froðba", "Fuglafjørður", "Funningsfjørður", "Funningur",
|
||||||
|
|||||||
@@ -5,15 +5,9 @@ import (
|
|||||||
"io/fs"
|
"io/fs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Templates contains all server-rendered HTML templates.
|
|
||||||
//
|
|
||||||
//go:embed templates/index.html
|
//go:embed templates/index.html
|
||||||
var Templates embed.FS
|
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
|
//go:embed static/* static/css/* static/js/* favicon.ico
|
||||||
var Assets embed.FS
|
var Assets embed.FS
|
||||||
|
|
||||||
|
|||||||
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user