I am batman
This commit is contained in:
294
proto/post/post_grpc.pb.go
Normal file
294
proto/post/post_grpc.pb.go
Normal file
@@ -0,0 +1,294 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
// File: post.proto
|
||||
//
|
||||
// This Protocol Buffers file defines the gRPC contract for the PostService.
|
||||
// It includes service definitions for creating, retrieving, updating, deleting,
|
||||
// and listing posts. Each RPC method has corresponding request and response
|
||||
// messages. The syntax follows proto3 conventions and uses message types for
|
||||
// structured data exchange between microservices.
|
||||
//
|
||||
// Syntax:
|
||||
// - Uses proto3 syntax for modern Protocol Buffers features.
|
||||
// - Defines service and message types for CRUD operations.
|
||||
// - Supports repeated fields for listing multiple posts.
|
||||
//
|
||||
// Purpose:
|
||||
// - Enables strongly-typed, language-agnostic communication between services.
|
||||
// - Provides a contract for backend and API Gateway integration.
|
||||
// - Facilitates code generation for gRPC servers and clients.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v6.31.1
|
||||
// source: post.proto
|
||||
|
||||
package postpb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// 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 (
|
||||
PostService_CreatePost_FullMethodName = "/post.PostService/CreatePost"
|
||||
PostService_GetPost_FullMethodName = "/post.PostService/GetPost"
|
||||
PostService_UpdatePost_FullMethodName = "/post.PostService/UpdatePost"
|
||||
PostService_DeletePost_FullMethodName = "/post.PostService/DeletePost"
|
||||
PostService_ListPosts_FullMethodName = "/post.PostService/ListPosts"
|
||||
)
|
||||
|
||||
// PostServiceClient is the client API for PostService 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.
|
||||
type PostServiceClient interface {
|
||||
CreatePost(ctx context.Context, in *CreatePostRequest, opts ...grpc.CallOption) (*CreatePostResponse, error)
|
||||
GetPost(ctx context.Context, in *GetPostRequest, opts ...grpc.CallOption) (*GetPostResponse, error)
|
||||
UpdatePost(ctx context.Context, in *UpdatePostRequest, opts ...grpc.CallOption) (*UpdatePostResponse, error)
|
||||
DeletePost(ctx context.Context, in *DeletePostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
ListPosts(ctx context.Context, in *ListPostsRequest, opts ...grpc.CallOption) (*ListPostsResponse, error)
|
||||
}
|
||||
|
||||
type postServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewPostServiceClient(cc grpc.ClientConnInterface) PostServiceClient {
|
||||
return &postServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *postServiceClient) CreatePost(ctx context.Context, in *CreatePostRequest, opts ...grpc.CallOption) (*CreatePostResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreatePostResponse)
|
||||
err := c.cc.Invoke(ctx, PostService_CreatePost_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postServiceClient) GetPost(ctx context.Context, in *GetPostRequest, opts ...grpc.CallOption) (*GetPostResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetPostResponse)
|
||||
err := c.cc.Invoke(ctx, PostService_GetPost_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postServiceClient) UpdatePost(ctx context.Context, in *UpdatePostRequest, opts ...grpc.CallOption) (*UpdatePostResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdatePostResponse)
|
||||
err := c.cc.Invoke(ctx, PostService_UpdatePost_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postServiceClient) DeletePost(ctx context.Context, in *DeletePostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, PostService_DeletePost_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postServiceClient) ListPosts(ctx context.Context, in *ListPostsRequest, opts ...grpc.CallOption) (*ListPostsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListPostsResponse)
|
||||
err := c.cc.Invoke(ctx, PostService_ListPosts_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// PostServiceServer is the server API for PostService service.
|
||||
// All implementations must embed UnimplementedPostServiceServer
|
||||
// for forward compatibility.
|
||||
type PostServiceServer interface {
|
||||
CreatePost(context.Context, *CreatePostRequest) (*CreatePostResponse, error)
|
||||
GetPost(context.Context, *GetPostRequest) (*GetPostResponse, error)
|
||||
UpdatePost(context.Context, *UpdatePostRequest) (*UpdatePostResponse, error)
|
||||
DeletePost(context.Context, *DeletePostRequest) (*emptypb.Empty, error)
|
||||
ListPosts(context.Context, *ListPostsRequest) (*ListPostsResponse, error)
|
||||
mustEmbedUnimplementedPostServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedPostServiceServer 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 UnimplementedPostServiceServer struct{}
|
||||
|
||||
func (UnimplementedPostServiceServer) CreatePost(context.Context, *CreatePostRequest) (*CreatePostResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreatePost not implemented")
|
||||
}
|
||||
func (UnimplementedPostServiceServer) GetPost(context.Context, *GetPostRequest) (*GetPostResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPost not implemented")
|
||||
}
|
||||
func (UnimplementedPostServiceServer) UpdatePost(context.Context, *UpdatePostRequest) (*UpdatePostResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdatePost not implemented")
|
||||
}
|
||||
func (UnimplementedPostServiceServer) DeletePost(context.Context, *DeletePostRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeletePost not implemented")
|
||||
}
|
||||
func (UnimplementedPostServiceServer) ListPosts(context.Context, *ListPostsRequest) (*ListPostsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListPosts not implemented")
|
||||
}
|
||||
func (UnimplementedPostServiceServer) mustEmbedUnimplementedPostServiceServer() {}
|
||||
func (UnimplementedPostServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafePostServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to PostServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafePostServiceServer interface {
|
||||
mustEmbedUnimplementedPostServiceServer()
|
||||
}
|
||||
|
||||
func RegisterPostServiceServer(s grpc.ServiceRegistrar, srv PostServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedPostServiceServer 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(&PostService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _PostService_CreatePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreatePostRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServiceServer).CreatePost(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PostService_CreatePost_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServiceServer).CreatePost(ctx, req.(*CreatePostRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PostService_GetPost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPostRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServiceServer).GetPost(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PostService_GetPost_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServiceServer).GetPost(ctx, req.(*GetPostRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PostService_UpdatePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdatePostRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServiceServer).UpdatePost(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PostService_UpdatePost_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServiceServer).UpdatePost(ctx, req.(*UpdatePostRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PostService_DeletePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeletePostRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServiceServer).DeletePost(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PostService_DeletePost_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServiceServer).DeletePost(ctx, req.(*DeletePostRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PostService_ListPosts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListPostsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServiceServer).ListPosts(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PostService_ListPosts_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServiceServer).ListPosts(ctx, req.(*ListPostsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// PostService_ServiceDesc is the grpc.ServiceDesc for PostService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var PostService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "post.PostService",
|
||||
HandlerType: (*PostServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "CreatePost",
|
||||
Handler: _PostService_CreatePost_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPost",
|
||||
Handler: _PostService_GetPost_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdatePost",
|
||||
Handler: _PostService_UpdatePost_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeletePost",
|
||||
Handler: _PostService_DeletePost_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListPosts",
|
||||
Handler: _PostService_ListPosts_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "post.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user