feat(gl): expose ledger application and grpc operations
This commit is contained in:
@@ -4,21 +4,27 @@ import (
|
||||
"context"
|
||||
|
||||
"gl/application/health"
|
||||
applicationledger "gl/application/ledger"
|
||||
basev1 "gl/gen/base/v1"
|
||||
ledgerv1 "gl/gen/ledger/v1"
|
||||
)
|
||||
|
||||
type HealthHandler struct {
|
||||
type Handler struct {
|
||||
ledgerv1.UnimplementedGeneralLedgerServiceServer
|
||||
service *health.Service
|
||||
health *health.Service
|
||||
ledger *applicationledger.Service
|
||||
}
|
||||
|
||||
func NewHealthHandler(service *health.Service) *HealthHandler {
|
||||
return &HealthHandler{service: service}
|
||||
func NewHandler(healthService *health.Service, ledgerService *applicationledger.Service) *Handler {
|
||||
return &Handler{health: healthService, ledger: ledgerService}
|
||||
}
|
||||
|
||||
func (h *HealthHandler) Health(ctx context.Context, _ *basev1.Empty) (*ledgerv1.HealthResponse, error) {
|
||||
result := h.service.Check(ctx)
|
||||
func NewHealthHandler(service *health.Service) *Handler {
|
||||
return NewHandler(service, nil)
|
||||
}
|
||||
|
||||
func (h *Handler) Health(ctx context.Context, _ *basev1.Empty) (*ledgerv1.HealthResponse, error) {
|
||||
result := h.health.Check(ctx)
|
||||
return &ledgerv1.HealthResponse{
|
||||
Serving: result.Serving,
|
||||
DatabaseReady: result.DatabaseReady,
|
||||
|
||||
Reference in New Issue
Block a user