treasurer/internal/initialize/workers.go

32 lines
594 B
Go
Raw Normal View History

2023-06-19 19:39:34 +00:00
package initialize
import (
2024-12-16 13:47:40 +00:00
"gitea.pena/PenaSide/treasurer/internal/errors"
2025-06-12 08:59:43 +00:00
svc_mock "gitea.pena/PenaSide/treasurer/internal/service/mock"
2024-12-16 13:47:40 +00:00
"gitea.pena/PenaSide/treasurer/internal/worker/mock"
2025-06-12 08:59:43 +00:00
"go.uber.org/zap"
2023-06-19 19:39:34 +00:00
)
type WorkersDeps struct {
2025-06-12 08:59:43 +00:00
Logger *zap.Logger
Service *svc_mock.Service
2023-06-19 19:39:34 +00:00
}
type Workers struct {
Mock *mock.Worker
}
func NewWorkers(deps WorkersDeps) (*Workers, errors.Error) {
mockWorker, err := mock.New(mock.WorkerDeps{
Logger: deps.Logger,
2025-06-12 08:59:43 +00:00
MockService: deps.Service,
2023-06-19 19:39:34 +00:00
})
if err != nil {
return nil, err
}
return &Workers{
Mock: mockWorker,
}, nil
}