this repo has no description
1// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2// versions:
3// - protoc-gen-go-grpc v1.6.0
4// - protoc (unknown)
5// source: post.proto
6
7package vyletdatabase
8
9import (
10 context "context"
11 grpc "google.golang.org/grpc"
12 codes "google.golang.org/grpc/codes"
13 status "google.golang.org/grpc/status"
14)
15
16// This is a compile-time assertion to ensure that this generated file
17// is compatible with the grpc package it is being compiled against.
18// Requires gRPC-Go v1.64.0 or later.
19const _ = grpc.SupportPackageIsVersion9
20
21const (
22 PostService_CreatePost_FullMethodName = "/vyletdatabase.PostService/CreatePost"
23 PostService_DeletePost_FullMethodName = "/vyletdatabase.PostService/DeletePost"
24 PostService_GetPosts_FullMethodName = "/vyletdatabase.PostService/GetPosts"
25 PostService_GetPostsByActor_FullMethodName = "/vyletdatabase.PostService/GetPostsByActor"
26 PostService_GetPostInteractionCounts_FullMethodName = "/vyletdatabase.PostService/GetPostInteractionCounts"
27 PostService_GetPostsInteractionCounts_FullMethodName = "/vyletdatabase.PostService/GetPostsInteractionCounts"
28)
29
30// PostServiceClient is the client API for PostService service.
31//
32// 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.
33type PostServiceClient interface {
34 CreatePost(ctx context.Context, in *CreatePostRequest, opts ...grpc.CallOption) (*CreatePostResponse, error)
35 DeletePost(ctx context.Context, in *DeletePostRequest, opts ...grpc.CallOption) (*DeletePostResponse, error)
36 GetPosts(ctx context.Context, in *GetPostsRequest, opts ...grpc.CallOption) (*GetPostsResponse, error)
37 GetPostsByActor(ctx context.Context, in *GetPostsByActorRequest, opts ...grpc.CallOption) (*GetPostsByActorResponse, error)
38 GetPostInteractionCounts(ctx context.Context, in *GetPostInteractionCountsRequest, opts ...grpc.CallOption) (*GetPostInteractionCountsResponse, error)
39 GetPostsInteractionCounts(ctx context.Context, in *GetPostsInteractionCountsRequest, opts ...grpc.CallOption) (*GetPostsInteractionCountsResponse, error)
40}
41
42type postServiceClient struct {
43 cc grpc.ClientConnInterface
44}
45
46func NewPostServiceClient(cc grpc.ClientConnInterface) PostServiceClient {
47 return &postServiceClient{cc}
48}
49
50func (c *postServiceClient) CreatePost(ctx context.Context, in *CreatePostRequest, opts ...grpc.CallOption) (*CreatePostResponse, error) {
51 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
52 out := new(CreatePostResponse)
53 err := c.cc.Invoke(ctx, PostService_CreatePost_FullMethodName, in, out, cOpts...)
54 if err != nil {
55 return nil, err
56 }
57 return out, nil
58}
59
60func (c *postServiceClient) DeletePost(ctx context.Context, in *DeletePostRequest, opts ...grpc.CallOption) (*DeletePostResponse, error) {
61 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
62 out := new(DeletePostResponse)
63 err := c.cc.Invoke(ctx, PostService_DeletePost_FullMethodName, in, out, cOpts...)
64 if err != nil {
65 return nil, err
66 }
67 return out, nil
68}
69
70func (c *postServiceClient) GetPosts(ctx context.Context, in *GetPostsRequest, opts ...grpc.CallOption) (*GetPostsResponse, error) {
71 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
72 out := new(GetPostsResponse)
73 err := c.cc.Invoke(ctx, PostService_GetPosts_FullMethodName, in, out, cOpts...)
74 if err != nil {
75 return nil, err
76 }
77 return out, nil
78}
79
80func (c *postServiceClient) GetPostsByActor(ctx context.Context, in *GetPostsByActorRequest, opts ...grpc.CallOption) (*GetPostsByActorResponse, error) {
81 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
82 out := new(GetPostsByActorResponse)
83 err := c.cc.Invoke(ctx, PostService_GetPostsByActor_FullMethodName, in, out, cOpts...)
84 if err != nil {
85 return nil, err
86 }
87 return out, nil
88}
89
90func (c *postServiceClient) GetPostInteractionCounts(ctx context.Context, in *GetPostInteractionCountsRequest, opts ...grpc.CallOption) (*GetPostInteractionCountsResponse, error) {
91 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
92 out := new(GetPostInteractionCountsResponse)
93 err := c.cc.Invoke(ctx, PostService_GetPostInteractionCounts_FullMethodName, in, out, cOpts...)
94 if err != nil {
95 return nil, err
96 }
97 return out, nil
98}
99
100func (c *postServiceClient) GetPostsInteractionCounts(ctx context.Context, in *GetPostsInteractionCountsRequest, opts ...grpc.CallOption) (*GetPostsInteractionCountsResponse, error) {
101 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
102 out := new(GetPostsInteractionCountsResponse)
103 err := c.cc.Invoke(ctx, PostService_GetPostsInteractionCounts_FullMethodName, in, out, cOpts...)
104 if err != nil {
105 return nil, err
106 }
107 return out, nil
108}
109
110// PostServiceServer is the server API for PostService service.
111// All implementations must embed UnimplementedPostServiceServer
112// for forward compatibility.
113type PostServiceServer interface {
114 CreatePost(context.Context, *CreatePostRequest) (*CreatePostResponse, error)
115 DeletePost(context.Context, *DeletePostRequest) (*DeletePostResponse, error)
116 GetPosts(context.Context, *GetPostsRequest) (*GetPostsResponse, error)
117 GetPostsByActor(context.Context, *GetPostsByActorRequest) (*GetPostsByActorResponse, error)
118 GetPostInteractionCounts(context.Context, *GetPostInteractionCountsRequest) (*GetPostInteractionCountsResponse, error)
119 GetPostsInteractionCounts(context.Context, *GetPostsInteractionCountsRequest) (*GetPostsInteractionCountsResponse, error)
120 mustEmbedUnimplementedPostServiceServer()
121}
122
123// UnimplementedPostServiceServer must be embedded to have
124// forward compatible implementations.
125//
126// NOTE: this should be embedded by value instead of pointer to avoid a nil
127// pointer dereference when methods are called.
128type UnimplementedPostServiceServer struct{}
129
130func (UnimplementedPostServiceServer) CreatePost(context.Context, *CreatePostRequest) (*CreatePostResponse, error) {
131 return nil, status.Error(codes.Unimplemented, "method CreatePost not implemented")
132}
133func (UnimplementedPostServiceServer) DeletePost(context.Context, *DeletePostRequest) (*DeletePostResponse, error) {
134 return nil, status.Error(codes.Unimplemented, "method DeletePost not implemented")
135}
136func (UnimplementedPostServiceServer) GetPosts(context.Context, *GetPostsRequest) (*GetPostsResponse, error) {
137 return nil, status.Error(codes.Unimplemented, "method GetPosts not implemented")
138}
139func (UnimplementedPostServiceServer) GetPostsByActor(context.Context, *GetPostsByActorRequest) (*GetPostsByActorResponse, error) {
140 return nil, status.Error(codes.Unimplemented, "method GetPostsByActor not implemented")
141}
142func (UnimplementedPostServiceServer) GetPostInteractionCounts(context.Context, *GetPostInteractionCountsRequest) (*GetPostInteractionCountsResponse, error) {
143 return nil, status.Error(codes.Unimplemented, "method GetPostInteractionCounts not implemented")
144}
145func (UnimplementedPostServiceServer) GetPostsInteractionCounts(context.Context, *GetPostsInteractionCountsRequest) (*GetPostsInteractionCountsResponse, error) {
146 return nil, status.Error(codes.Unimplemented, "method GetPostsInteractionCounts not implemented")
147}
148func (UnimplementedPostServiceServer) mustEmbedUnimplementedPostServiceServer() {}
149func (UnimplementedPostServiceServer) testEmbeddedByValue() {}
150
151// UnsafePostServiceServer may be embedded to opt out of forward compatibility for this service.
152// Use of this interface is not recommended, as added methods to PostServiceServer will
153// result in compilation errors.
154type UnsafePostServiceServer interface {
155 mustEmbedUnimplementedPostServiceServer()
156}
157
158func RegisterPostServiceServer(s grpc.ServiceRegistrar, srv PostServiceServer) {
159 // If the following call panics, it indicates UnimplementedPostServiceServer was
160 // embedded by pointer and is nil. This will cause panics if an
161 // unimplemented method is ever invoked, so we test this at initialization
162 // time to prevent it from happening at runtime later due to I/O.
163 if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
164 t.testEmbeddedByValue()
165 }
166 s.RegisterService(&PostService_ServiceDesc, srv)
167}
168
169func _PostService_CreatePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
170 in := new(CreatePostRequest)
171 if err := dec(in); err != nil {
172 return nil, err
173 }
174 if interceptor == nil {
175 return srv.(PostServiceServer).CreatePost(ctx, in)
176 }
177 info := &grpc.UnaryServerInfo{
178 Server: srv,
179 FullMethod: PostService_CreatePost_FullMethodName,
180 }
181 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
182 return srv.(PostServiceServer).CreatePost(ctx, req.(*CreatePostRequest))
183 }
184 return interceptor(ctx, in, info, handler)
185}
186
187func _PostService_DeletePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
188 in := new(DeletePostRequest)
189 if err := dec(in); err != nil {
190 return nil, err
191 }
192 if interceptor == nil {
193 return srv.(PostServiceServer).DeletePost(ctx, in)
194 }
195 info := &grpc.UnaryServerInfo{
196 Server: srv,
197 FullMethod: PostService_DeletePost_FullMethodName,
198 }
199 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
200 return srv.(PostServiceServer).DeletePost(ctx, req.(*DeletePostRequest))
201 }
202 return interceptor(ctx, in, info, handler)
203}
204
205func _PostService_GetPosts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
206 in := new(GetPostsRequest)
207 if err := dec(in); err != nil {
208 return nil, err
209 }
210 if interceptor == nil {
211 return srv.(PostServiceServer).GetPosts(ctx, in)
212 }
213 info := &grpc.UnaryServerInfo{
214 Server: srv,
215 FullMethod: PostService_GetPosts_FullMethodName,
216 }
217 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
218 return srv.(PostServiceServer).GetPosts(ctx, req.(*GetPostsRequest))
219 }
220 return interceptor(ctx, in, info, handler)
221}
222
223func _PostService_GetPostsByActor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
224 in := new(GetPostsByActorRequest)
225 if err := dec(in); err != nil {
226 return nil, err
227 }
228 if interceptor == nil {
229 return srv.(PostServiceServer).GetPostsByActor(ctx, in)
230 }
231 info := &grpc.UnaryServerInfo{
232 Server: srv,
233 FullMethod: PostService_GetPostsByActor_FullMethodName,
234 }
235 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
236 return srv.(PostServiceServer).GetPostsByActor(ctx, req.(*GetPostsByActorRequest))
237 }
238 return interceptor(ctx, in, info, handler)
239}
240
241func _PostService_GetPostInteractionCounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
242 in := new(GetPostInteractionCountsRequest)
243 if err := dec(in); err != nil {
244 return nil, err
245 }
246 if interceptor == nil {
247 return srv.(PostServiceServer).GetPostInteractionCounts(ctx, in)
248 }
249 info := &grpc.UnaryServerInfo{
250 Server: srv,
251 FullMethod: PostService_GetPostInteractionCounts_FullMethodName,
252 }
253 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
254 return srv.(PostServiceServer).GetPostInteractionCounts(ctx, req.(*GetPostInteractionCountsRequest))
255 }
256 return interceptor(ctx, in, info, handler)
257}
258
259func _PostService_GetPostsInteractionCounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
260 in := new(GetPostsInteractionCountsRequest)
261 if err := dec(in); err != nil {
262 return nil, err
263 }
264 if interceptor == nil {
265 return srv.(PostServiceServer).GetPostsInteractionCounts(ctx, in)
266 }
267 info := &grpc.UnaryServerInfo{
268 Server: srv,
269 FullMethod: PostService_GetPostsInteractionCounts_FullMethodName,
270 }
271 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
272 return srv.(PostServiceServer).GetPostsInteractionCounts(ctx, req.(*GetPostsInteractionCountsRequest))
273 }
274 return interceptor(ctx, in, info, handler)
275}
276
277// PostService_ServiceDesc is the grpc.ServiceDesc for PostService service.
278// It's only intended for direct use with grpc.RegisterService,
279// and not to be introspected or modified (even as a copy)
280var PostService_ServiceDesc = grpc.ServiceDesc{
281 ServiceName: "vyletdatabase.PostService",
282 HandlerType: (*PostServiceServer)(nil),
283 Methods: []grpc.MethodDesc{
284 {
285 MethodName: "CreatePost",
286 Handler: _PostService_CreatePost_Handler,
287 },
288 {
289 MethodName: "DeletePost",
290 Handler: _PostService_DeletePost_Handler,
291 },
292 {
293 MethodName: "GetPosts",
294 Handler: _PostService_GetPosts_Handler,
295 },
296 {
297 MethodName: "GetPostsByActor",
298 Handler: _PostService_GetPostsByActor_Handler,
299 },
300 {
301 MethodName: "GetPostInteractionCounts",
302 Handler: _PostService_GetPostInteractionCounts_Handler,
303 },
304 {
305 MethodName: "GetPostsInteractionCounts",
306 Handler: _PostService_GetPostsInteractionCounts_Handler,
307 },
308 },
309 Streams: []grpc.StreamDesc{},
310 Metadata: "post.proto",
311}