Documentation
¶
Overview ¶
Package echo shows a simple RPC service that can be served with rpcz.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var File_echo_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Echo ¶
type Echo struct{}
Echo service replies back with the message it receives.
func (*Echo) Echo ¶
func (s *Echo) Echo(ctx context.Context, req *EchoRequest, resp *EchoResponse) error
Echo handles req and fills in resp.
type EchoRequest ¶
type EchoRequest struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` Delay int64 `protobuf:"varint,2,opt,name=delay,proto3" json:"delay,omitempty"` // contains filtered or unexported fields }
func (*EchoRequest) Descriptor
deprecated
func (*EchoRequest) Descriptor() ([]byte, []int)
Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.
func (*EchoRequest) GetDelay ¶
func (x *EchoRequest) GetDelay() int64
func (*EchoRequest) GetMsg ¶
func (x *EchoRequest) GetMsg() 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
type EchoResponse ¶
type EchoResponse struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` // contains filtered or unexported fields }
func (*EchoResponse) Descriptor
deprecated
func (*EchoResponse) Descriptor() ([]byte, []int)
Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.
func (*EchoResponse) GetMsg ¶
func (x *EchoResponse) GetMsg() 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
type ExtendedEcho ¶
type ExtendedEcho struct {
// contains filtered or unexported fields
}
ExtendedEcho service replies back with the message it receives.
It shows an example of service-side and caller-defined timeouts.
func NewExtendedEcho ¶
func NewExtendedEcho(timeout time.Duration) *ExtendedEcho
NewExtendedEcho returns a new ExtendedEcho with the specified timeout.
func (*ExtendedEcho) Echo ¶
func (s *ExtendedEcho) Echo(ctx context.Context, req *EchoRequest, resp *EchoResponse) error
Echo handles req and fills in resp.
The service may wait for req.Delay, if specified, but no longer than s.timeout.
Click to show internal directories.
Click to hide internal directories.