add in-memory DB for accounts, with tests!
This commit is contained in:
parent
49e14b5bc5
commit
5a540184c9
9 changed files with 534 additions and 45 deletions
10
main.go
10
main.go
|
|
@ -41,13 +41,13 @@ const DB_VERSION = 1
|
|||
|
||||
const DEFAULT_PORT int64 = 8080
|
||||
const HRT_DATE int64 = 1756478697
|
||||
const DEFAULT_LOG_FLAGS = log.Ldate | log.Ltime | log.Lmicroseconds
|
||||
|
||||
//go:embed "public"
|
||||
var publicFS embed.FS
|
||||
|
||||
func main() {
|
||||
logger := log.New(os.Stderr, "main", DEFAULT_LOG_FLAGS)
|
||||
// TODO: switch to a new logger. this one kinda sucks
|
||||
logger := log.New(os.Stderr, "main", model.DEFAULT_LOG_FLAGS)
|
||||
|
||||
logger.Print("made with <3 by ari melody\n\n")
|
||||
|
||||
|
|
@ -94,13 +94,13 @@ func main() {
|
|||
logRepo := logRepo.NewLogRepositoryPostgres(psqlDB)
|
||||
app.Log = logService.NewLogService(
|
||||
logRepo,
|
||||
log.New(os.Stderr, "logger", DEFAULT_LOG_FLAGS),
|
||||
log.New(os.Stderr, "logger", model.DEFAULT_LOG_FLAGS),
|
||||
)
|
||||
|
||||
accountRepo := accountRepo.NewAccountRepositoryPostgres(psqlDB)
|
||||
app.AccountService = accountService.NewAccountService(
|
||||
accountRepo,
|
||||
log.New(os.Stderr, "account-repo", DEFAULT_LOG_FLAGS),
|
||||
log.New(os.Stderr, "account-repo", model.DEFAULT_LOG_FLAGS),
|
||||
)
|
||||
|
||||
// handle command arguments
|
||||
|
|
@ -494,7 +494,7 @@ func main() {
|
|||
|
||||
go cursor.StartCursor(&app)
|
||||
|
||||
httpLogger := log.New(os.Stderr, "http", DEFAULT_LOG_FLAGS)
|
||||
httpLogger := log.New(os.Stderr, "http", model.DEFAULT_LOG_FLAGS)
|
||||
|
||||
// start the web server!
|
||||
mux := createServeMux(&app)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue