Documentation ¶
Index ¶
- Constants
- func NewSRPCEchoerHandler(impl SRPCEchoerServer, serviceID string) srpc.Handler
- func SRPCRegisterEchoer(mux srpc.Mux, impl SRPCEchoerServer) error
- type EchoMsg
- func (m *EchoMsg) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *EchoMsg) CloneVT() *EchoMsg
- func (this *EchoMsg) EqualMessageVT(thatMsg any) bool
- func (this *EchoMsg) EqualVT(that *EchoMsg) bool
- func (x *EchoMsg) GetBody() string
- func (x *EchoMsg) MarshalJSON() ([]byte, error)
- func (x *EchoMsg) MarshalProtoJSON(s *json.MarshalState)
- func (x *EchoMsg) MarshalProtoText() string
- func (m *EchoMsg) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *EchoMsg) MarshalToVT(dAtA []byte) (int, error)
- func (m *EchoMsg) MarshalVT() (dAtA []byte, err error)
- func (*EchoMsg) ProtoMessage()
- func (x *EchoMsg) Reset()
- func (m *EchoMsg) SizeVT() (n int)
- func (x *EchoMsg) String() string
- func (x *EchoMsg) UnmarshalJSON(b []byte) error
- func (x *EchoMsg) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *EchoMsg) UnmarshalVT(dAtA []byte) error
- type EchoServer
- func (r *EchoServer) DoNothing(ctx context.Context, empty *emptypb.Empty) (*emptypb.Empty, error)
- func (*EchoServer) Echo(ctx context.Context, msg *EchoMsg) (*EchoMsg, error)
- func (s *EchoServer) EchoBidiStream(strm SRPCEchoer_EchoBidiStreamStream) error
- func (*EchoServer) EchoClientStream(strm SRPCEchoer_EchoClientStreamStream) (*EchoMsg, error)
- func (*EchoServer) EchoServerStream(msg *EchoMsg, strm SRPCEchoer_EchoServerStreamStream) error
- func (e *EchoServer) Register(mux srpc.Mux) error
- func (r *EchoServer) RpcStream(stream SRPCEchoer_RpcStreamStream) error
- type SRPCEchoerClient
- type SRPCEchoerHandler
- func (SRPCEchoerHandler) GetMethodIDs() []string
- func (d *SRPCEchoerHandler) GetServiceID() string
- func (d *SRPCEchoerHandler) InvokeMethod(serviceID, methodID string, strm srpc.Stream) (bool, error)
- func (SRPCEchoerHandler) InvokeMethod_DoNothing(impl SRPCEchoerServer, strm srpc.Stream) error
- func (SRPCEchoerHandler) InvokeMethod_Echo(impl SRPCEchoerServer, strm srpc.Stream) error
- func (SRPCEchoerHandler) InvokeMethod_EchoBidiStream(impl SRPCEchoerServer, strm srpc.Stream) error
- func (SRPCEchoerHandler) InvokeMethod_EchoClientStream(impl SRPCEchoerServer, strm srpc.Stream) error
- func (SRPCEchoerHandler) InvokeMethod_EchoServerStream(impl SRPCEchoerServer, strm srpc.Stream) error
- func (SRPCEchoerHandler) InvokeMethod_RpcStream(impl SRPCEchoerServer, strm srpc.Stream) error
- type SRPCEchoerServer
- type SRPCEchoer_DoNothingStream
- type SRPCEchoer_EchoBidiStreamClient
- type SRPCEchoer_EchoBidiStreamStream
- type SRPCEchoer_EchoClientStreamClient
- type SRPCEchoer_EchoClientStreamStream
- type SRPCEchoer_EchoServerStreamClient
- type SRPCEchoer_EchoServerStreamStream
- type SRPCEchoer_EchoStream
- type SRPCEchoer_RpcStreamClient
- type SRPCEchoer_RpcStreamStream
Constants ¶
const SRPCEchoerServiceID = "echo.Echoer"
Variables ¶
This section is empty.
Functions ¶
func NewSRPCEchoerHandler ¶ added in v0.10.9
func NewSRPCEchoerHandler(impl SRPCEchoerServer, serviceID string) srpc.Handler
NewSRPCEchoerHandler constructs a new RPC handler. serviceID: if empty, uses default: echo.Echoer
func SRPCRegisterEchoer ¶
func SRPCRegisterEchoer(mux srpc.Mux, impl SRPCEchoerServer) error
SRPCRegisterEchoer registers the implementation with the mux. Uses the default serviceID: echo.Echoer
Types ¶
type EchoMsg ¶
type EchoMsg struct { Body string `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` // contains filtered or unexported fields }
EchoMsg is the message body for Echo.
func (*EchoMsg) CloneMessageVT ¶ added in v0.18.3
func (m *EchoMsg) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*EchoMsg) EqualMessageVT ¶ added in v0.18.3
func (*EchoMsg) MarshalJSON ¶ added in v0.30.0
MarshalJSON marshals the EchoMsg to JSON.
func (*EchoMsg) MarshalProtoJSON ¶ added in v0.30.0
func (x *EchoMsg) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the EchoMsg message to JSON.
func (*EchoMsg) MarshalProtoText ¶ added in v0.31.4
func (*EchoMsg) MarshalToSizedBufferVT ¶
func (*EchoMsg) ProtoMessage ¶
func (*EchoMsg) ProtoMessage()
func (*EchoMsg) UnmarshalJSON ¶ added in v0.30.1
UnmarshalJSON unmarshals the EchoMsg from JSON.
func (*EchoMsg) UnmarshalProtoJSON ¶ added in v0.30.1
func (x *EchoMsg) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the EchoMsg message from JSON.
func (*EchoMsg) UnmarshalVT ¶
type EchoServer ¶
type EchoServer struct {
// contains filtered or unexported fields
}
EchoServer implements the server side of Echo.
func NewEchoServer ¶ added in v0.5.0
func NewEchoServer(rpcStreamMux srpc.Mux) *EchoServer
NewEchoServer constructs a EchoServer with a RpcStream mux.
func (*EchoServer) EchoBidiStream ¶
func (s *EchoServer) EchoBidiStream(strm SRPCEchoer_EchoBidiStreamStream) error
EchoBidiStream implements SRPCEchoerServer
func (*EchoServer) EchoClientStream ¶
func (*EchoServer) EchoClientStream(strm SRPCEchoer_EchoClientStreamStream) (*EchoMsg, error)
EchoClientStream implements SRPCEchoerServer
func (*EchoServer) EchoServerStream ¶
func (*EchoServer) EchoServerStream(msg *EchoMsg, strm SRPCEchoer_EchoServerStreamStream) error
EchoServerStream implements SRPCEchoerServer
func (*EchoServer) Register ¶ added in v0.8.4
func (e *EchoServer) Register(mux srpc.Mux) error
Register registers the Echo server with the Mux.
func (*EchoServer) RpcStream ¶ added in v0.5.0
func (r *EchoServer) RpcStream(stream SRPCEchoer_RpcStreamStream) error
RpcStream runs a rpc stream
type SRPCEchoerClient ¶
type SRPCEchoerClient interface { // SRPCClient returns the underlying SRPC client. SRPCClient() srpc.Client // Echo returns the given message. Echo(ctx context.Context, in *EchoMsg) (*EchoMsg, error) // EchoServerStream is an example of a server -> client one-way stream. EchoServerStream(ctx context.Context, in *EchoMsg) (SRPCEchoer_EchoServerStreamClient, error) // EchoClientStream is an example of client->server one-way stream. EchoClientStream(ctx context.Context) (SRPCEchoer_EchoClientStreamClient, error) // EchoBidiStream is an example of a two-way stream. EchoBidiStream(ctx context.Context) (SRPCEchoer_EchoBidiStreamClient, error) // RpcStream opens a nested rpc call stream. RpcStream(ctx context.Context) (SRPCEchoer_RpcStreamClient, error) // DoNothing does nothing. DoNothing(ctx context.Context, in *emptypb.Empty) (*emptypb.Empty, error) }
func NewSRPCEchoerClient ¶
func NewSRPCEchoerClient(cc srpc.Client) SRPCEchoerClient
func NewSRPCEchoerClientWithServiceID ¶ added in v0.11.2
func NewSRPCEchoerClientWithServiceID(cc srpc.Client, serviceID string) SRPCEchoerClient
type SRPCEchoerHandler ¶
type SRPCEchoerHandler struct {
// contains filtered or unexported fields
}
func (SRPCEchoerHandler) GetMethodIDs ¶
func (SRPCEchoerHandler) GetMethodIDs() []string
func (*SRPCEchoerHandler) GetServiceID ¶
func (d *SRPCEchoerHandler) GetServiceID() string
func (*SRPCEchoerHandler) InvokeMethod ¶
func (SRPCEchoerHandler) InvokeMethod_DoNothing ¶ added in v0.32.9
func (SRPCEchoerHandler) InvokeMethod_DoNothing(impl SRPCEchoerServer, strm srpc.Stream) error
func (SRPCEchoerHandler) InvokeMethod_Echo ¶
func (SRPCEchoerHandler) InvokeMethod_Echo(impl SRPCEchoerServer, strm srpc.Stream) error
func (SRPCEchoerHandler) InvokeMethod_EchoBidiStream ¶
func (SRPCEchoerHandler) InvokeMethod_EchoBidiStream(impl SRPCEchoerServer, strm srpc.Stream) error
func (SRPCEchoerHandler) InvokeMethod_EchoClientStream ¶
func (SRPCEchoerHandler) InvokeMethod_EchoClientStream(impl SRPCEchoerServer, strm srpc.Stream) error
func (SRPCEchoerHandler) InvokeMethod_EchoServerStream ¶
func (SRPCEchoerHandler) InvokeMethod_EchoServerStream(impl SRPCEchoerServer, strm srpc.Stream) error
func (SRPCEchoerHandler) InvokeMethod_RpcStream ¶ added in v0.5.0
func (SRPCEchoerHandler) InvokeMethod_RpcStream(impl SRPCEchoerServer, strm srpc.Stream) error
type SRPCEchoerServer ¶
type SRPCEchoerServer interface { // Echo returns the given message. Echo(context.Context, *EchoMsg) (*EchoMsg, error) // EchoServerStream is an example of a server -> client one-way stream. EchoServerStream(*EchoMsg, SRPCEchoer_EchoServerStreamStream) error // EchoClientStream is an example of client->server one-way stream. EchoClientStream(SRPCEchoer_EchoClientStreamStream) (*EchoMsg, error) // EchoBidiStream is an example of a two-way stream. EchoBidiStream(SRPCEchoer_EchoBidiStreamStream) error // RpcStream opens a nested rpc call stream. RpcStream(SRPCEchoer_RpcStreamStream) error // DoNothing does nothing. DoNothing(context.Context, *emptypb.Empty) (*emptypb.Empty, error) }
type SRPCEchoer_DoNothingStream ¶ added in v0.32.9
type SRPCEchoer_EchoStream ¶
type SRPCEchoer_RpcStreamClient ¶ added in v0.5.0
type SRPCEchoer_RpcStreamClient interface { srpc.Stream Send(*rpcstream.RpcStreamPacket) error Recv() (*rpcstream.RpcStreamPacket, error) RecvTo(*rpcstream.RpcStreamPacket) error }
type SRPCEchoer_RpcStreamStream ¶ added in v0.5.0
type SRPCEchoer_RpcStreamStream interface { srpc.Stream Send(*rpcstream.RpcStreamPacket) error SendAndClose(*rpcstream.RpcStreamPacket) error Recv() (*rpcstream.RpcStreamPacket, error) RecvTo(*rpcstream.RpcStreamPacket) error }