Documentation ¶
Overview ¶
Package divider is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterDividerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterDividerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DividerClient) error
- func RegisterDividerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterDividerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DividerServer) error
- func RegisterDividerServer(s grpc.ServiceRegistrar, srv DividerServer)
- type DivRequest
- func (*DivRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DivRequest) GetOperandOne() string
- func (x *DivRequest) GetOperandTwo() string
- func (*DivRequest) ProtoMessage()
- func (x *DivRequest) ProtoReflect() protoreflect.Message
- func (x *DivRequest) Reset()
- func (x *DivRequest) String() string
- type DivResponse
- type DividerClient
- type DividerServer
- type UnimplementedDividerServer
- type UnsafeDividerServer
Constants ¶
This section is empty.
Variables ¶
var Divider_ServiceDesc = grpc.ServiceDesc{ ServiceName: "distributedcalculator.divider.v1.Divider", HandlerType: (*DividerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Div", Handler: _Divider_Div_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "divider/v1/divider.proto", }
Divider_ServiceDesc is the grpc.ServiceDesc for Divider service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_divider_v1_divider_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDividerHandler ¶
func RegisterDividerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterDividerHandler registers the http handlers for service Divider to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterDividerHandlerClient ¶
func RegisterDividerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DividerClient) error
RegisterDividerHandlerClient registers the http handlers for service Divider to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DividerClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DividerClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "DividerClient" to call the correct interceptors.
func RegisterDividerHandlerFromEndpoint ¶
func RegisterDividerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterDividerHandlerFromEndpoint is same as RegisterDividerHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterDividerHandlerServer ¶
func RegisterDividerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DividerServer) error
RegisterDividerHandlerServer registers the http handlers for service Divider to "mux". UnaryRPC :call DividerServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDividerHandlerFromEndpoint instead.
func RegisterDividerServer ¶
func RegisterDividerServer(s grpc.ServiceRegistrar, srv DividerServer)
Types ¶
type DivRequest ¶
type DivRequest struct { OperandOne string `protobuf:"bytes,1,opt,name=operand_one,json=operandOne,proto3" json:"operand_one,omitempty"` OperandTwo string `protobuf:"bytes,2,opt,name=operand_two,json=operandTwo,proto3" json:"operand_two,omitempty"` // contains filtered or unexported fields }
func (*DivRequest) Descriptor
deprecated
func (*DivRequest) Descriptor() ([]byte, []int)
Deprecated: Use DivRequest.ProtoReflect.Descriptor instead.
func (*DivRequest) GetOperandOne ¶
func (x *DivRequest) GetOperandOne() string
func (*DivRequest) GetOperandTwo ¶
func (x *DivRequest) GetOperandTwo() string
func (*DivRequest) ProtoMessage ¶
func (*DivRequest) ProtoMessage()
func (*DivRequest) ProtoReflect ¶
func (x *DivRequest) ProtoReflect() protoreflect.Message
func (*DivRequest) Reset ¶
func (x *DivRequest) Reset()
func (*DivRequest) String ¶
func (x *DivRequest) String() string
type DivResponse ¶
type DivResponse struct { Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*DivResponse) Descriptor
deprecated
func (*DivResponse) Descriptor() ([]byte, []int)
Deprecated: Use DivResponse.ProtoReflect.Descriptor instead.
func (*DivResponse) GetResult ¶
func (x *DivResponse) GetResult() string
func (*DivResponse) ProtoMessage ¶
func (*DivResponse) ProtoMessage()
func (*DivResponse) ProtoReflect ¶
func (x *DivResponse) ProtoReflect() protoreflect.Message
func (*DivResponse) Reset ¶
func (x *DivResponse) Reset()
func (*DivResponse) String ¶
func (x *DivResponse) String() string
type DividerClient ¶
type DividerClient interface {
Div(ctx context.Context, in *DivRequest, opts ...grpc.CallOption) (*DivResponse, error)
}
DividerClient is the client API for Divider 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 NewDividerClient ¶
func NewDividerClient(cc grpc.ClientConnInterface) DividerClient
type DividerServer ¶
type DividerServer interface { Div(context.Context, *DivRequest) (*DivResponse, error) // contains filtered or unexported methods }
DividerServer is the server API for Divider service. All implementations must embed UnimplementedDividerServer for forward compatibility
type UnimplementedDividerServer ¶
type UnimplementedDividerServer struct { }
UnimplementedDividerServer must be embedded to have forward compatible implementations.
func (UnimplementedDividerServer) Div ¶
func (UnimplementedDividerServer) Div(context.Context, *DivRequest) (*DivResponse, error)
type UnsafeDividerServer ¶
type UnsafeDividerServer interface {
// contains filtered or unexported methods
}
UnsafeDividerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DividerServer will result in compilation errors.