This repository has been archived on 2024-04-25. You can view files and clone it, but cannot push or open issues or pull requests.
golang-rest-example/pkg/api/healthz.go

16 lines
270 B
Go
Raw Normal View History

2024-02-02 14:39:13 +00:00
package api
import (
"context"
"github.com/mentos1386/golang-rest-example/pkg/openapi"
)
func (u *ApiService) HealthzGet(ctx context.Context) (*openapi.Ok, error) {
err := u.db.Ping()
if err != nil {
return nil, err
}
return &openapi.Ok{Message: "OK"}, nil
}