multiplier

package
v0.0.0-...-7c9a8cc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package multiplier is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_multiplier_v1_multiplier_proto protoreflect.FileDescriptor
View Source
var Multiplier_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "distributedcalculator.multiplier.v1.Multiplier",
	HandlerType: (*MultiplierServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Mul",
			Handler:    _Multiplier_Mul_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "multiplier/v1/multiplier.proto",
}

Multiplier_ServiceDesc is the grpc.ServiceDesc for Multiplier service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterMultiplierHandler

func RegisterMultiplierHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterMultiplierHandler registers the http handlers for service Multiplier to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterMultiplierHandlerClient

func RegisterMultiplierHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MultiplierClient) error

RegisterMultiplierHandlerClient registers the http handlers for service Multiplier to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MultiplierClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MultiplierClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MultiplierClient" to call the correct interceptors.

func RegisterMultiplierHandlerFromEndpoint

func RegisterMultiplierHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterMultiplierHandlerFromEndpoint is same as RegisterMultiplierHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterMultiplierHandlerServer

func RegisterMultiplierHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MultiplierServer) error

RegisterMultiplierHandlerServer registers the http handlers for service Multiplier to "mux". UnaryRPC :call MultiplierServer 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 RegisterMultiplierHandlerFromEndpoint instead.

func RegisterMultiplierServer

func RegisterMultiplierServer(s grpc.ServiceRegistrar, srv MultiplierServer)

Types

type MulRequest

type MulRequest 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 (*MulRequest) Descriptor deprecated

func (*MulRequest) Descriptor() ([]byte, []int)

Deprecated: Use MulRequest.ProtoReflect.Descriptor instead.

func (*MulRequest) GetOperandOne

func (x *MulRequest) GetOperandOne() string

func (*MulRequest) GetOperandTwo

func (x *MulRequest) GetOperandTwo() string

func (*MulRequest) ProtoMessage

func (*MulRequest) ProtoMessage()

func (*MulRequest) ProtoReflect

func (x *MulRequest) ProtoReflect() protoreflect.Message

func (*MulRequest) Reset

func (x *MulRequest) Reset()

func (*MulRequest) String

func (x *MulRequest) String() string

type MulResponse

type MulResponse struct {
	Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*MulResponse) Descriptor deprecated

func (*MulResponse) Descriptor() ([]byte, []int)

Deprecated: Use MulResponse.ProtoReflect.Descriptor instead.

func (*MulResponse) GetResult

func (x *MulResponse) GetResult() string

func (*MulResponse) ProtoMessage

func (*MulResponse) ProtoMessage()

func (*MulResponse) ProtoReflect

func (x *MulResponse) ProtoReflect() protoreflect.Message

func (*MulResponse) Reset

func (x *MulResponse) Reset()

func (*MulResponse) String

func (x *MulResponse) String() string

type MultiplierClient

type MultiplierClient interface {
	Mul(ctx context.Context, in *MulRequest, opts ...grpc.CallOption) (*MulResponse, error)
}

MultiplierClient is the client API for Multiplier 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 NewMultiplierClient

func NewMultiplierClient(cc grpc.ClientConnInterface) MultiplierClient

type MultiplierServer

type MultiplierServer interface {
	Mul(context.Context, *MulRequest) (*MulResponse, error)
	// contains filtered or unexported methods
}

MultiplierServer is the server API for Multiplier service. All implementations must embed UnimplementedMultiplierServer for forward compatibility

type UnimplementedMultiplierServer

type UnimplementedMultiplierServer struct {
}

UnimplementedMultiplierServer must be embedded to have forward compatible implementations.

func (UnimplementedMultiplierServer) Mul

type UnsafeMultiplierServer

type UnsafeMultiplierServer interface {
	// contains filtered or unexported methods
}

UnsafeMultiplierServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MultiplierServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL