Refactor things

- Remove separate auth/logging and merge them into transport.go
- Add helper function for http handlers
This commit is contained in:
r 2020-11-22 17:29:58 +00:00
parent 37b1c75045
commit fa27d9c6eb
11 changed files with 547 additions and 1664 deletions

View file

@ -3,15 +3,15 @@ package repo
import (
"encoding/json"
"bloat/kv"
"bloat/util"
"bloat/model"
)
type appRepo struct {
db *kv.Database
db *util.Database
}
func NewAppRepo(db *kv.Database) *appRepo {
func NewAppRepo(db *util.Database) *appRepo {
return &appRepo{
db: db,
}

View file

@ -3,15 +3,15 @@ package repo
import (
"encoding/json"
"bloat/kv"
"bloat/util"
"bloat/model"
)
type sessionRepo struct {
db *kv.Database
db *util.Database
}
func NewSessionRepo(db *kv.Database) *sessionRepo {
func NewSessionRepo(db *util.Database) *sessionRepo {
return &sessionRepo{
db: db,
}