unified gateway interfaces

This commit is contained in:
Stephan D
2026-01-04 12:47:43 +01:00
parent 743f683d92
commit 59c83e414a
41 changed files with 927 additions and 186 deletions

View File

@@ -24,6 +24,7 @@ import (
pmessaging "github.com/tech/sendico/pkg/messaging"
"github.com/tech/sendico/pkg/mlogger"
"github.com/tech/sendico/pkg/mservice"
unifiedv1 "github.com/tech/sendico/pkg/proto/gateway/unified/v1"
ledgerv1 "github.com/tech/sendico/pkg/proto/ledger/v1"
)
@@ -49,7 +50,7 @@ type Service struct {
cancel context.CancelFunc
publisher *outboxPublisher
}
ledgerv1.UnimplementedLedgerServiceServer
unifiedv1.UnimplementedUnifiedGatewayServiceServer
}
type feesDependency struct {
@@ -82,7 +83,7 @@ func NewService(logger mlogger.Logger, repo storage.Repository, prod pmessaging.
func (s *Service) Register(router routers.GRPC) error {
return router.Register(func(reg grpc.ServiceRegistrar) {
ledgerv1.RegisterLedgerServiceServer(reg, s)
unifiedv1.RegisterUnifiedGatewayServiceServer(reg, s)
})
}
@@ -204,6 +205,7 @@ func (s *Service) startDiscoveryAnnouncer() {
announce := discovery.Announcement{
Service: "LEDGER",
Operations: []string{"balance.read", "ledger.debit", "ledger.credit"},
InvokeURI: discovery.DefaultInvokeURI(string(mservice.Ledger)),
Version: appversion.Create().Short(),
}
s.announcer = discovery.NewAnnouncer(s.logger, s.producer, string(mservice.Ledger), announce)