adder

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

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var Adder_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "distributedcalculator.adder.v1.Adder",
	HandlerType: (*AdderServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Add",
			Handler:    _Adder_Add_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "adder/v1/adder.proto",
}

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

View Source
var File_adder_v1_adder_proto protoreflect.FileDescriptor

Functions

func RegisterAdderHandler

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

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

func RegisterAdderHandlerClient

func RegisterAdderHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AdderClient) error

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

func RegisterAdderHandlerFromEndpoint

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

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

func RegisterAdderHandlerServer

func RegisterAdderHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AdderServer) error

RegisterAdderHandlerServer registers the http handlers for service Adder to "mux". UnaryRPC :call AdderServer 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 RegisterAdderHandlerFromEndpoint instead.

func RegisterAdderServer

func RegisterAdderServer(s grpc.ServiceRegistrar, srv AdderServer)

Types

type AddRequest

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

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

Deprecated: Use AddRequest.ProtoReflect.Descriptor instead.

func (*AddRequest) GetOperandOne

func (x *AddRequest) GetOperandOne() string

func (*AddRequest) GetOperandTwo

func (x *AddRequest) GetOperandTwo() string

func (*AddRequest) ProtoMessage

func (*AddRequest) ProtoMessage()

func (*AddRequest) ProtoReflect

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

func (*AddRequest) Reset

func (x *AddRequest) Reset()

func (*AddRequest) String

func (x *AddRequest) String() string

type AddResponse

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

func (*AddResponse) Descriptor deprecated

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

Deprecated: Use AddResponse.ProtoReflect.Descriptor instead.

func (*AddResponse) GetResult

func (x *AddResponse) GetResult() string

func (*AddResponse) ProtoMessage

func (*AddResponse) ProtoMessage()

func (*AddResponse) ProtoReflect

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

func (*AddResponse) Reset

func (x *AddResponse) Reset()

func (*AddResponse) String

func (x *AddResponse) String() string

type AdderClient

type AdderClient interface {
	Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddResponse, error)
}

AdderClient is the client API for Adder 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 NewAdderClient

func NewAdderClient(cc grpc.ClientConnInterface) AdderClient

type AdderServer

type AdderServer interface {
	Add(context.Context, *AddRequest) (*AddResponse, error)
	// contains filtered or unexported methods
}

AdderServer is the server API for Adder service. All implementations must embed UnimplementedAdderServer for forward compatibility

type UnimplementedAdderServer

type UnimplementedAdderServer struct {
}

UnimplementedAdderServer must be embedded to have forward compatible implementations.

func (UnimplementedAdderServer) Add

type UnsafeAdderServer

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

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

Jump to

Keyboard shortcuts

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