client/golang/relation/match_grpc.pb.go

248 lines
8.4 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc (unknown)
// source: match.proto
package relation
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 (
Match_Fetch_FullMethodName = "/relation.Match/Fetch"
Match_Get_FullMethodName = "/relation.Match/Get"
Match_DoJoin_FullMethodName = "/relation.Match/DoJoin"
Match_DoIgnore_FullMethodName = "/relation.Match/DoIgnore"
)
// MatchClient is the client API for Match 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.
//
// relation-关系管理:匹配
type MatchClient interface {
// 获取匹配列表
Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*FetchRelationItemReply, error)
// 获取匹配详情
Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*RelationItem, error)
// 执行通过,加为好友
DoJoin(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
// 执行忽略
DoIgnore(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
}
type matchClient struct {
cc grpc.ClientConnInterface
}
func NewMatchClient(cc grpc.ClientConnInterface) MatchClient {
return &matchClient{cc}
}
func (c *matchClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*FetchRelationItemReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(FetchRelationItemReply)
err := c.cc.Invoke(ctx, Match_Fetch_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *matchClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*RelationItem, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RelationItem)
err := c.cc.Invoke(ctx, Match_Get_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *matchClient) DoJoin(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Match_DoJoin_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *matchClient) DoIgnore(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Match_DoIgnore_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// MatchServer is the server API for Match service.
// All implementations must embed UnimplementedMatchServer
// for forward compatibility.
//
// relation-关系管理:匹配
type MatchServer interface {
// 获取匹配列表
Fetch(context.Context, *FetchRequest) (*FetchRelationItemReply, error)
// 获取匹配详情
Get(context.Context, *IdentRequest) (*RelationItem, error)
// 执行通过,加为好友
DoJoin(context.Context, *IdentRequest) (*StatusReply, error)
// 执行忽略
DoIgnore(context.Context, *IdentRequest) (*StatusReply, error)
mustEmbedUnimplementedMatchServer()
}
// UnimplementedMatchServer 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 UnimplementedMatchServer struct{}
func (UnimplementedMatchServer) Fetch(context.Context, *FetchRequest) (*FetchRelationItemReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedMatchServer) Get(context.Context, *IdentRequest) (*RelationItem, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedMatchServer) DoJoin(context.Context, *IdentRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method DoJoin not implemented")
}
func (UnimplementedMatchServer) DoIgnore(context.Context, *IdentRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method DoIgnore not implemented")
}
func (UnimplementedMatchServer) mustEmbedUnimplementedMatchServer() {}
func (UnimplementedMatchServer) testEmbeddedByValue() {}
// UnsafeMatchServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to MatchServer will
// result in compilation errors.
type UnsafeMatchServer interface {
mustEmbedUnimplementedMatchServer()
}
func RegisterMatchServer(s grpc.ServiceRegistrar, srv MatchServer) {
// If the following call pancis, it indicates UnimplementedMatchServer 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(&Match_ServiceDesc, srv)
}
func _Match_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MatchServer).Fetch(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Match_Fetch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MatchServer).Fetch(ctx, req.(*FetchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Match_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MatchServer).Get(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Match_Get_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MatchServer).Get(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Match_DoJoin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MatchServer).DoJoin(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Match_DoJoin_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MatchServer).DoJoin(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Match_DoIgnore_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MatchServer).DoIgnore(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Match_DoIgnore_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MatchServer).DoIgnore(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
// Match_ServiceDesc is the grpc.ServiceDesc for Match service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Match_ServiceDesc = grpc.ServiceDesc{
ServiceName: "relation.Match",
HandlerType: (*MatchServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Fetch",
Handler: _Match_Fetch_Handler,
},
{
MethodName: "Get",
Handler: _Match_Get_Handler,
},
{
MethodName: "DoJoin",
Handler: _Match_DoJoin_Handler,
},
{
MethodName: "DoIgnore",
Handler: _Match_DoIgnore_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "match.proto",
}