-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudeventprocessor_fluffycore_di.pb.go
54 lines (44 loc) · 2.34 KB
/
cloudeventprocessor_fluffycore_di.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Code generated by protoc-gen-go-fluffycore-di. DO NOT EDIT.
package cloudeventprocessor
import (
context "context"
fluffy_dozm_di "github.com/fluffy-bunny/fluffy-dozm-di"
endpoint "github.com/fluffy-bunny/fluffycore/contracts/endpoint"
dicontext "github.com/fluffy-bunny/fluffycore/middleware/dicontext"
runtime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
grpc "google.golang.org/grpc"
)
// IFluffyCoreCloudEventProcessorServer defines the grpc server
type IFluffyCoreCloudEventProcessorServer interface {
CloudEventProcessorServer
}
type UnimplementedFluffyCoreCloudEventProcessorServerEndpointRegistration struct {
}
func (UnimplementedFluffyCoreCloudEventProcessorServerEndpointRegistration) RegisterFluffyCoreHandler(gwmux *runtime.ServeMux, conn *grpc.ClientConn) {
}
// CloudEventProcessorFluffyCoreServer defines the grpc server truct
type CloudEventProcessorFluffyCoreServer struct {
UnimplementedCloudEventProcessorServer
UnimplementedFluffyCoreCloudEventProcessorServerEndpointRegistration
}
// RegisterFluffyCoreGRPCService the server with grpc
func (srv *CloudEventProcessorFluffyCoreServer) RegisterFluffyCoreGRPCService(s *grpc.Server) {
RegisterCloudEventProcessorServer(s, srv)
}
// AddCloudEventProcessorServerWithExternalRegistration adds the fluffycore aware grpc server and external registration service. Mainly used for grpc-gateway
func AddCloudEventProcessorServerWithExternalRegistration(cb fluffy_dozm_di.ContainerBuilder, ctor any, register func() endpoint.IEndpointRegistration) {
fluffy_dozm_di.AddSingleton[endpoint.IEndpointRegistration](cb, register)
fluffy_dozm_di.AddScoped[IFluffyCoreCloudEventProcessorServer](cb, ctor)
}
// AddCloudEventProcessorServer adds the fluffycore aware grpc server
func AddCloudEventProcessorServer(cb fluffy_dozm_di.ContainerBuilder, ctor any) {
AddCloudEventProcessorServerWithExternalRegistration(cb, ctor, func() endpoint.IEndpointRegistration {
return &CloudEventProcessorFluffyCoreServer{}
})
}
// ProcessCloudEvents...
func (s *CloudEventProcessorFluffyCoreServer) ProcessCloudEvents(ctx context.Context, request *ProcessCloudEventsRequest) (*ProcessCloudEventsResponse, error) {
requestContainer := dicontext.GetRequestContainer(ctx)
downstreamService := fluffy_dozm_di.Get[IFluffyCoreCloudEventProcessorServer](requestContainer)
return downstreamService.ProcessCloudEvents(ctx, request)
}