175 lines
5.3 KiB
Go
175 lines
5.3 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.2.0
|
|
// - protoc v3.21.10
|
|
// source: protos/operation.proto
|
|
|
|
package protos
|
|
|
|
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.32.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion7
|
|
|
|
// OperationClient is the client API for Operation 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 OperationClient interface {
|
|
Query(ctx context.Context, opts ...grpc.CallOption) (Operation_QueryClient, error)
|
|
Refresh(ctx context.Context, in *OperationQueryRequest, opts ...grpc.CallOption) (*Empty, error)
|
|
}
|
|
|
|
type operationClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewOperationClient(cc grpc.ClientConnInterface) OperationClient {
|
|
return &operationClient{cc}
|
|
}
|
|
|
|
func (c *operationClient) Query(ctx context.Context, opts ...grpc.CallOption) (Operation_QueryClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &Operation_ServiceDesc.Streams[0], "/Operation/Query", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &operationQueryClient{stream}
|
|
return x, nil
|
|
}
|
|
|
|
type Operation_QueryClient interface {
|
|
Send(*OperationQueryRequest) error
|
|
Recv() (*OperationQueryResponse, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type operationQueryClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *operationQueryClient) Send(m *OperationQueryRequest) error {
|
|
return x.ClientStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *operationQueryClient) Recv() (*OperationQueryResponse, error) {
|
|
m := new(OperationQueryResponse)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (c *operationClient) Refresh(ctx context.Context, in *OperationQueryRequest, opts ...grpc.CallOption) (*Empty, error) {
|
|
out := new(Empty)
|
|
err := c.cc.Invoke(ctx, "/Operation/Refresh", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// OperationServer is the server API for Operation service.
|
|
// All implementations must embed UnimplementedOperationServer
|
|
// for forward compatibility
|
|
type OperationServer interface {
|
|
Query(Operation_QueryServer) error
|
|
Refresh(context.Context, *OperationQueryRequest) (*Empty, error)
|
|
mustEmbedUnimplementedOperationServer()
|
|
}
|
|
|
|
// UnimplementedOperationServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedOperationServer struct {
|
|
}
|
|
|
|
func (UnimplementedOperationServer) Query(Operation_QueryServer) error {
|
|
return status.Errorf(codes.Unimplemented, "method Query not implemented")
|
|
}
|
|
func (UnimplementedOperationServer) Refresh(context.Context, *OperationQueryRequest) (*Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Refresh not implemented")
|
|
}
|
|
func (UnimplementedOperationServer) mustEmbedUnimplementedOperationServer() {}
|
|
|
|
// UnsafeOperationServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to OperationServer will
|
|
// result in compilation errors.
|
|
type UnsafeOperationServer interface {
|
|
mustEmbedUnimplementedOperationServer()
|
|
}
|
|
|
|
func RegisterOperationServer(s grpc.ServiceRegistrar, srv OperationServer) {
|
|
s.RegisterService(&Operation_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Operation_Query_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(OperationServer).Query(&operationQueryServer{stream})
|
|
}
|
|
|
|
type Operation_QueryServer interface {
|
|
Send(*OperationQueryResponse) error
|
|
Recv() (*OperationQueryRequest, error)
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type operationQueryServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *operationQueryServer) Send(m *OperationQueryResponse) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *operationQueryServer) Recv() (*OperationQueryRequest, error) {
|
|
m := new(OperationQueryRequest)
|
|
if err := x.ServerStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func _Operation_Refresh_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(OperationQueryRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OperationServer).Refresh(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/Operation/Refresh",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OperationServer).Refresh(ctx, req.(*OperationQueryRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Operation_ServiceDesc is the grpc.ServiceDesc for Operation service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Operation_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "Operation",
|
|
HandlerType: (*OperationServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Refresh",
|
|
Handler: _Operation_Refresh_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Query",
|
|
Handler: _Operation_Query_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "protos/operation.proto",
|
|
}
|