go_echo_svr

package
v0.0.0-...-10ff639 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package go_echo_svr is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_go_echo_svr_proto protoreflect.FileDescriptor
View Source
var GoEchoSvr_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "go_echo_svr.go_echo_svr",
	HandlerType: (*GoEchoSvrServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Echo",
			Handler:    _GoEchoSvr_Echo_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "go_echo_svr.proto",
}

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

Functions

func RegisterGoEchoSvrHandler

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

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

func RegisterGoEchoSvrHandlerClient

func RegisterGoEchoSvrHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GoEchoSvrClient) error

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

func RegisterGoEchoSvrHandlerFromEndpoint

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

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

func RegisterGoEchoSvrHandlerServer

func RegisterGoEchoSvrHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GoEchoSvrServer) error

RegisterGoEchoSvrHandlerServer registers the http handlers for service GoEchoSvr to "mux". UnaryRPC :call GoEchoSvrServer 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 RegisterGoEchoSvrHandlerFromEndpoint instead.

func RegisterGoEchoSvrServer

func RegisterGoEchoSvrServer(s grpc.ServiceRegistrar, srv GoEchoSvrServer)

Types

type EchoReq

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

func (*EchoReq) Descriptor deprecated

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

Deprecated: Use EchoReq.ProtoReflect.Descriptor instead.

func (*EchoReq) GetPayload

func (x *EchoReq) GetPayload() string

func (*EchoReq) ProtoMessage

func (*EchoReq) ProtoMessage()

func (*EchoReq) ProtoReflect

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

func (*EchoReq) Reset

func (x *EchoReq) Reset()

func (*EchoReq) String

func (x *EchoReq) String() string

type EchoRsp

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

func (*EchoRsp) Descriptor deprecated

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

Deprecated: Use EchoRsp.ProtoReflect.Descriptor instead.

func (*EchoRsp) GetPayload

func (x *EchoRsp) GetPayload() string

func (*EchoRsp) ProtoMessage

func (*EchoRsp) ProtoMessage()

func (*EchoRsp) ProtoReflect

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

func (*EchoRsp) Reset

func (x *EchoRsp) Reset()

func (*EchoRsp) String

func (x *EchoRsp) String() string

type GoEchoSvrClient

type GoEchoSvrClient interface {
	Echo(ctx context.Context, in *EchoReq, opts ...grpc.CallOption) (*EchoRsp, error)
}

GoEchoSvrClient is the client API for GoEchoSvr 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 NewGoEchoSvrClient

func NewGoEchoSvrClient(cc grpc.ClientConnInterface) GoEchoSvrClient

type GoEchoSvrServer

type GoEchoSvrServer interface {
	Echo(context.Context, *EchoReq) (*EchoRsp, error)
}

GoEchoSvrServer is the server API for GoEchoSvr service. All implementations should embed UnimplementedGoEchoSvrServer for forward compatibility

type UnimplementedGoEchoSvrServer

type UnimplementedGoEchoSvrServer struct {
}

UnimplementedGoEchoSvrServer should be embedded to have forward compatible implementations.

func (UnimplementedGoEchoSvrServer) Echo

type UnsafeGoEchoSvrServer

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

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

Jump to

Keyboard shortcuts

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