Documentation ¶
Overview ¶
Package echo is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterCalServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterCalServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CalServiceClient) error
- func RegisterCalServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterCalServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CalServiceServer) error
- func RegisterCalServiceServer(s *grpc.Server, srv CalServiceServer)
- func RegisterEchoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterEchoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EchoServiceClient) error
- func RegisterEchoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterEchoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EchoServiceServer) error
- func RegisterEchoServiceServer(s *grpc.Server, srv EchoServiceServer)
- type CalReq
- type CalRes
- type CalServiceClient
- type CalServiceServer
- type EchoReq
- type EchoRes
- type EchoServiceClient
- type EchoServiceServer
- type Info
- type UnimplementedCalServiceServer
- type UnimplementedEchoServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_echo_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCalServiceHandler ¶
func RegisterCalServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterCalServiceHandler registers the http handlers for service CalService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterCalServiceHandlerClient ¶
func RegisterCalServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CalServiceClient) error
RegisterCalServiceHandlerClient registers the http handlers for service CalService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CalServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CalServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CalServiceClient" to call the correct interceptors.
func RegisterCalServiceHandlerFromEndpoint ¶
func RegisterCalServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterCalServiceHandlerFromEndpoint is same as RegisterCalServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterCalServiceHandlerServer ¶
func RegisterCalServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CalServiceServer) error
RegisterCalServiceHandlerServer registers the http handlers for service CalService to "mux". UnaryRPC :call CalServiceServer 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 RegisterCalServiceHandlerFromEndpoint instead.
func RegisterCalServiceServer ¶
func RegisterCalServiceServer(s *grpc.Server, srv CalServiceServer)
func RegisterEchoServiceHandler ¶
func RegisterEchoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterEchoServiceHandler registers the http handlers for service EchoService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterEchoServiceHandlerClient ¶
func RegisterEchoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EchoServiceClient) error
RegisterEchoServiceHandlerClient registers the http handlers for service EchoService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EchoServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EchoServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "EchoServiceClient" to call the correct interceptors.
func RegisterEchoServiceHandlerFromEndpoint ¶
func RegisterEchoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterEchoServiceHandlerFromEndpoint is same as RegisterEchoServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterEchoServiceHandlerServer ¶
func RegisterEchoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EchoServiceServer) error
RegisterEchoServiceHandlerServer registers the http handlers for service EchoService to "mux". UnaryRPC :call EchoServiceServer 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 RegisterEchoServiceHandlerFromEndpoint instead.
func RegisterEchoServiceServer ¶
func RegisterEchoServiceServer(s *grpc.Server, srv EchoServiceServer)
Types ¶
type CalReq ¶
type CalReq struct { Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` Info *Info `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` // contains filtered or unexported fields }
func (*CalReq) Descriptor
deprecated
func (*CalReq) ProtoMessage ¶
func (*CalReq) ProtoMessage()
func (*CalReq) ProtoReflect ¶
func (x *CalReq) ProtoReflect() protoreflect.Message
type CalRes ¶
type CalRes struct { Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` Result int64 `protobuf:"varint,2,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*CalRes) Descriptor
deprecated
func (*CalRes) ProtoMessage ¶
func (*CalRes) ProtoMessage()
func (*CalRes) ProtoReflect ¶
func (x *CalRes) ProtoReflect() protoreflect.Message
type CalServiceClient ¶
type CalServiceClient interface {
Cal(ctx context.Context, in *CalReq, opts ...grpc.CallOption) (*CalRes, error)
}
CalServiceClient is the client API for CalService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCalServiceClient ¶
func NewCalServiceClient(cc grpc.ClientConnInterface) CalServiceClient
type CalServiceServer ¶
CalServiceServer is the server API for CalService service.
type EchoReq ¶
type EchoReq struct { Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Age int32 `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"` // contains filtered or unexported fields }
func (*EchoReq) Descriptor
deprecated
func (*EchoReq) ProtoMessage ¶
func (*EchoReq) ProtoMessage()
func (*EchoReq) ProtoReflect ¶
func (x *EchoReq) ProtoReflect() protoreflect.Message
type EchoRes ¶
type EchoRes struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"` // contains filtered or unexported fields }
func (*EchoRes) Descriptor
deprecated
func (*EchoRes) ProtoMessage ¶
func (*EchoRes) ProtoMessage()
func (*EchoRes) ProtoReflect ¶
func (x *EchoRes) ProtoReflect() protoreflect.Message
type EchoServiceClient ¶
type EchoServiceClient interface {
Echo(ctx context.Context, in *EchoReq, opts ...grpc.CallOption) (*EchoRes, error)
}
EchoServiceClient is the client API for EchoService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewEchoServiceClient ¶
func NewEchoServiceClient(cc grpc.ClientConnInterface) EchoServiceClient
type EchoServiceServer ¶
EchoServiceServer is the server API for EchoService service.
type Info ¶
type Info struct { Op string `protobuf:"bytes,1,opt,name=op,proto3" json:"op,omitempty"` A int64 `protobuf:"varint,2,opt,name=a,proto3" json:"a,omitempty"` B int64 `protobuf:"varint,3,opt,name=b,proto3" json:"b,omitempty"` // contains filtered or unexported fields }
func (*Info) Descriptor
deprecated
func (*Info) ProtoMessage ¶
func (*Info) ProtoMessage()
func (*Info) ProtoReflect ¶
func (x *Info) ProtoReflect() protoreflect.Message
type UnimplementedCalServiceServer ¶
type UnimplementedCalServiceServer struct { }
UnimplementedCalServiceServer can be embedded to have forward compatible implementations.
type UnimplementedEchoServiceServer ¶
type UnimplementedEchoServiceServer struct { }
UnimplementedEchoServiceServer can be embedded to have forward compatible implementations.