customer/internal/interface/repository/health.go

20 lines
379 B
Go
Raw Normal View History

2023-05-16 01:12:07 +00:00
package repository
import (
"context"
"go.mongodb.org/mongo-driver/mongo"
)
type HealthRepository struct {
2023-05-19 04:50:40 +00:00
MongoDB *mongo.Database
2023-05-16 01:12:07 +00:00
}
func NewHealthRepository(database *mongo.Database) *HealthRepository {
2023-05-19 04:50:40 +00:00
return &HealthRepository{MongoDB: database}
2023-05-16 01:12:07 +00:00
}
func (receiver *HealthRepository) Check(ctx context.Context) error {
2023-05-19 04:50:40 +00:00
return receiver.MongoDB.Client().Ping(ctx, nil)
2023-05-16 01:12:07 +00:00
}