Debian Codegraph @

eventarc/publishing/apiv1/publishingpb/publisher_grpc.pb.go

raw
1 // Copyright 2025 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
16 // versions:
17 // - protoc-gen-go-grpc v1.3.0
18 // - protoc v4.25.7
19 // source: google/cloud/eventarc/publishing/v1/publisher.proto
20
21 package publishingpb
22
23 import (
24 context "context"
25 grpc "google.golang.org/grpc"
26 codes "google.golang.org/grpc/codes"
27 status "google.golang.org/grpc/status"
28 )
29
30 // This is a compile-time assertion to ensure that this generated file
31 // is compatible with the grpc package it is being compiled against.
32 // Requires gRPC-Go v1.32.0 or later.
33 const _ = grpc.SupportPackageIsVersion7
34
35 const (
36 Publisher_PublishChannelConnectionEvents_FullMethodName = "/google.cloud.eventarc.publishing.v1.Publisher/PublishChannelConnectionEvents"
37 Publisher_PublishEvents_FullMethodName = "/google.cloud.eventarc.publishing.v1.Publisher/PublishEvents"
38 Publisher_Publish_FullMethodName = "/google.cloud.eventarc.publishing.v1.Publisher/Publish"
39 )
40
41 // PublisherClient is the client API for Publisher service.
42 //
43 // 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.
44 type PublisherClient interface {
45 // Publish events to a ChannelConnection in a partner's project.
46 PublishChannelConnectionEvents(ctx context.Context, in *PublishChannelConnectionEventsRequest, opts ...grpc.CallOption) (*PublishChannelConnectionEventsResponse, error)
47 // Publish events to a subscriber's channel.
48 PublishEvents(ctx context.Context, in *PublishEventsRequest, opts ...grpc.CallOption) (*PublishEventsResponse, error)
49 // Publish events to a message bus.
50 Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error)
51 }
52
53 type publisherClient struct {
54 cc grpc.ClientConnInterface
55 }
56
57 func NewPublisherClient(cc grpc.ClientConnInterface) PublisherClient {
58 return &publisherClient{cc}
59 }
60
61 func (c *publisherClient) PublishChannelConnectionEvents(ctx context.Context, in *PublishChannelConnectionEventsRequest, opts ...grpc.CallOption) (*PublishChannelConnectionEventsResponse, error) {
62 out := new(PublishChannelConnectionEventsResponse)
63 err := c.cc.Invoke(ctx, Publisher_PublishChannelConnectionEvents_FullMethodName, in, out, opts...)
64 if err != nil {
65 return nil, err
66 }
67 return out, nil
68 }
69
70 func (c *publisherClient) PublishEvents(ctx context.Context, in *PublishEventsRequest, opts ...grpc.CallOption) (*PublishEventsResponse, error) {
71 out := new(PublishEventsResponse)
72 err := c.cc.Invoke(ctx, Publisher_PublishEvents_FullMethodName, in, out, opts...)
73 if err != nil {
74 return nil, err
75 }
76 return out, nil
77 }
78
79 func (c *publisherClient) Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error) {
80 out := new(PublishResponse)
81 err := c.cc.Invoke(ctx, Publisher_Publish_FullMethodName, in, out, opts...)
82 if err != nil {
83 return nil, err
84 }
85 return out, nil
86 }
87
88 // PublisherServer is the server API for Publisher service.
89 // All implementations should embed UnimplementedPublisherServer
90 // for forward compatibility
91 type PublisherServer interface {
92 // Publish events to a ChannelConnection in a partner's project.
93 PublishChannelConnectionEvents(context.Context, *PublishChannelConnectionEventsRequest) (*PublishChannelConnectionEventsResponse, error)
94 // Publish events to a subscriber's channel.
95 PublishEvents(context.Context, *PublishEventsRequest) (*PublishEventsResponse, error)
96 // Publish events to a message bus.
97 Publish(context.Context, *PublishRequest) (*PublishResponse, error)
98 }
99
100 // UnimplementedPublisherServer should be embedded to have forward compatible implementations.
101 type UnimplementedPublisherServer struct {
102 }
103
104 func (UnimplementedPublisherServer) PublishChannelConnectionEvents(context.Context, *PublishChannelConnectionEventsRequest) (*PublishChannelConnectionEventsResponse, error) {
105 return nil, status.Errorf(codes.Unimplemented, "method PublishChannelConnectionEvents not implemented")
106 }
107 func (UnimplementedPublisherServer) PublishEvents(context.Context, *PublishEventsRequest) (*PublishEventsResponse, error) {
108 return nil, status.Errorf(codes.Unimplemented, "method PublishEvents not implemented")
109 }
110 func (UnimplementedPublisherServer) Publish(context.Context, *PublishRequest) (*PublishResponse, error) {
111 return nil, status.Errorf(codes.Unimplemented, "method Publish not implemented")
112 }
113
114 // UnsafePublisherServer may be embedded to opt out of forward compatibility for this service.
115 // Use of this interface is not recommended, as added methods to PublisherServer will
116 // result in compilation errors.
117 type UnsafePublisherServer interface {
118 mustEmbedUnimplementedPublisherServer()
119 }
120
121 func RegisterPublisherServer(s grpc.ServiceRegistrar, srv PublisherServer) {
122 s.RegisterService(&Publisher_ServiceDesc, srv)
123 }
124
125 func _Publisher_PublishChannelConnectionEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
126 in := new(PublishChannelConnectionEventsRequest)
127 if err := dec(in); err != nil {
128 return nil, err
129 }
130 if interceptor == nil {
131 return srv.(PublisherServer).PublishChannelConnectionEvents(ctx, in)
132 }
133 info := &grpc.UnaryServerInfo{
134 Server: srv,
135 FullMethod: Publisher_PublishChannelConnectionEvents_FullMethodName,
136 }
137 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
138 return srv.(PublisherServer).PublishChannelConnectionEvents(ctx, req.(*PublishChannelConnectionEventsRequest))
139 }
140 return interceptor(ctx, in, info, handler)
141 }
142
143 func _Publisher_PublishEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
144 in := new(PublishEventsRequest)
145 if err := dec(in); err != nil {
146 return nil, err
147 }
148 if interceptor == nil {
149 return srv.(PublisherServer).PublishEvents(ctx, in)
150 }
151 info := &grpc.UnaryServerInfo{
152 Server: srv,
153 FullMethod: Publisher_PublishEvents_FullMethodName,
154 }
155 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
156 return srv.(PublisherServer).PublishEvents(ctx, req.(*PublishEventsRequest))
157 }
158 return interceptor(ctx, in, info, handler)
159 }
160
161 func _Publisher_Publish_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
162 in := new(PublishRequest)
163 if err := dec(in); err != nil {
164 return nil, err
165 }
166 if interceptor == nil {
167 return srv.(PublisherServer).Publish(ctx, in)
168 }
169 info := &grpc.UnaryServerInfo{
170 Server: srv,
171 FullMethod: Publisher_Publish_FullMethodName,
172 }
173 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
174 return srv.(PublisherServer).Publish(ctx, req.(*PublishRequest))
175 }
176 return interceptor(ctx, in, info, handler)
177 }
178
179 // Publisher_ServiceDesc is the grpc.ServiceDesc for Publisher service.
180 // It's only intended for direct use with grpc.RegisterService,
181 // and not to be introspected or modified (even as a copy)
182 var Publisher_ServiceDesc = grpc.ServiceDesc{
183 ServiceName: "google.cloud.eventarc.publishing.v1.Publisher",
184 HandlerType: (*PublisherServer)(nil),
185 Methods: []grpc.MethodDesc{
186 {
187 MethodName: "PublishChannelConnectionEvents",
188 Handler: _Publisher_PublishChannelConnectionEvents_Handler,
189 },
190 {
191 MethodName: "PublishEvents",
192 Handler: _Publisher_PublishEvents_Handler,
193 },
194 {
195 MethodName: "Publish",
196 Handler: _Publisher_Publish_Handler,
197 },
198 },
199 Streams: []grpc.StreamDesc{},
200 Metadata: "google/cloud/eventarc/publishing/v1/publisher.proto",
201 }