Documentation ¶
Index ¶
- Variables
- func RegisterEchoServer(s *grpc.Server, srv EchoServer)
- type EchoClient
- type EchoRequest
- type EchoResponse
- func (*EchoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *EchoResponse) GetClientId() string
- func (x *EchoResponse) GetClock() int64
- func (x *EchoResponse) GetServerId() string
- func (*EchoResponse) ProtoMessage()
- func (x *EchoResponse) ProtoReflect() protoreflect.Message
- func (x *EchoResponse) Reset()
- func (x *EchoResponse) String() string
- type EchoServer
- type Echo_StreamEchoClient
- type Echo_StreamEchoServer
- type Empty
- type IsLeaderResponse
- type UnimplementedEchoServer
- func (*UnimplementedEchoServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error)
- func (*UnimplementedEchoServer) FailingEcho(context.Context, *EchoRequest) (*EchoResponse, error)
- func (*UnimplementedEchoServer) IsLeader(context.Context, *Empty) (*IsLeaderResponse, error)
- func (*UnimplementedEchoServer) StreamEcho(*EchoRequest, Echo_StreamEchoServer) error
Constants ¶
This section is empty.
Variables ¶
View Source
var File_api_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEchoServer ¶
func RegisterEchoServer(s *grpc.Server, srv EchoServer)
Types ¶
type EchoClient ¶
type EchoClient interface { Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) StreamEcho(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (Echo_StreamEchoClient, error) FailingEcho(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) IsLeader(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*IsLeaderResponse, error) }
EchoClient is the client API for Echo service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewEchoClient ¶
func NewEchoClient(cc grpc.ClientConnInterface) EchoClient
type EchoRequest ¶
type EchoRequest struct { // A client_id ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` // contains filtered or unexported fields }
func (*EchoRequest) Descriptor
deprecated
func (*EchoRequest) Descriptor() ([]byte, []int)
Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.
func (*EchoRequest) GetClientId ¶
func (x *EchoRequest) GetClientId() 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 EchoResponse ¶
type EchoResponse struct { // server id ServerId string `protobuf:"bytes,1,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"` // client id which made that request ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` // clock time at server Clock int64 `protobuf:"varint,3,opt,name=clock,proto3" json:"clock,omitempty"` // contains filtered or unexported fields }
func (*EchoResponse) Descriptor
deprecated
func (*EchoResponse) Descriptor() ([]byte, []int)
Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.
func (*EchoResponse) GetClientId ¶
func (x *EchoResponse) GetClientId() string
func (*EchoResponse) GetClock ¶
func (x *EchoResponse) GetClock() int64
func (*EchoResponse) GetServerId ¶
func (x *EchoResponse) GetServerId() string
func (*EchoResponse) ProtoMessage ¶
func (*EchoResponse) ProtoMessage()
func (*EchoResponse) ProtoReflect ¶
func (x *EchoResponse) ProtoReflect() protoreflect.Message
func (*EchoResponse) Reset ¶
func (x *EchoResponse) Reset()
func (*EchoResponse) String ¶
func (x *EchoResponse) String() string
type EchoServer ¶
type EchoServer interface { Echo(context.Context, *EchoRequest) (*EchoResponse, error) StreamEcho(*EchoRequest, Echo_StreamEchoServer) error FailingEcho(context.Context, *EchoRequest) (*EchoResponse, error) IsLeader(context.Context, *Empty) (*IsLeaderResponse, error) }
EchoServer is the server API for Echo service.
type Echo_StreamEchoClient ¶
type Echo_StreamEchoClient interface { Recv() (*EchoResponse, error) grpc.ClientStream }
type Echo_StreamEchoServer ¶
type Echo_StreamEchoServer interface { Send(*EchoResponse) error grpc.ServerStream }
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type IsLeaderResponse ¶
type IsLeaderResponse struct { // is leader or not IsLeader bool `protobuf:"varint,1,opt,name=is_leader,json=isLeader,proto3" json:"is_leader,omitempty"` // contains filtered or unexported fields }
func (*IsLeaderResponse) Descriptor
deprecated
func (*IsLeaderResponse) Descriptor() ([]byte, []int)
Deprecated: Use IsLeaderResponse.ProtoReflect.Descriptor instead.
func (*IsLeaderResponse) GetIsLeader ¶
func (x *IsLeaderResponse) GetIsLeader() bool
func (*IsLeaderResponse) ProtoMessage ¶
func (*IsLeaderResponse) ProtoMessage()
func (*IsLeaderResponse) ProtoReflect ¶
func (x *IsLeaderResponse) ProtoReflect() protoreflect.Message
func (*IsLeaderResponse) Reset ¶
func (x *IsLeaderResponse) Reset()
func (*IsLeaderResponse) String ¶
func (x *IsLeaderResponse) String() string
type UnimplementedEchoServer ¶
type UnimplementedEchoServer struct { }
UnimplementedEchoServer can be embedded to have forward compatible implementations.
func (*UnimplementedEchoServer) Echo ¶
func (*UnimplementedEchoServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error)
func (*UnimplementedEchoServer) FailingEcho ¶
func (*UnimplementedEchoServer) FailingEcho(context.Context, *EchoRequest) (*EchoResponse, error)
func (*UnimplementedEchoServer) IsLeader ¶
func (*UnimplementedEchoServer) IsLeader(context.Context, *Empty) (*IsLeaderResponse, error)
func (*UnimplementedEchoServer) StreamEcho ¶
func (*UnimplementedEchoServer) StreamEcho(*EchoRequest, Echo_StreamEchoServer) error
Click to show internal directories.
Click to hide internal directories.