Phase 2 service decomposition per docs/SCALE-EXPANSION.md section 1: extracts
internal/{airwallex,bridge,card,tenant,httpserver} out of the monolithic
gateway into four independently deployable gRPC services (each own go.mod,
Dockerfile, and tests), with gateway now a thin BFF that fans out through new
cardissuanceclient/webhookeventsclient gRPC clients. gateway.proto's external
surface is unchanged — agent/tui/cli still talk to gateway exactly as before.
Verified: all 10 go.work modules build and `go test ./...` passes across
every one, including the new gateway client packages against the live split
services (via `make build && make test`).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
219 lines
8.9 KiB
Go
219 lines
8.9 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.2
|
|
// - protoc v6.33.4
|
|
// source: tenant_registry.proto
|
|
|
|
package tenantregistry
|
|
|
|
import (
|
|
context "context"
|
|
ledger "github.com/caelum0x/ration/pkg/pb/ledger"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
TenantRegistry_CreateTenant_FullMethodName = "/ration.tenantregistry.v1.TenantRegistry/CreateTenant"
|
|
TenantRegistry_GetTenant_FullMethodName = "/ration.tenantregistry.v1.TenantRegistry/GetTenant"
|
|
TenantRegistry_ListTenants_FullMethodName = "/ration.tenantregistry.v1.TenantRegistry/ListTenants"
|
|
)
|
|
|
|
// TenantRegistryClient is the client API for TenantRegistry service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
//
|
|
// TenantRegistry is an internal-only service (docs/SCALE-EXPANSION.md
|
|
// section 1): tenant CRUD. It owns no state of its own — every
|
|
// operation proxies to LedgerCore, which remains the one authoritative
|
|
// store for tenant records (docs/ARCHITECTURE.md) — this is a thin
|
|
// service by design (docs/adr/0004), split out purely so tenant CRUD's
|
|
// low, bursty-on-onboarding traffic and deploy cadence never forces a
|
|
// redeploy of card-issuance. Reuses ledger.proto's Tenant message
|
|
// directly rather than defining a parallel one, since this service adds
|
|
// no fields ledger-core doesn't already own.
|
|
type TenantRegistryClient interface {
|
|
CreateTenant(ctx context.Context, in *CreateTenantRequest, opts ...grpc.CallOption) (*ledger.Tenant, error)
|
|
GetTenant(ctx context.Context, in *GetTenantRequest, opts ...grpc.CallOption) (*ledger.Tenant, error)
|
|
ListTenants(ctx context.Context, in *ListTenantsRequest, opts ...grpc.CallOption) (*ListTenantsResponse, error)
|
|
}
|
|
|
|
type tenantRegistryClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewTenantRegistryClient(cc grpc.ClientConnInterface) TenantRegistryClient {
|
|
return &tenantRegistryClient{cc}
|
|
}
|
|
|
|
func (c *tenantRegistryClient) CreateTenant(ctx context.Context, in *CreateTenantRequest, opts ...grpc.CallOption) (*ledger.Tenant, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ledger.Tenant)
|
|
err := c.cc.Invoke(ctx, TenantRegistry_CreateTenant_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tenantRegistryClient) GetTenant(ctx context.Context, in *GetTenantRequest, opts ...grpc.CallOption) (*ledger.Tenant, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ledger.Tenant)
|
|
err := c.cc.Invoke(ctx, TenantRegistry_GetTenant_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tenantRegistryClient) ListTenants(ctx context.Context, in *ListTenantsRequest, opts ...grpc.CallOption) (*ListTenantsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListTenantsResponse)
|
|
err := c.cc.Invoke(ctx, TenantRegistry_ListTenants_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// TenantRegistryServer is the server API for TenantRegistry service.
|
|
// All implementations must embed UnimplementedTenantRegistryServer
|
|
// for forward compatibility.
|
|
//
|
|
// TenantRegistry is an internal-only service (docs/SCALE-EXPANSION.md
|
|
// section 1): tenant CRUD. It owns no state of its own — every
|
|
// operation proxies to LedgerCore, which remains the one authoritative
|
|
// store for tenant records (docs/ARCHITECTURE.md) — this is a thin
|
|
// service by design (docs/adr/0004), split out purely so tenant CRUD's
|
|
// low, bursty-on-onboarding traffic and deploy cadence never forces a
|
|
// redeploy of card-issuance. Reuses ledger.proto's Tenant message
|
|
// directly rather than defining a parallel one, since this service adds
|
|
// no fields ledger-core doesn't already own.
|
|
type TenantRegistryServer interface {
|
|
CreateTenant(context.Context, *CreateTenantRequest) (*ledger.Tenant, error)
|
|
GetTenant(context.Context, *GetTenantRequest) (*ledger.Tenant, error)
|
|
ListTenants(context.Context, *ListTenantsRequest) (*ListTenantsResponse, error)
|
|
mustEmbedUnimplementedTenantRegistryServer()
|
|
}
|
|
|
|
// UnimplementedTenantRegistryServer must be embedded to have
|
|
// forward compatible implementations.
|
|
//
|
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
// pointer dereference when methods are called.
|
|
type UnimplementedTenantRegistryServer struct{}
|
|
|
|
func (UnimplementedTenantRegistryServer) CreateTenant(context.Context, *CreateTenantRequest) (*ledger.Tenant, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method CreateTenant not implemented")
|
|
}
|
|
func (UnimplementedTenantRegistryServer) GetTenant(context.Context, *GetTenantRequest) (*ledger.Tenant, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetTenant not implemented")
|
|
}
|
|
func (UnimplementedTenantRegistryServer) ListTenants(context.Context, *ListTenantsRequest) (*ListTenantsResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ListTenants not implemented")
|
|
}
|
|
func (UnimplementedTenantRegistryServer) mustEmbedUnimplementedTenantRegistryServer() {}
|
|
func (UnimplementedTenantRegistryServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeTenantRegistryServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to TenantRegistryServer will
|
|
// result in compilation errors.
|
|
type UnsafeTenantRegistryServer interface {
|
|
mustEmbedUnimplementedTenantRegistryServer()
|
|
}
|
|
|
|
func RegisterTenantRegistryServer(s grpc.ServiceRegistrar, srv TenantRegistryServer) {
|
|
// If the following call panics, it indicates UnimplementedTenantRegistryServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&TenantRegistry_ServiceDesc, srv)
|
|
}
|
|
|
|
func _TenantRegistry_CreateTenant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateTenantRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TenantRegistryServer).CreateTenant(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: TenantRegistry_CreateTenant_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TenantRegistryServer).CreateTenant(ctx, req.(*CreateTenantRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TenantRegistry_GetTenant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetTenantRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TenantRegistryServer).GetTenant(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: TenantRegistry_GetTenant_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TenantRegistryServer).GetTenant(ctx, req.(*GetTenantRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TenantRegistry_ListTenants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListTenantsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TenantRegistryServer).ListTenants(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: TenantRegistry_ListTenants_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TenantRegistryServer).ListTenants(ctx, req.(*ListTenantsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// TenantRegistry_ServiceDesc is the grpc.ServiceDesc for TenantRegistry service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var TenantRegistry_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "ration.tenantregistry.v1.TenantRegistry",
|
|
HandlerType: (*TenantRegistryServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "CreateTenant",
|
|
Handler: _TenantRegistry_CreateTenant_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetTenant",
|
|
Handler: _TenantRegistry_GetTenant_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListTenants",
|
|
Handler: _TenantRegistry_ListTenants_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "tenant_registry.proto",
|
|
}
|