Documentation
¶
Overview ¶
Package go_echo_svr is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterGoEchoSvrHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterGoEchoSvrHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GoEchoSvrClient) error
- func RegisterGoEchoSvrHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterGoEchoSvrHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GoEchoSvrServer) error
- func RegisterGoEchoSvrServer(s grpc.ServiceRegistrar, srv GoEchoSvrServer)
- type EchoReq
- type EchoRsp
- type GoEchoSvrClient
- type GoEchoSvrServer
- type UnimplementedGoEchoSvrServer
- type UnsafeGoEchoSvrServer
Constants ¶
This section is empty.
Variables ¶
var File_go_echo_svr_proto protoreflect.FileDescriptor
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) GetPayload ¶
func (*EchoReq) ProtoMessage ¶
func (*EchoReq) ProtoMessage()
func (*EchoReq) ProtoReflect ¶
func (x *EchoReq) ProtoReflect() protoreflect.Message
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) GetPayload ¶
func (*EchoRsp) ProtoMessage ¶
func (*EchoRsp) ProtoMessage()
func (*EchoRsp) ProtoReflect ¶
func (x *EchoRsp) ProtoReflect() protoreflect.Message
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 ¶
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.
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.