ping

package
v0.0.0-...-762eddf Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func RegisterPingServer

func RegisterPingServer(s *grpc.Server, srv PingServer)

Types

type PingClient

type PingClient interface {
	// Get returns an response with same message id and body, and with timestamp.
	Get(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
	// GetAfter is same as Ping but return the response after certain time
	GetAfter(ctx context.Context, in *PingRequestWithSleep, opts ...grpc.CallOption) (*PingResponse, error)
	// GetRandom generates random strings and return, also produce lots of useless stuff to show the effects of heap
	GetRandom(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
}

PingClient is the client API for Ping service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewPingClient

func NewPingClient(cc grpc.ClientConnInterface) PingClient

type PingRequest

type PingRequest struct {
	Message_ID  string `protobuf:"bytes,1,opt,name=message_ID,json=messageID,proto3" json:"message_ID,omitempty"`
	MessageBody string `protobuf:"bytes,2,opt,name=message_body,json=messageBody,proto3" json:"message_body,omitempty"`
	// contains filtered or unexported fields
}

func (*PingRequest) Descriptor deprecated

func (*PingRequest) Descriptor() ([]byte, []int)

Deprecated: Use PingRequest.ProtoReflect.Descriptor instead.

func (*PingRequest) GetMessageBody

func (x *PingRequest) GetMessageBody() string

func (*PingRequest) GetMessage_ID

func (x *PingRequest) GetMessage_ID() string

func (*PingRequest) ProtoMessage

func (*PingRequest) ProtoMessage()

func (*PingRequest) ProtoReflect

func (x *PingRequest) ProtoReflect() protoreflect.Message

func (*PingRequest) Reset

func (x *PingRequest) Reset()

func (*PingRequest) String

func (x *PingRequest) String() string

type PingRequestWithSleep

type PingRequestWithSleep struct {
	Message_ID  string `protobuf:"bytes,1,opt,name=message_ID,json=messageID,proto3" json:"message_ID,omitempty"`
	MessageBody string `protobuf:"bytes,2,opt,name=message_body,json=messageBody,proto3" json:"message_body,omitempty"`
	Sleep       int32  `protobuf:"varint,3,opt,name=sleep,proto3" json:"sleep,omitempty"`
	// contains filtered or unexported fields
}

func (*PingRequestWithSleep) Descriptor deprecated

func (*PingRequestWithSleep) Descriptor() ([]byte, []int)

Deprecated: Use PingRequestWithSleep.ProtoReflect.Descriptor instead.

func (*PingRequestWithSleep) GetMessageBody

func (x *PingRequestWithSleep) GetMessageBody() string

func (*PingRequestWithSleep) GetMessage_ID

func (x *PingRequestWithSleep) GetMessage_ID() string

func (*PingRequestWithSleep) GetSleep

func (x *PingRequestWithSleep) GetSleep() int32

func (*PingRequestWithSleep) ProtoMessage

func (*PingRequestWithSleep) ProtoMessage()

func (*PingRequestWithSleep) ProtoReflect

func (x *PingRequestWithSleep) ProtoReflect() protoreflect.Message

func (*PingRequestWithSleep) Reset

func (x *PingRequestWithSleep) Reset()

func (*PingRequestWithSleep) String

func (x *PingRequestWithSleep) String() string

type PingResponse

type PingResponse struct {
	Message_ID  string `protobuf:"bytes,1,opt,name=message_ID,json=messageID,proto3" json:"message_ID,omitempty"`
	MessageBody string `protobuf:"bytes,2,opt,name=message_body,json=messageBody,proto3" json:"message_body,omitempty"`
	Timestamp   uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*PingResponse) Descriptor deprecated

func (*PingResponse) Descriptor() ([]byte, []int)

Deprecated: Use PingResponse.ProtoReflect.Descriptor instead.

func (*PingResponse) GetMessageBody

func (x *PingResponse) GetMessageBody() string

func (*PingResponse) GetMessage_ID

func (x *PingResponse) GetMessage_ID() string

func (*PingResponse) GetTimestamp

func (x *PingResponse) GetTimestamp() uint64

func (*PingResponse) ProtoMessage

func (*PingResponse) ProtoMessage()

func (*PingResponse) ProtoReflect

func (x *PingResponse) ProtoReflect() protoreflect.Message

func (*PingResponse) Reset

func (x *PingResponse) Reset()

func (*PingResponse) String

func (x *PingResponse) String() string

type PingServer

type PingServer interface {
	// Get returns an response with same message id and body, and with timestamp.
	Get(context.Context, *PingRequest) (*PingResponse, error)
	// GetAfter is same as Ping but return the response after certain time
	GetAfter(context.Context, *PingRequestWithSleep) (*PingResponse, error)
	// GetRandom generates random strings and return, also produce lots of useless stuff to show the effects of heap
	GetRandom(context.Context, *PingRequest) (*PingResponse, error)
}

PingServer is the server API for Ping service.

type UnimplementedPingServer

type UnimplementedPingServer struct {
}

UnimplementedPingServer can be embedded to have forward compatible implementations.

func (*UnimplementedPingServer) Get

func (*UnimplementedPingServer) GetAfter

func (*UnimplementedPingServer) GetRandom

Jump to

Keyboard shortcuts

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