feedback/internal/initialize/repositories.go
2023-04-20 07:03:21 +05:00

21 lines
473 B
Go

package initialize
import (
"go.etcd.io/bbolt"
"go.uber.org/zap"
"penahub.gitlab.yandexcloud.net/backend/templategen_feedback/internal/repository"
)
type Repositories struct {
Feedback *repository.FeedbackRepository
}
func NewRepositories(logger *zap.Logger, db *bbolt.DB) (*Repositories, error) {
feedback := repository.NewFeedback(logger, db)
if err := feedback.CreateBucket(); err != nil {
return nil, err
}
return &Repositories{Feedback: feedback}, nil
}