Instead of creating an instance get it as an argument.
This commit is contained in:
parent
f8a8d948a4
commit
6ce598d193
@ -13,7 +13,6 @@ import (
|
||||
"git.arav.su/Arav/dwelling-home/web"
|
||||
"git.arav.su/Arav/justcaptcha/pkg/captcha/inmemdb"
|
||||
"git.arav.su/Arav/justcaptcha/pkg/dwcaptcha"
|
||||
gbsqlite "git.arav.su/Arav/justguestbook/database/sqlite"
|
||||
"git.arav.su/Arav/justguestbook/guestbook"
|
||||
)
|
||||
|
||||
@ -24,16 +23,9 @@ type Handlers struct {
|
||||
guestbookPageSize int64
|
||||
}
|
||||
|
||||
func NewHandlers(captchaExpire time.Duration, dbPath, gbOwner string, gbPageSize int64) *Handlers {
|
||||
gbdb, err := gbsqlite.New(dbPath + "/guestbook.sqlite")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
inmemdb.SetExpiry(captchaExpire)
|
||||
|
||||
func NewHandlers(captchaExpire time.Duration, gbOwner string, gbPageSize int64, db guestbook.Guestbook) *Handlers {
|
||||
return &Handlers{
|
||||
guestbookDB: gbdb,
|
||||
guestbookDB: db,
|
||||
captchaExpire: captchaExpire,
|
||||
guestbookOwner: gbOwner,
|
||||
guestbookPageSize: gbPageSize}
|
||||
|
Loading…
Reference in New Issue
Block a user