nim/igapi/interface_grpc.pb.go
2025-06-01 21:20:08 +08:00

311 lines
10 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v6.31.0
// source: igapi/interface.proto
package igapi
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 (
IGAPI_Login_FullMethodName = "/IGAPI/login"
IGAPI_AccountInfo_FullMethodName = "/IGAPI/account_info"
IGAPI_Upload_FullMethodName = "/IGAPI/upload"
IGAPI_Delete_FullMethodName = "/IGAPI/delete"
IGAPI_Queue_FullMethodName = "/IGAPI/queue"
IGAPI_Search_FullMethodName = "/IGAPI/search"
)
// IGAPIClient is the client API for IGAPI 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 IGAPIClient interface {
Login(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error)
AccountInfo(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error)
Upload(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error)
Delete(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error)
Queue(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error)
Search(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error)
}
type iGAPIClient struct {
cc grpc.ClientConnInterface
}
func NewIGAPIClient(cc grpc.ClientConnInterface) IGAPIClient {
return &iGAPIClient{cc}
}
func (c *iGAPIClient) Login(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Reply)
err := c.cc.Invoke(ctx, IGAPI_Login_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iGAPIClient) AccountInfo(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Reply)
err := c.cc.Invoke(ctx, IGAPI_AccountInfo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iGAPIClient) Upload(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Reply)
err := c.cc.Invoke(ctx, IGAPI_Upload_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iGAPIClient) Delete(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Reply)
err := c.cc.Invoke(ctx, IGAPI_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iGAPIClient) Queue(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Reply)
err := c.cc.Invoke(ctx, IGAPI_Queue_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iGAPIClient) Search(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Reply)
err := c.cc.Invoke(ctx, IGAPI_Search_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// IGAPIServer is the server API for IGAPI service.
// All implementations must embed UnimplementedIGAPIServer
// for forward compatibility.
type IGAPIServer interface {
Login(context.Context, *Request) (*Reply, error)
AccountInfo(context.Context, *Request) (*Reply, error)
Upload(context.Context, *Request) (*Reply, error)
Delete(context.Context, *Request) (*Reply, error)
Queue(context.Context, *Request) (*Reply, error)
Search(context.Context, *Request) (*Reply, error)
mustEmbedUnimplementedIGAPIServer()
}
// UnimplementedIGAPIServer 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 UnimplementedIGAPIServer struct{}
func (UnimplementedIGAPIServer) Login(context.Context, *Request) (*Reply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
}
func (UnimplementedIGAPIServer) AccountInfo(context.Context, *Request) (*Reply, error) {
return nil, status.Errorf(codes.Unimplemented, "method AccountInfo not implemented")
}
func (UnimplementedIGAPIServer) Upload(context.Context, *Request) (*Reply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Upload not implemented")
}
func (UnimplementedIGAPIServer) Delete(context.Context, *Request) (*Reply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedIGAPIServer) Queue(context.Context, *Request) (*Reply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Queue not implemented")
}
func (UnimplementedIGAPIServer) Search(context.Context, *Request) (*Reply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Search not implemented")
}
func (UnimplementedIGAPIServer) mustEmbedUnimplementedIGAPIServer() {}
func (UnimplementedIGAPIServer) testEmbeddedByValue() {}
// UnsafeIGAPIServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to IGAPIServer will
// result in compilation errors.
type UnsafeIGAPIServer interface {
mustEmbedUnimplementedIGAPIServer()
}
func RegisterIGAPIServer(s grpc.ServiceRegistrar, srv IGAPIServer) {
// If the following call pancis, it indicates UnimplementedIGAPIServer 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(&IGAPI_ServiceDesc, srv)
}
func _IGAPI_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IGAPIServer).Login(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IGAPI_Login_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IGAPIServer).Login(ctx, req.(*Request))
}
return interceptor(ctx, in, info, handler)
}
func _IGAPI_AccountInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IGAPIServer).AccountInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IGAPI_AccountInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IGAPIServer).AccountInfo(ctx, req.(*Request))
}
return interceptor(ctx, in, info, handler)
}
func _IGAPI_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IGAPIServer).Upload(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IGAPI_Upload_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IGAPIServer).Upload(ctx, req.(*Request))
}
return interceptor(ctx, in, info, handler)
}
func _IGAPI_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IGAPIServer).Delete(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IGAPI_Delete_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IGAPIServer).Delete(ctx, req.(*Request))
}
return interceptor(ctx, in, info, handler)
}
func _IGAPI_Queue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IGAPIServer).Queue(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IGAPI_Queue_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IGAPIServer).Queue(ctx, req.(*Request))
}
return interceptor(ctx, in, info, handler)
}
func _IGAPI_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IGAPIServer).Search(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IGAPI_Search_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IGAPIServer).Search(ctx, req.(*Request))
}
return interceptor(ctx, in, info, handler)
}
// IGAPI_ServiceDesc is the grpc.ServiceDesc for IGAPI service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var IGAPI_ServiceDesc = grpc.ServiceDesc{
ServiceName: "IGAPI",
HandlerType: (*IGAPIServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "login",
Handler: _IGAPI_Login_Handler,
},
{
MethodName: "account_info",
Handler: _IGAPI_AccountInfo_Handler,
},
{
MethodName: "upload",
Handler: _IGAPI_Upload_Handler,
},
{
MethodName: "delete",
Handler: _IGAPI_Delete_Handler,
},
{
MethodName: "queue",
Handler: _IGAPI_Queue_Handler,
},
{
MethodName: "search",
Handler: _IGAPI_Search_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "igapi/interface.proto",
}