example

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const SRPCEchoerServiceID = "example.Echoer"

Variables

This section is empty.

Functions

func NewSRPCEchoerHandler added in v0.29.0

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

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

func SRPCRegisterEchoer added in v0.29.0

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

SRPCRegisterEchoer registers the implementation with the mux. Uses the default serviceID: example.Echoer

Types

type EchoMsg added in v0.29.0

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.29.0

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

func (*EchoMsg) CloneVT added in v0.29.0

func (m *EchoMsg) CloneVT() *EchoMsg

func (*EchoMsg) EqualMessageVT added in v0.29.0

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

func (*EchoMsg) EqualVT added in v0.29.0

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

func (*EchoMsg) GetBody added in v0.29.0

func (x *EchoMsg) GetBody() string

func (*EchoMsg) MarshalJSON added in v0.29.0

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

MarshalJSON marshals the EchoMsg to JSON.

func (*EchoMsg) MarshalProtoJSON added in v0.29.0

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

MarshalProtoJSON marshals the EchoMsg message to JSON.

func (*EchoMsg) MarshalProtoText added in v0.29.0

func (x *EchoMsg) MarshalProtoText() string

func (*EchoMsg) MarshalToSizedBufferVT added in v0.29.0

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

func (*EchoMsg) MarshalToVT added in v0.29.0

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

func (*EchoMsg) MarshalVT added in v0.29.0

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

func (*EchoMsg) ProtoMessage added in v0.29.0

func (*EchoMsg) ProtoMessage()

func (*EchoMsg) Reset added in v0.29.0

func (x *EchoMsg) Reset()

func (*EchoMsg) SizeVT added in v0.29.0

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

func (*EchoMsg) String added in v0.29.0

func (x *EchoMsg) String() string

func (*EchoMsg) UnmarshalJSON added in v0.29.0

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

UnmarshalJSON unmarshals the EchoMsg from JSON.

func (*EchoMsg) UnmarshalProtoJSON added in v0.29.0

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

UnmarshalProtoJSON unmarshals the EchoMsg message from JSON.

func (*EchoMsg) UnmarshalVT added in v0.29.0

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

type ExampleMsg

type ExampleMsg struct {

	// ExampleField is an example field.
	ExampleField string `protobuf:"bytes,1,opt,name=example_field,json=exampleField,proto3" json:"exampleField,omitempty"`
	// OtherMsg is an example of an imported message field.
	OtherMsg *other.OtherMsg `protobuf:"bytes,2,opt,name=other_msg,json=otherMsg,proto3" json:"otherMsg,omitempty"`
	// contains filtered or unexported fields
}

ExampleMsg is an example message.

func (*ExampleMsg) CloneMessageVT

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

func (*ExampleMsg) CloneVT

func (m *ExampleMsg) CloneVT() *ExampleMsg

func (*ExampleMsg) EqualMessageVT

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

func (*ExampleMsg) EqualVT

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

func (*ExampleMsg) GetExampleField

func (x *ExampleMsg) GetExampleField() string

func (*ExampleMsg) GetOtherMsg

func (x *ExampleMsg) GetOtherMsg() *other.OtherMsg

func (*ExampleMsg) MarshalJSON

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

MarshalJSON marshals the ExampleMsg to JSON.

func (*ExampleMsg) MarshalProtoJSON

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

MarshalProtoJSON marshals the ExampleMsg message to JSON.

func (*ExampleMsg) MarshalProtoText

func (x *ExampleMsg) MarshalProtoText() string

func (*ExampleMsg) MarshalToSizedBufferVT

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

func (*ExampleMsg) MarshalToVT

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

func (*ExampleMsg) MarshalVT

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

func (*ExampleMsg) ProtoMessage

func (*ExampleMsg) ProtoMessage()

func (*ExampleMsg) Reset

func (x *ExampleMsg) Reset()

func (*ExampleMsg) SizeVT

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

func (*ExampleMsg) String

func (x *ExampleMsg) String() string

func (*ExampleMsg) UnmarshalJSON

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

UnmarshalJSON unmarshals the ExampleMsg from JSON.

func (*ExampleMsg) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the ExampleMsg message from JSON.

func (*ExampleMsg) UnmarshalVT

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

type SRPCEchoerClient added in v0.29.0

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

func NewSRPCEchoerClient added in v0.29.0

func NewSRPCEchoerClient(cc srpc.Client) SRPCEchoerClient

func NewSRPCEchoerClientWithServiceID added in v0.29.0

func NewSRPCEchoerClientWithServiceID(cc srpc.Client, serviceID string) SRPCEchoerClient

type SRPCEchoerHandler added in v0.29.0

type SRPCEchoerHandler struct {
	// contains filtered or unexported fields
}

func (SRPCEchoerHandler) GetMethodIDs added in v0.29.0

func (SRPCEchoerHandler) GetMethodIDs() []string

func (*SRPCEchoerHandler) GetServiceID added in v0.29.0

func (d *SRPCEchoerHandler) GetServiceID() string

func (*SRPCEchoerHandler) InvokeMethod added in v0.29.0

func (d *SRPCEchoerHandler) InvokeMethod(
	serviceID, methodID string,
	strm srpc.Stream,
) (bool, error)

func (SRPCEchoerHandler) InvokeMethod_Echo added in v0.29.0

func (SRPCEchoerHandler) InvokeMethod_Echo(impl SRPCEchoerServer, strm srpc.Stream) error

type SRPCEchoerServer added in v0.29.0

type SRPCEchoerServer interface {
	// Echo returns the given message.
	Echo(context.Context, *EchoMsg) (*EchoMsg, error)
}

type SRPCEchoer_EchoStream added in v0.29.0

type SRPCEchoer_EchoStream interface {
	srpc.Stream
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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