Documentation ¶
Overview ¶
Package echov1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- 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
- func (m *EchoRequest) ValidateAll() error
- type EchoRequestMultiError
- 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) GetClientMetadata() map[string]string
- 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
- func (m *EchoResponse) ValidateAll() error
- type EchoResponseMultiError
- 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 ¶
const (
EchoService_Echo_FullMethodName = "/echo.v1.EchoService/Echo"
)
Variables ¶
var EchoService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "echo.v1.EchoService", HandlerType: (*EchoServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Echo", Handler: _EchoService_Echo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "echo/echo.proto", }
EchoService_ServiceDesc is the grpc.ServiceDesc for EchoService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_echo_echo_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 { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
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, the first error encountered is returned, or nil if there are no violations.
func (*EchoRequest) ValidateAll ¶
func (m *EchoRequest) ValidateAll() error
ValidateAll checks the field values on EchoRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in EchoRequestMultiError, or nil if none found.
type EchoRequestMultiError ¶
type EchoRequestMultiError []error
EchoRequestMultiError is an error wrapping multiple validation errors returned by EchoRequest.ValidateAll() if the designated constraints aren't met.
func (EchoRequestMultiError) AllErrors ¶
func (m EchoRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (EchoRequestMultiError) Error ¶
func (m EchoRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
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"` ClientMetadata map[string]string `` /* 191-byte string literal not displayed */ // contains filtered or unexported fields }
func (*EchoResponse) Descriptor
deprecated
func (*EchoResponse) Descriptor() ([]byte, []int)
Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.
func (*EchoResponse) GetClientMetadata ¶
func (x *EchoResponse) GetClientMetadata() map[string]string
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, the first error encountered is returned, or nil if there are no violations.
func (*EchoResponse) ValidateAll ¶
func (m *EchoResponse) ValidateAll() error
ValidateAll checks the field values on EchoResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in EchoResponseMultiError, or nil if none found.
type EchoResponseMultiError ¶
type EchoResponseMultiError []error
EchoResponseMultiError is an error wrapping multiple validation errors returned by EchoResponse.ValidateAll() if the designated constraints aren't met.
func (EchoResponseMultiError) AllErrors ¶
func (m EchoResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (EchoResponseMultiError) Error ¶
func (m EchoResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
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.