Documentation ¶
Overview ¶
Package echo is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- 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.ServiceRegistrar, srv EchoServiceServer)
- type EchoRequest
- func (*EchoRequest) Descriptor() ([]byte, []int)deprecated
- func (x *EchoRequest) GetMessage() string
- func (*EchoRequest) ProtoMessage()
- func (x *EchoRequest) ProtoReflect() protoreflect.Message
- func (x *EchoRequest) Reset()
- func (x *EchoRequest) String() string
- func (m *EchoRequest) Validate() error
- type EchoRequestValidationError
- func (e EchoRequestValidationError) Cause() error
- func (e EchoRequestValidationError) Error() string
- func (e EchoRequestValidationError) ErrorName() string
- func (e EchoRequestValidationError) Field() string
- func (e EchoRequestValidationError) Key() bool
- func (e EchoRequestValidationError) Reason() string
- type EchoResponse
- func (*EchoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *EchoResponse) GetMessage() string
- func (*EchoResponse) ProtoMessage()
- func (x *EchoResponse) ProtoReflect() protoreflect.Message
- func (x *EchoResponse) Reset()
- func (x *EchoResponse) String() string
- func (m *EchoResponse) Validate() error
- type EchoResponseValidationError
- func (e EchoResponseValidationError) Cause() error
- func (e EchoResponseValidationError) Error() string
- func (e EchoResponseValidationError) ErrorName() string
- func (e EchoResponseValidationError) Field() string
- func (e EchoResponseValidationError) Key() bool
- func (e EchoResponseValidationError) Reason() string
- type EchoServiceClient
- type EchoServiceServer
- type UnimplementedEchoServiceServer
- type UnsafeEchoServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_echo_service_proto protoreflect.FileDescriptor
Functions ¶
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.ServiceRegistrar, srv EchoServiceServer)
Types ¶
type EchoRequest ¶
type EchoRequest struct { // The message that needs to be echoed. Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
The request message for EchoService.Echo.
func (*EchoRequest) Descriptor
deprecated
func (*EchoRequest) Descriptor() ([]byte, []int)
Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.
func (*EchoRequest) GetMessage ¶
func (x *EchoRequest) GetMessage() string
func (*EchoRequest) ProtoMessage ¶
func (*EchoRequest) ProtoMessage()
func (*EchoRequest) ProtoReflect ¶
func (x *EchoRequest) ProtoReflect() protoreflect.Message
func (*EchoRequest) Reset ¶
func (x *EchoRequest) Reset()
func (*EchoRequest) String ¶
func (x *EchoRequest) String() string
func (*EchoRequest) Validate ¶
func (m *EchoRequest) Validate() error
Validate checks the field values on EchoRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type EchoRequestValidationError ¶
type EchoRequestValidationError struct {
// contains filtered or unexported fields
}
EchoRequestValidationError is the validation error returned by EchoRequest.Validate if the designated constraints aren't met.
func (EchoRequestValidationError) Cause ¶
func (e EchoRequestValidationError) Cause() error
Cause function returns cause value.
func (EchoRequestValidationError) Error ¶
func (e EchoRequestValidationError) Error() string
Error satisfies the builtin error interface
func (EchoRequestValidationError) ErrorName ¶
func (e EchoRequestValidationError) ErrorName() string
ErrorName returns error name.
func (EchoRequestValidationError) Field ¶
func (e EchoRequestValidationError) Field() string
Field function returns field value.
func (EchoRequestValidationError) Key ¶
func (e EchoRequestValidationError) Key() bool
Key function returns key value.
func (EchoRequestValidationError) Reason ¶
func (e EchoRequestValidationError) Reason() string
Reason function returns reason value.
type EchoResponse ¶
type EchoResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
The response message for EchoService.Echo.
func (*EchoResponse) Descriptor
deprecated
func (*EchoResponse) Descriptor() ([]byte, []int)
Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.
func (*EchoResponse) GetMessage ¶
func (x *EchoResponse) GetMessage() string
func (*EchoResponse) ProtoMessage ¶
func (*EchoResponse) ProtoMessage()
func (*EchoResponse) ProtoReflect ¶
func (x *EchoResponse) ProtoReflect() protoreflect.Message
func (*EchoResponse) Reset ¶
func (x *EchoResponse) Reset()
func (*EchoResponse) String ¶
func (x *EchoResponse) String() string
func (*EchoResponse) Validate ¶
func (m *EchoResponse) Validate() error
Validate checks the field values on EchoResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type EchoResponseValidationError ¶
type EchoResponseValidationError struct {
// contains filtered or unexported fields
}
EchoResponseValidationError is the validation error returned by EchoResponse.Validate if the designated constraints aren't met.
func (EchoResponseValidationError) Cause ¶
func (e EchoResponseValidationError) Cause() error
Cause function returns cause value.
func (EchoResponseValidationError) Error ¶
func (e EchoResponseValidationError) Error() string
Error satisfies the builtin error interface
func (EchoResponseValidationError) ErrorName ¶
func (e EchoResponseValidationError) ErrorName() string
ErrorName returns error name.
func (EchoResponseValidationError) Field ¶
func (e EchoResponseValidationError) Field() string
Field function returns field value.
func (EchoResponseValidationError) Key ¶
func (e EchoResponseValidationError) Key() bool
Key function returns key value.
func (EchoResponseValidationError) Reason ¶
func (e EchoResponseValidationError) Reason() string
Reason function returns reason value.
type EchoServiceClient ¶
type EchoServiceClient interface {
Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
}
EchoServiceClient is the client API for EchoService 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 NewEchoServiceClient ¶
func NewEchoServiceClient(cc grpc.ClientConnInterface) EchoServiceClient
type EchoServiceServer ¶
type EchoServiceServer interface { Echo(context.Context, *EchoRequest) (*EchoResponse, error) // contains filtered or unexported methods }
EchoServiceServer is the server API for EchoService service. All implementations must embed UnimplementedEchoServiceServer for forward compatibility
type UnimplementedEchoServiceServer ¶
type UnimplementedEchoServiceServer struct{}
UnimplementedEchoServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedEchoServiceServer) Echo ¶
func (UnimplementedEchoServiceServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error)
type UnsafeEchoServiceServer ¶
type UnsafeEchoServiceServer interface {
// contains filtered or unexported methods
}
UnsafeEchoServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EchoServiceServer will result in compilation errors.