generated from PenaSide/GolangTemplate
20 lines
379 B
Go
20 lines
379 B
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
|
|
"go.mongodb.org/mongo-driver/mongo"
|
|
)
|
|
|
|
type HealthRepository struct {
|
|
MongoDB *mongo.Database
|
|
}
|
|
|
|
func NewHealthRepository(database *mongo.Database) *HealthRepository {
|
|
return &HealthRepository{MongoDB: database}
|
|
}
|
|
|
|
func (receiver *HealthRepository) Check(ctx context.Context) error {
|
|
return receiver.MongoDB.Client().Ping(ctx, nil)
|
|
}
|