sessions/internal/bundb/checker.go

24 lines
309 B
Go
Raw Normal View History

2022-11-17 05:57:04 +00:00
package bundb
import (
"context"
"github.com/uptrace/bun"
)
type Checker struct {
db *bun.DB
}
func NewChecker(db *bun.DB) *Checker {
return &Checker{db: db}
}
func (c *Checker) Name() string {
return "db:ping"
}
func (c *Checker) Check(ctx context.Context) error {
return c.db.PingContext(ctx)
}