236 lines
9.3 KiB
Go
236 lines
9.3 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.1
|
|
// - protoc v7.34.1
|
|
// source: search.proto
|
|
|
|
package pb
|
|
|
|
import (
|
|
context "context"
|
|
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 (
|
|
SearchService_AddFavorites_FullMethodName = "/pb.searchService/AddFavorites"
|
|
SearchService_DelFavorites_FullMethodName = "/pb.searchService/DelFavorites"
|
|
SearchService_GetFavoritesById_FullMethodName = "/pb.searchService/GetFavoritesById"
|
|
SearchService_SearchFavorites_FullMethodName = "/pb.searchService/SearchFavorites"
|
|
)
|
|
|
|
// SearchServiceClient is the client API for SearchService 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 SearchServiceClient interface {
|
|
AddFavorites(ctx context.Context, in *AddFavoritesReq, opts ...grpc.CallOption) (*AddFavoritesResp, error)
|
|
DelFavorites(ctx context.Context, in *DelFavoritesReq, opts ...grpc.CallOption) (*DelFavoritesResp, error)
|
|
GetFavoritesById(ctx context.Context, in *GetFavoritesByIdReq, opts ...grpc.CallOption) (*GetFavoritesByIdResp, error)
|
|
SearchFavorites(ctx context.Context, in *SearchFavoritesReq, opts ...grpc.CallOption) (*SearchFavoritesResp, error)
|
|
}
|
|
|
|
type searchServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewSearchServiceClient(cc grpc.ClientConnInterface) SearchServiceClient {
|
|
return &searchServiceClient{cc}
|
|
}
|
|
|
|
func (c *searchServiceClient) AddFavorites(ctx context.Context, in *AddFavoritesReq, opts ...grpc.CallOption) (*AddFavoritesResp, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(AddFavoritesResp)
|
|
err := c.cc.Invoke(ctx, SearchService_AddFavorites_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *searchServiceClient) DelFavorites(ctx context.Context, in *DelFavoritesReq, opts ...grpc.CallOption) (*DelFavoritesResp, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(DelFavoritesResp)
|
|
err := c.cc.Invoke(ctx, SearchService_DelFavorites_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *searchServiceClient) GetFavoritesById(ctx context.Context, in *GetFavoritesByIdReq, opts ...grpc.CallOption) (*GetFavoritesByIdResp, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(GetFavoritesByIdResp)
|
|
err := c.cc.Invoke(ctx, SearchService_GetFavoritesById_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *searchServiceClient) SearchFavorites(ctx context.Context, in *SearchFavoritesReq, opts ...grpc.CallOption) (*SearchFavoritesResp, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(SearchFavoritesResp)
|
|
err := c.cc.Invoke(ctx, SearchService_SearchFavorites_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// SearchServiceServer is the server API for SearchService service.
|
|
// All implementations must embed UnimplementedSearchServiceServer
|
|
// for forward compatibility.
|
|
type SearchServiceServer interface {
|
|
AddFavorites(context.Context, *AddFavoritesReq) (*AddFavoritesResp, error)
|
|
DelFavorites(context.Context, *DelFavoritesReq) (*DelFavoritesResp, error)
|
|
GetFavoritesById(context.Context, *GetFavoritesByIdReq) (*GetFavoritesByIdResp, error)
|
|
SearchFavorites(context.Context, *SearchFavoritesReq) (*SearchFavoritesResp, error)
|
|
mustEmbedUnimplementedSearchServiceServer()
|
|
}
|
|
|
|
// UnimplementedSearchServiceServer 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 UnimplementedSearchServiceServer struct{}
|
|
|
|
func (UnimplementedSearchServiceServer) AddFavorites(context.Context, *AddFavoritesReq) (*AddFavoritesResp, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method AddFavorites not implemented")
|
|
}
|
|
func (UnimplementedSearchServiceServer) DelFavorites(context.Context, *DelFavoritesReq) (*DelFavoritesResp, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method DelFavorites not implemented")
|
|
}
|
|
func (UnimplementedSearchServiceServer) GetFavoritesById(context.Context, *GetFavoritesByIdReq) (*GetFavoritesByIdResp, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetFavoritesById not implemented")
|
|
}
|
|
func (UnimplementedSearchServiceServer) SearchFavorites(context.Context, *SearchFavoritesReq) (*SearchFavoritesResp, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method SearchFavorites not implemented")
|
|
}
|
|
func (UnimplementedSearchServiceServer) mustEmbedUnimplementedSearchServiceServer() {}
|
|
func (UnimplementedSearchServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeSearchServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to SearchServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeSearchServiceServer interface {
|
|
mustEmbedUnimplementedSearchServiceServer()
|
|
}
|
|
|
|
func RegisterSearchServiceServer(s grpc.ServiceRegistrar, srv SearchServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedSearchServiceServer 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(&SearchService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _SearchService_AddFavorites_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(AddFavoritesReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SearchServiceServer).AddFavorites(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: SearchService_AddFavorites_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SearchServiceServer).AddFavorites(ctx, req.(*AddFavoritesReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _SearchService_DelFavorites_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DelFavoritesReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SearchServiceServer).DelFavorites(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: SearchService_DelFavorites_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SearchServiceServer).DelFavorites(ctx, req.(*DelFavoritesReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _SearchService_GetFavoritesById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetFavoritesByIdReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SearchServiceServer).GetFavoritesById(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: SearchService_GetFavoritesById_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SearchServiceServer).GetFavoritesById(ctx, req.(*GetFavoritesByIdReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _SearchService_SearchFavorites_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SearchFavoritesReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SearchServiceServer).SearchFavorites(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: SearchService_SearchFavorites_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SearchServiceServer).SearchFavorites(ctx, req.(*SearchFavoritesReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// SearchService_ServiceDesc is the grpc.ServiceDesc for SearchService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var SearchService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "pb.searchService",
|
|
HandlerType: (*SearchServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "AddFavorites",
|
|
Handler: _SearchService_AddFavorites_Handler,
|
|
},
|
|
{
|
|
MethodName: "DelFavorites",
|
|
Handler: _SearchService_DelFavorites_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetFavoritesById",
|
|
Handler: _SearchService_GetFavoritesById_Handler,
|
|
},
|
|
{
|
|
MethodName: "SearchFavorites",
|
|
Handler: _SearchService_SearchFavorites_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "search.proto",
|
|
}
|