Documentation ¶
Index ¶
- Variables
- func RegisterPingServiceServer(s *grpc.Server, srv PingServiceServer)
- func SendPingMsg(client PingServiceClient) (string, error)
- type PingService
- type PingServiceClient
- type PingServiceServer
- type Pong
- func (*Pong) Descriptor() ([]byte, []int)deprecated
- func (x *Pong) GetIndex() int32
- func (x *Pong) GetMessage() string
- func (x *Pong) GetReceivedOn() *timestamppb.Timestamp
- func (*Pong) ProtoMessage()
- func (x *Pong) ProtoReflect() protoreflect.Message
- func (x *Pong) Reset()
- func (x *Pong) String() string
- type Request
- type Response
- type UnimplementedPingServiceServer
Constants ¶
This section is empty.
Variables ¶
View Source
var File_ping_proto protoreflect.FileDescriptor
Functions ¶
func RegisterPingServiceServer ¶
func RegisterPingServiceServer(s *grpc.Server, srv PingServiceServer)
func SendPingMsg ¶
func SendPingMsg(client PingServiceClient) (string, error)
SendPingMsg function used by the client to send a ping message to the server.
Types ¶
type PingService ¶
type PingService struct { // UnimplementedPingServiceServer can be embedded to have forward-compatible implementations UnimplementedPingServiceServer }
PingService struct can work as Ping/Pong service between server and client to test the gRPC connection flow.
func (*PingService) SendPongMsg ¶
SendPongMsg function used by the server to send pong messages to the client.
type PingServiceClient ¶
type PingServiceClient interface {
SendPongMsg(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}
PingServiceClient is the client API for PingService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewPingServiceClient ¶
func NewPingServiceClient(cc grpc.ClientConnInterface) PingServiceClient
type PingServiceServer ¶
PingServiceServer is the server API for PingService service.
type Pong ¶
type Pong struct { Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` ReceivedOn *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=received_on,json=receivedOn,proto3" json:"received_on,omitempty"` // contains filtered or unexported fields }
func (*Pong) Descriptor
deprecated
func (*Pong) GetMessage ¶
func (*Pong) GetReceivedOn ¶
func (x *Pong) GetReceivedOn() *timestamppb.Timestamp
func (*Pong) ProtoMessage ¶
func (*Pong) ProtoMessage()
func (*Pong) ProtoReflect ¶
func (x *Pong) ProtoReflect() protoreflect.Message
type Request ¶
type Request struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Request) Descriptor
deprecated
func (*Request) GetMessage ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Pong *Pong `protobuf:"bytes,1,opt,name=pong,proto3" json:"pong,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type UnimplementedPingServiceServer ¶
type UnimplementedPingServiceServer struct { }
UnimplementedPingServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedPingServiceServer) SendPongMsg ¶
Click to show internal directories.
Click to hide internal directories.