subtractor

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 subtractor is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_subtractor_v1_subtractor_proto protoreflect.FileDescriptor
View Source
var Subtractor_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "distributedcalculator.subtractor.v1.Subtractor",
	HandlerType: (*SubtractorServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Sub",
			Handler:    _Subtractor_Sub_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "subtractor/v1/subtractor.proto",
}

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

Functions

func RegisterSubtractorHandler

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

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

func RegisterSubtractorHandlerClient

func RegisterSubtractorHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SubtractorClient) error

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

func RegisterSubtractorHandlerFromEndpoint

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

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

func RegisterSubtractorHandlerServer

func RegisterSubtractorHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SubtractorServer) error

RegisterSubtractorHandlerServer registers the http handlers for service Subtractor to "mux". UnaryRPC :call SubtractorServer 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 RegisterSubtractorHandlerFromEndpoint instead.

func RegisterSubtractorServer

func RegisterSubtractorServer(s grpc.ServiceRegistrar, srv SubtractorServer)

Types

type SubRequest

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

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

Deprecated: Use SubRequest.ProtoReflect.Descriptor instead.

func (*SubRequest) GetOperandOne

func (x *SubRequest) GetOperandOne() string

func (*SubRequest) GetOperandTwo

func (x *SubRequest) GetOperandTwo() string

func (*SubRequest) ProtoMessage

func (*SubRequest) ProtoMessage()

func (*SubRequest) ProtoReflect

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

func (*SubRequest) Reset

func (x *SubRequest) Reset()

func (*SubRequest) String

func (x *SubRequest) String() string

type SubResponse

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

func (*SubResponse) Descriptor deprecated

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

Deprecated: Use SubResponse.ProtoReflect.Descriptor instead.

func (*SubResponse) GetResult

func (x *SubResponse) GetResult() string

func (*SubResponse) ProtoMessage

func (*SubResponse) ProtoMessage()

func (*SubResponse) ProtoReflect

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

func (*SubResponse) Reset

func (x *SubResponse) Reset()

func (*SubResponse) String

func (x *SubResponse) String() string

type SubtractorClient

type SubtractorClient interface {
	Sub(ctx context.Context, in *SubRequest, opts ...grpc.CallOption) (*SubResponse, error)
}

SubtractorClient is the client API for Subtractor 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 NewSubtractorClient

func NewSubtractorClient(cc grpc.ClientConnInterface) SubtractorClient

type SubtractorServer

type SubtractorServer interface {
	Sub(context.Context, *SubRequest) (*SubResponse, error)
	// contains filtered or unexported methods
}

SubtractorServer is the server API for Subtractor service. All implementations must embed UnimplementedSubtractorServer for forward compatibility

type UnimplementedSubtractorServer

type UnimplementedSubtractorServer struct {
}

UnimplementedSubtractorServer must be embedded to have forward compatible implementations.

func (UnimplementedSubtractorServer) Sub

type UnsafeSubtractorServer

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

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

Jump to

Keyboard shortcuts

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