Skip to content
Snippets Groups Projects
Commit 5823fdf5 authored by Lyuben Penkovski's avatar Lyuben Penkovski
Browse files

Merge branch '1-service-skeleton' into 'main'

Initial service skeleton with health check endpoints

Closes #1

See merge request !1
parents 6fc6021a 85fa0d26
No related branches found
No related tags found
1 merge request!1Initial service skeleton with health check endpoints
Pipeline #51216 passed with stage
in 39 seconds
Showing
with 56 additions and 0 deletions
package service
import (
goahttp "goa.design/goa/v3/http"
goa "goa.design/goa/v3/pkg"
"code.vereign.com/gaiax/tsa/golib/errors"
)
func NewErrorResponse(err error) goahttp.Statuser {
if err == nil {
return nil
}
var newerr *errors.Error
switch e := err.(type) {
case *errors.Error:
newerr = e
case *goa.ServiceError:
// Use goahttp.ErrorResponse to determine error kind
goaerr := goahttp.NewErrorResponse(e)
kind := errors.GetKind(goaerr.StatusCode())
newerr = &errors.Error{
ID: e.ID,
Kind: kind,
Message: e.Message,
Err: e,
}
default:
newerr = &errors.Error{
ID: errors.NewID(),
Kind: errors.Internal,
Message: e.Error(),
Err: e,
}
}
return newerr
}
package health
import "context"
type Service struct{}
func New() *Service {
return &Service{}
}
func (s *Service) Liveness(ctx context.Context) error {
return nil
}
func (s *Service) Readiness(ctx context.Context) error {
return nil
}
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment