build: add makefile, dockerfile, ci and development stack
- build: add makefile, dockerfile, ci and development stack - feat(config): add environment configuration and logger - feat(server): add server lifecycle with health and version routes - feat(db): add connection, contract check, migrations and stores - feat(cli): add command dispatch and user management - test(db): add integration tests against mysql
This commit is contained in:
1 parent
45d1e307c6
commit
7089a6f408
46 files changed
+8456
No files matched your search
@@ -0,0 +1,48 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
// Copyright (C) 2026 Bryan Joshua Pedini
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"errors"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type recordRow struct {
|
||||
ID int64
|
||||
Zone string
|
||||
Name string
|
||||
TTL sql.NullInt64
|
||||
Content sql.NullString
|
||||
RecordType string
|
||||
}
|
||||
|
||||
type auditEntry struct {
|
||||
ID int64
|
||||
Time time.Time
|
||||
UserID sql.NullInt64
|
||||
Actor string
|
||||
Origin string
|
||||
Operation string
|
||||
Status sql.NullInt64
|
||||
Error sql.NullString
|
||||
Zone sql.NullString
|
||||
RecordID sql.NullInt64
|
||||
TargetUserID sql.NullInt64
|
||||
Before []byte
|
||||
After []byte
|
||||
}
|
||||
|
||||
func stubHashPassword(password string) (string, error) {
|
||||
return "", errors.New("password hashing is not available")
|
||||
}
|
||||
|
||||
func stubNormalizeZone(zone string) (string, error) {
|
||||
zone = strings.ToLower(strings.TrimSuffix(zone, "."))
|
||||
if zone == "" {
|
||||
return "", errors.New("invalid zone")
|
||||
}
|
||||
return zone + ".", nil
|
||||
}
|
||||
Reference in new issue
Block a user