fix: HttpHandler needs a Result struct

This commit is contained in:
Derrick Hammer 2024-01-28 04:18:32 -05:00
parent 57516a2f4a
commit 4348ff6dfe
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 18 additions and 10 deletions

View File

@ -97,7 +97,13 @@ type HttpHandlerParams struct {
Protocol *protocols.S5Protocol Protocol *protocols.S5Protocol
} }
func NewHttpHandler(params HttpHandlerParams) *HttpHandler { type HttpHandlerResult struct {
fx.Out
HttpHandler *HttpHandler
}
func NewHttpHandler(params HttpHandlerParams) (HttpHandlerResult, error) {
verifier := emailverifier.NewVerifier() verifier := emailverifier.NewVerifier()
verifier.DisableSMTPCheck() verifier.DisableSMTPCheck()
@ -105,15 +111,17 @@ func NewHttpHandler(params HttpHandlerParams) *HttpHandler {
verifier.DisableDomainSuggest() verifier.DisableDomainSuggest()
verifier.DisableAutoUpdateDisposable() verifier.DisableAutoUpdateDisposable()
return &HttpHandler{ return HttpHandlerResult{
verifier: verifier, HttpHandler: &HttpHandler{
config: params.Config, verifier: verifier,
logger: params.Logger, config: params.Config,
storage: params.Storage, logger: params.Logger,
db: params.Db, storage: params.Storage,
accounts: params.Accounts, db: params.Db,
protocol: params.Protocol, accounts: params.Accounts,
} protocol: params.Protocol,
},
}, nil
} }
func (h *HttpHandler) SmallFileUpload(jc jape.Context) { func (h *HttpHandler) SmallFileUpload(jc jape.Context) {