Documentation ¶
Index ¶
- Variables
- func RegisterCalculatorServiceServer(s grpc.ServiceRegistrar, srv CalculatorServiceServer)
- type AvgRequest
- type AvgResponse
- type CalculatorServiceClient
- type CalculatorServiceServer
- type CalculatorService_AvgClient
- type CalculatorService_AvgServer
- type CalculatorService_MaxClient
- type CalculatorService_MaxServer
- type CalculatorService_PrimesClient
- type CalculatorService_PrimesServer
- type MaxRequest
- type MaxResponse
- type PrimeRequest
- type PrimeResponse
- type SqrtRequest
- type SqrtResponse
- type SumRequest
- func (*SumRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SumRequest) GetFirstNumber() int32
- func (x *SumRequest) GetSecondNumber() int32
- func (*SumRequest) ProtoMessage()
- func (x *SumRequest) ProtoReflect() protoreflect.Message
- func (x *SumRequest) Reset()
- func (x *SumRequest) String() string
- type SumResponse
- type UnimplementedCalculatorServiceServer
- func (UnimplementedCalculatorServiceServer) Avg(CalculatorService_AvgServer) error
- func (UnimplementedCalculatorServiceServer) Max(CalculatorService_MaxServer) error
- func (UnimplementedCalculatorServiceServer) Primes(*PrimeRequest, CalculatorService_PrimesServer) error
- func (UnimplementedCalculatorServiceServer) Sqrt(context.Context, *SqrtRequest) (*SqrtResponse, error)
- func (UnimplementedCalculatorServiceServer) Sum(context.Context, *SumRequest) (*SumResponse, error)
- type UnsafeCalculatorServiceServer
Constants ¶
This section is empty.
Variables ¶
var CalculatorService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "calculator.CalculatorService", HandlerType: (*CalculatorServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Sum", Handler: _CalculatorService_Sum_Handler, }, { MethodName: "Sqrt", Handler: _CalculatorService_Sqrt_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Primes", Handler: _CalculatorService_Primes_Handler, ServerStreams: true, }, { StreamName: "Avg", Handler: _CalculatorService_Avg_Handler, ClientStreams: true, }, { StreamName: "Max", Handler: _CalculatorService_Max_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "calculator.proto", }
CalculatorService_ServiceDesc is the grpc.ServiceDesc for CalculatorService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_avg_proto protoreflect.FileDescriptor
var File_calculator_proto protoreflect.FileDescriptor
var File_max_proto protoreflect.FileDescriptor
var File_primes_proto protoreflect.FileDescriptor
var File_sqrt_proto protoreflect.FileDescriptor
var File_sum_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCalculatorServiceServer ¶
func RegisterCalculatorServiceServer(s grpc.ServiceRegistrar, srv CalculatorServiceServer)
Types ¶
type AvgRequest ¶
type AvgRequest struct { Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // contains filtered or unexported fields }
func (*AvgRequest) Descriptor
deprecated
func (*AvgRequest) Descriptor() ([]byte, []int)
Deprecated: Use AvgRequest.ProtoReflect.Descriptor instead.
func (*AvgRequest) GetNumber ¶
func (x *AvgRequest) GetNumber() int32
func (*AvgRequest) ProtoMessage ¶
func (*AvgRequest) ProtoMessage()
func (*AvgRequest) ProtoReflect ¶
func (x *AvgRequest) ProtoReflect() protoreflect.Message
func (*AvgRequest) Reset ¶
func (x *AvgRequest) Reset()
func (*AvgRequest) String ¶
func (x *AvgRequest) String() string
type AvgResponse ¶
type AvgResponse struct { Result float64 `protobuf:"fixed64,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*AvgResponse) Descriptor
deprecated
func (*AvgResponse) Descriptor() ([]byte, []int)
Deprecated: Use AvgResponse.ProtoReflect.Descriptor instead.
func (*AvgResponse) GetResult ¶
func (x *AvgResponse) GetResult() float64
func (*AvgResponse) ProtoMessage ¶
func (*AvgResponse) ProtoMessage()
func (*AvgResponse) ProtoReflect ¶
func (x *AvgResponse) ProtoReflect() protoreflect.Message
func (*AvgResponse) Reset ¶
func (x *AvgResponse) Reset()
func (*AvgResponse) String ¶
func (x *AvgResponse) String() string
type CalculatorServiceClient ¶
type CalculatorServiceClient interface { Sum(ctx context.Context, in *SumRequest, opts ...grpc.CallOption) (*SumResponse, error) Primes(ctx context.Context, in *PrimeRequest, opts ...grpc.CallOption) (CalculatorService_PrimesClient, error) Avg(ctx context.Context, opts ...grpc.CallOption) (CalculatorService_AvgClient, error) Max(ctx context.Context, opts ...grpc.CallOption) (CalculatorService_MaxClient, error) Sqrt(ctx context.Context, in *SqrtRequest, opts ...grpc.CallOption) (*SqrtResponse, error) }
CalculatorServiceClient is the client API for CalculatorService 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.
func NewCalculatorServiceClient ¶
func NewCalculatorServiceClient(cc grpc.ClientConnInterface) CalculatorServiceClient
type CalculatorServiceServer ¶
type CalculatorServiceServer interface { Sum(context.Context, *SumRequest) (*SumResponse, error) Primes(*PrimeRequest, CalculatorService_PrimesServer) error Avg(CalculatorService_AvgServer) error Max(CalculatorService_MaxServer) error Sqrt(context.Context, *SqrtRequest) (*SqrtResponse, error) // contains filtered or unexported methods }
CalculatorServiceServer is the server API for CalculatorService service. All implementations must embed UnimplementedCalculatorServiceServer for forward compatibility
type CalculatorService_AvgClient ¶
type CalculatorService_AvgClient interface { Send(*AvgRequest) error CloseAndRecv() (*AvgResponse, error) grpc.ClientStream }
type CalculatorService_AvgServer ¶
type CalculatorService_AvgServer interface { SendAndClose(*AvgResponse) error Recv() (*AvgRequest, error) grpc.ServerStream }
type CalculatorService_MaxClient ¶
type CalculatorService_MaxClient interface { Send(*MaxRequest) error Recv() (*MaxResponse, error) grpc.ClientStream }
type CalculatorService_MaxServer ¶
type CalculatorService_MaxServer interface { Send(*MaxResponse) error Recv() (*MaxRequest, error) grpc.ServerStream }
type CalculatorService_PrimesClient ¶
type CalculatorService_PrimesClient interface { Recv() (*PrimeResponse, error) grpc.ClientStream }
type CalculatorService_PrimesServer ¶
type CalculatorService_PrimesServer interface { Send(*PrimeResponse) error grpc.ServerStream }
type MaxRequest ¶
type MaxRequest struct { Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // contains filtered or unexported fields }
func (*MaxRequest) Descriptor
deprecated
func (*MaxRequest) Descriptor() ([]byte, []int)
Deprecated: Use MaxRequest.ProtoReflect.Descriptor instead.
func (*MaxRequest) GetNumber ¶
func (x *MaxRequest) GetNumber() int32
func (*MaxRequest) ProtoMessage ¶
func (*MaxRequest) ProtoMessage()
func (*MaxRequest) ProtoReflect ¶
func (x *MaxRequest) ProtoReflect() protoreflect.Message
func (*MaxRequest) Reset ¶
func (x *MaxRequest) Reset()
func (*MaxRequest) String ¶
func (x *MaxRequest) String() string
type MaxResponse ¶
type MaxResponse struct { Result int32 `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*MaxResponse) Descriptor
deprecated
func (*MaxResponse) Descriptor() ([]byte, []int)
Deprecated: Use MaxResponse.ProtoReflect.Descriptor instead.
func (*MaxResponse) GetResult ¶
func (x *MaxResponse) GetResult() int32
func (*MaxResponse) ProtoMessage ¶
func (*MaxResponse) ProtoMessage()
func (*MaxResponse) ProtoReflect ¶
func (x *MaxResponse) ProtoReflect() protoreflect.Message
func (*MaxResponse) Reset ¶
func (x *MaxResponse) Reset()
func (*MaxResponse) String ¶
func (x *MaxResponse) String() string
type PrimeRequest ¶
type PrimeRequest struct { Number int64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // contains filtered or unexported fields }
func (*PrimeRequest) Descriptor
deprecated
func (*PrimeRequest) Descriptor() ([]byte, []int)
Deprecated: Use PrimeRequest.ProtoReflect.Descriptor instead.
func (*PrimeRequest) GetNumber ¶
func (x *PrimeRequest) GetNumber() int64
func (*PrimeRequest) ProtoMessage ¶
func (*PrimeRequest) ProtoMessage()
func (*PrimeRequest) ProtoReflect ¶
func (x *PrimeRequest) ProtoReflect() protoreflect.Message
func (*PrimeRequest) Reset ¶
func (x *PrimeRequest) Reset()
func (*PrimeRequest) String ¶
func (x *PrimeRequest) String() string
type PrimeResponse ¶
type PrimeResponse struct { Result int64 `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*PrimeResponse) Descriptor
deprecated
func (*PrimeResponse) Descriptor() ([]byte, []int)
Deprecated: Use PrimeResponse.ProtoReflect.Descriptor instead.
func (*PrimeResponse) GetResult ¶
func (x *PrimeResponse) GetResult() int64
func (*PrimeResponse) ProtoMessage ¶
func (*PrimeResponse) ProtoMessage()
func (*PrimeResponse) ProtoReflect ¶
func (x *PrimeResponse) ProtoReflect() protoreflect.Message
func (*PrimeResponse) Reset ¶
func (x *PrimeResponse) Reset()
func (*PrimeResponse) String ¶
func (x *PrimeResponse) String() string
type SqrtRequest ¶
type SqrtRequest struct { Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // could be uint32 // contains filtered or unexported fields }
func (*SqrtRequest) Descriptor
deprecated
func (*SqrtRequest) Descriptor() ([]byte, []int)
Deprecated: Use SqrtRequest.ProtoReflect.Descriptor instead.
func (*SqrtRequest) GetNumber ¶
func (x *SqrtRequest) GetNumber() int32
func (*SqrtRequest) ProtoMessage ¶
func (*SqrtRequest) ProtoMessage()
func (*SqrtRequest) ProtoReflect ¶
func (x *SqrtRequest) ProtoReflect() protoreflect.Message
func (*SqrtRequest) Reset ¶
func (x *SqrtRequest) Reset()
func (*SqrtRequest) String ¶
func (x *SqrtRequest) String() string
type SqrtResponse ¶
type SqrtResponse struct { Result float64 `protobuf:"fixed64,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*SqrtResponse) Descriptor
deprecated
func (*SqrtResponse) Descriptor() ([]byte, []int)
Deprecated: Use SqrtResponse.ProtoReflect.Descriptor instead.
func (*SqrtResponse) GetResult ¶
func (x *SqrtResponse) GetResult() float64
func (*SqrtResponse) ProtoMessage ¶
func (*SqrtResponse) ProtoMessage()
func (*SqrtResponse) ProtoReflect ¶
func (x *SqrtResponse) ProtoReflect() protoreflect.Message
func (*SqrtResponse) Reset ¶
func (x *SqrtResponse) Reset()
func (*SqrtResponse) String ¶
func (x *SqrtResponse) String() string
type SumRequest ¶
type SumRequest struct { FirstNumber int32 `protobuf:"varint,1,opt,name=first_number,json=firstNumber,proto3" json:"first_number,omitempty"` SecondNumber int32 `protobuf:"varint,2,opt,name=second_number,json=secondNumber,proto3" json:"second_number,omitempty"` // contains filtered or unexported fields }
func (*SumRequest) Descriptor
deprecated
func (*SumRequest) Descriptor() ([]byte, []int)
Deprecated: Use SumRequest.ProtoReflect.Descriptor instead.
func (*SumRequest) GetFirstNumber ¶
func (x *SumRequest) GetFirstNumber() int32
func (*SumRequest) GetSecondNumber ¶
func (x *SumRequest) GetSecondNumber() int32
func (*SumRequest) ProtoMessage ¶
func (*SumRequest) ProtoMessage()
func (*SumRequest) ProtoReflect ¶
func (x *SumRequest) ProtoReflect() protoreflect.Message
func (*SumRequest) Reset ¶
func (x *SumRequest) Reset()
func (*SumRequest) String ¶
func (x *SumRequest) String() string
type SumResponse ¶
type SumResponse struct { Result int32 `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*SumResponse) Descriptor
deprecated
func (*SumResponse) Descriptor() ([]byte, []int)
Deprecated: Use SumResponse.ProtoReflect.Descriptor instead.
func (*SumResponse) GetResult ¶
func (x *SumResponse) GetResult() int32
func (*SumResponse) ProtoMessage ¶
func (*SumResponse) ProtoMessage()
func (*SumResponse) ProtoReflect ¶
func (x *SumResponse) ProtoReflect() protoreflect.Message
func (*SumResponse) Reset ¶
func (x *SumResponse) Reset()
func (*SumResponse) String ¶
func (x *SumResponse) String() string
type UnimplementedCalculatorServiceServer ¶
type UnimplementedCalculatorServiceServer struct { }
UnimplementedCalculatorServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedCalculatorServiceServer) Sqrt ¶
func (UnimplementedCalculatorServiceServer) Sqrt(context.Context, *SqrtRequest) (*SqrtResponse, error)
func (UnimplementedCalculatorServiceServer) Sum ¶
func (UnimplementedCalculatorServiceServer) Sum(context.Context, *SumRequest) (*SumResponse, error)
type UnsafeCalculatorServiceServer ¶
type UnsafeCalculatorServiceServer interface {
// contains filtered or unexported methods
}
UnsafeCalculatorServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CalculatorServiceServer will result in compilation errors.