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