Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var File_example_example_proto protoreflect.FileDescriptor
Functions ¶
func NewEchoServiceServer ¶
func NewEchoServiceServer(conn *nats.Conn, service EchoService, options ...nrpc.ServerOption) (nrpc.Server, error)
Construct a new NATS-backed server for the given EchoService implementation. The server can be configured to run with a namespace, allowing multiple servers to run the same service with isolated subjects.
Types ¶
type EchoReply ¶
type EchoReply struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
A response type
func (*EchoReply) Descriptor
deprecated
func (*EchoReply) GetMessage ¶
func (*EchoReply) ProtoMessage ¶
func (*EchoReply) ProtoMessage()
func (*EchoReply) ProtoReflect ¶
func (x *EchoReply) ProtoReflect() protoreflect.Message
type EchoRequest ¶
type EchoRequest struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
A request type
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
type EchoService ¶
type EchoService interface { // Echo a message back to the caller Echo(*EchoRequest) (*EchoReply, error) }
EchoService replies with the same message that was sent to it
func NewEchoServiceClient ¶
func NewEchoServiceClient(conn *nats.Conn, options ...nrpc.ClientOption) (EchoService, error)
Construct a NATS-backed implementation of EchoService configured with the given connection and options
type ServiceImpl ¶
type ServiceImpl struct { }
func (*ServiceImpl) Echo ¶
func (service *ServiceImpl) Echo(msg *EchoRequest) (*EchoReply, error)
Click to show internal directories.
Click to hide internal directories.