feat(gl): expose ledger application and grpc operations

This commit is contained in:
2026-08-14 19:11:29 +03:30
parent 0b3eaa0c3d
commit 76905ab451
17 changed files with 1724 additions and 16 deletions
+12 -6
View File
@@ -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,