example

package
v0.0.0-...-9c3658d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const SRPCEchoerServiceID = "example.Echoer"

Variables

This section is empty.

Functions

func NewSRPCEchoerHandler

func NewSRPCEchoerHandler(impl SRPCEchoerServer, serviceID string) srpc.Handler

NewSRPCEchoerHandler constructs a new RPC handler. serviceID: if empty, uses default: example.Echoer

func SRPCRegisterEchoer

func SRPCRegisterEchoer(mux srpc.Mux, impl SRPCEchoerServer) error

SRPCRegisterEchoer registers the implementation with the mux. Uses the default serviceID: example.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

func (m *EchoMsg) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*EchoMsg) CloneVT

func (m *EchoMsg) CloneVT() *EchoMsg

func (*EchoMsg) EqualMessageVT

func (this *EchoMsg) EqualMessageVT(thatMsg any) bool

func (*EchoMsg) EqualVT

func (this *EchoMsg) EqualVT(that *EchoMsg) bool

func (*EchoMsg) GetBody

func (x *EchoMsg) GetBody() string

func (*EchoMsg) MarshalJSON

func (x *EchoMsg) MarshalJSON() ([]byte, error)

MarshalJSON marshals the EchoMsg to JSON.

func (*EchoMsg) MarshalProtoJSON

func (x *EchoMsg) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the EchoMsg message to JSON.

func (*EchoMsg) MarshalProtoText

func (x *EchoMsg) MarshalProtoText() string

func (*EchoMsg) MarshalToSizedBufferVT

func (m *EchoMsg) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*EchoMsg) MarshalToVT

func (m *EchoMsg) MarshalToVT(dAtA []byte) (int, error)

func (*EchoMsg) MarshalVT

func (m *EchoMsg) MarshalVT() (dAtA []byte, err error)

func (*EchoMsg) ProtoMessage

func (*EchoMsg) ProtoMessage()

func (*EchoMsg) Reset

func (x *EchoMsg) Reset()

func (*EchoMsg) SizeVT

func (m *EchoMsg) SizeVT() (n int)

func (*EchoMsg) String

func (x *EchoMsg) String() string

func (*EchoMsg) UnmarshalJSON

func (x *EchoMsg) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the EchoMsg from JSON.

func (*EchoMsg) UnmarshalProtoJSON

func (x *EchoMsg) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the EchoMsg message from JSON.

func (*EchoMsg) UnmarshalVT

func (m *EchoMsg) UnmarshalVT(dAtA []byte) error

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)
}

func NewSRPCEchoerClient

func NewSRPCEchoerClient(cc srpc.Client) SRPCEchoerClient

func NewSRPCEchoerClientWithServiceID

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 (d *SRPCEchoerHandler) InvokeMethod(
	serviceID, methodID string,
	strm srpc.Stream,
) (bool, 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

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
}

type SRPCEchoer_EchoBidiStreamClient

type SRPCEchoer_EchoBidiStreamClient interface {
	srpc.Stream
	Send(*EchoMsg) error
	Recv() (*EchoMsg, error)
	RecvTo(*EchoMsg) error
}

type SRPCEchoer_EchoBidiStreamStream

type SRPCEchoer_EchoBidiStreamStream interface {
	srpc.Stream
	Send(*EchoMsg) error
	SendAndClose(*EchoMsg) error
	Recv() (*EchoMsg, error)
	RecvTo(*EchoMsg) error
}

type SRPCEchoer_EchoClientStreamClient

type SRPCEchoer_EchoClientStreamClient interface {
	srpc.Stream
	Send(*EchoMsg) error
	CloseAndRecv() (*EchoMsg, error)
}

type SRPCEchoer_EchoClientStreamStream

type SRPCEchoer_EchoClientStreamStream interface {
	srpc.Stream
	Recv() (*EchoMsg, error)
	RecvTo(*EchoMsg) error
}

type SRPCEchoer_EchoServerStreamClient

type SRPCEchoer_EchoServerStreamClient interface {
	srpc.Stream
	Recv() (*EchoMsg, error)
	RecvTo(*EchoMsg) error
}

type SRPCEchoer_EchoServerStreamStream

type SRPCEchoer_EchoServerStreamStream interface {
	srpc.Stream
	Send(*EchoMsg) error
	SendAndClose(*EchoMsg) error
}

type SRPCEchoer_EchoStream

type SRPCEchoer_EchoStream interface {
	srpc.Stream
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL