client/golnag/passport/info_grpc.pb.go

292 lines
10 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc (unknown)
// source: info.proto
package passport
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 (
Info_Bind_FullMethodName = "/passport.Info/Bind"
Info_GetData_FullMethodName = "/passport.Info/GetData"
Info_SetData_FullMethodName = "/passport.Info/SetData"
Info_SetPassword_FullMethodName = "/passport.Info/SetPassword"
Info_Statistics_FullMethodName = "/passport.Info/Statistics"
)
// InfoClient is the client API for Info 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.
//
// Passport(会员通行证)模块-数据
// *此模块需要Token验证
type InfoClient interface {
// 绑定资料
Bind(ctx context.Context, in *BindRequest, opts ...grpc.CallOption) (*StatusReply, error)
// 获取会员的所有信息数据
GetData(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetDataReply, error)
// 更新会员的信息数据
// 字段值为空或是0将不更新此数据
SetData(ctx context.Context, in *SetDataRequest, opts ...grpc.CallOption) (*StatusReply, error)
// 更新会员的密码
SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*StatusReply, error)
// 获取会员的相关统计数据
Statistics(ctx context.Context, in *StatisticsRequest, opts ...grpc.CallOption) (*StatisticsReply, error)
}
type infoClient struct {
cc grpc.ClientConnInterface
}
func NewInfoClient(cc grpc.ClientConnInterface) InfoClient {
return &infoClient{cc}
}
func (c *infoClient) Bind(ctx context.Context, in *BindRequest, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Info_Bind_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *infoClient) GetData(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetDataReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetDataReply)
err := c.cc.Invoke(ctx, Info_GetData_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *infoClient) SetData(ctx context.Context, in *SetDataRequest, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Info_SetData_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *infoClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Info_SetPassword_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *infoClient) Statistics(ctx context.Context, in *StatisticsRequest, opts ...grpc.CallOption) (*StatisticsReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatisticsReply)
err := c.cc.Invoke(ctx, Info_Statistics_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// InfoServer is the server API for Info service.
// All implementations must embed UnimplementedInfoServer
// for forward compatibility.
//
// Passport(会员通行证)模块-数据
// *此模块需要Token验证
type InfoServer interface {
// 绑定资料
Bind(context.Context, *BindRequest) (*StatusReply, error)
// 获取会员的所有信息数据
GetData(context.Context, *Empty) (*GetDataReply, error)
// 更新会员的信息数据
// 字段值为空或是0将不更新此数据
SetData(context.Context, *SetDataRequest) (*StatusReply, error)
// 更新会员的密码
SetPassword(context.Context, *SetPasswordRequest) (*StatusReply, error)
// 获取会员的相关统计数据
Statistics(context.Context, *StatisticsRequest) (*StatisticsReply, error)
mustEmbedUnimplementedInfoServer()
}
// UnimplementedInfoServer 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 UnimplementedInfoServer struct{}
func (UnimplementedInfoServer) Bind(context.Context, *BindRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Bind not implemented")
}
func (UnimplementedInfoServer) GetData(context.Context, *Empty) (*GetDataReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetData not implemented")
}
func (UnimplementedInfoServer) SetData(context.Context, *SetDataRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetData not implemented")
}
func (UnimplementedInfoServer) SetPassword(context.Context, *SetPasswordRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetPassword not implemented")
}
func (UnimplementedInfoServer) Statistics(context.Context, *StatisticsRequest) (*StatisticsReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Statistics not implemented")
}
func (UnimplementedInfoServer) mustEmbedUnimplementedInfoServer() {}
func (UnimplementedInfoServer) testEmbeddedByValue() {}
// UnsafeInfoServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to InfoServer will
// result in compilation errors.
type UnsafeInfoServer interface {
mustEmbedUnimplementedInfoServer()
}
func RegisterInfoServer(s grpc.ServiceRegistrar, srv InfoServer) {
// If the following call pancis, it indicates UnimplementedInfoServer 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(&Info_ServiceDesc, srv)
}
func _Info_Bind_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BindRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(InfoServer).Bind(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Info_Bind_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(InfoServer).Bind(ctx, req.(*BindRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Info_GetData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(InfoServer).GetData(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Info_GetData_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(InfoServer).GetData(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _Info_SetData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetDataRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(InfoServer).SetData(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Info_SetData_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(InfoServer).SetData(ctx, req.(*SetDataRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Info_SetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetPasswordRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(InfoServer).SetPassword(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Info_SetPassword_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(InfoServer).SetPassword(ctx, req.(*SetPasswordRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Info_Statistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatisticsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(InfoServer).Statistics(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Info_Statistics_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(InfoServer).Statistics(ctx, req.(*StatisticsRequest))
}
return interceptor(ctx, in, info, handler)
}
// Info_ServiceDesc is the grpc.ServiceDesc for Info service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Info_ServiceDesc = grpc.ServiceDesc{
ServiceName: "passport.Info",
HandlerType: (*InfoServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Bind",
Handler: _Info_Bind_Handler,
},
{
MethodName: "GetData",
Handler: _Info_GetData_Handler,
},
{
MethodName: "SetData",
Handler: _Info_SetData_Handler,
},
{
MethodName: "SetPassword",
Handler: _Info_SetPassword_Handler,
},
{
MethodName: "Statistics",
Handler: _Info_Statistics_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "info.proto",
}