29 lines
612 B
Go
29 lines
612 B
Go
package initialize
|
|
|
|
import (
|
|
"context"
|
|
"github.com/minio/minio-go/v7"
|
|
"go.mongodb.org/mongo-driver/mongo"
|
|
"go.uber.org/zap"
|
|
"penahub.gitlab.yandexcloud.net/backend/verification/internal/repository"
|
|
)
|
|
|
|
type Repositories struct {
|
|
Verification *repository.VerificationRepository
|
|
}
|
|
|
|
func NewRepositories(
|
|
ctx context.Context,
|
|
logger *zap.Logger,
|
|
mongoDB *mongo.Database,
|
|
s3 *minio.Client) (*Repositories, error) {
|
|
reps := &Repositories{Verification: repository.NewVerificationRepository(logger, mongoDB, s3)}
|
|
|
|
err := reps.Verification.Init(ctx)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return reps, nil
|
|
}
|