Documentation ¶
Index ¶
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type JoinRequest
- type LeaveRequest
- func (*LeaveRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LeaveRequest) GetId() int32
- func (x *LeaveRequest) GetTime() int32
- func (*LeaveRequest) ProtoMessage()
- func (x *LeaveRequest) ProtoReflect() protoreflect.Message
- func (x *LeaveRequest) Reset()
- func (x *LeaveRequest) String() string
- type NodeId
- type Object
- type ServerResponse
- func (*ServerResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ServerResponse) GetHttpStatusCode() int32
- func (x *ServerResponse) GetTime() int32
- func (*ServerResponse) ProtoMessage()
- func (x *ServerResponse) ProtoReflect() protoreflect.Message
- func (x *ServerResponse) Reset()
- func (x *ServerResponse) String() string
- type ServiceClient
- type ServiceServer
- type Service_JoinClient
- type Service_JoinServer
- type UnimplementedServiceServer
- func (UnimplementedServiceServer) CreateID(context.Context, *NodeId) (*NodeId, error)
- func (UnimplementedServiceServer) Join(*JoinRequest, Service_JoinServer) error
- func (UnimplementedServiceServer) Leave(context.Context, *LeaveRequest) (*ServerResponse, error)
- func (UnimplementedServiceServer) Method(context.Context, *Object) (*ServerResponse, error)
- type UnsafeServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_Client_server_Proto_Proto_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Proto.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Method", Handler: _Service_Method_Handler, }, { MethodName: "Leave", Handler: _Service_Leave_Handler, }, { MethodName: "createID", Handler: _Service_CreateID_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Join", Handler: _Service_Join_Handler, ServerStreams: true, }, }, Metadata: "Client-server/Proto/Proto.proto", }
Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServiceServer ¶
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
Types ¶
type JoinRequest ¶
type JoinRequest struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Time int32 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"` // contains filtered or unexported fields }
func (*JoinRequest) Descriptor
deprecated
func (*JoinRequest) Descriptor() ([]byte, []int)
Deprecated: Use JoinRequest.ProtoReflect.Descriptor instead.
func (*JoinRequest) GetId ¶
func (x *JoinRequest) GetId() int32
func (*JoinRequest) GetTime ¶
func (x *JoinRequest) GetTime() int32
func (*JoinRequest) ProtoMessage ¶
func (*JoinRequest) ProtoMessage()
func (*JoinRequest) ProtoReflect ¶
func (x *JoinRequest) ProtoReflect() protoreflect.Message
func (*JoinRequest) Reset ¶
func (x *JoinRequest) Reset()
func (*JoinRequest) String ¶
func (x *JoinRequest) String() string
type LeaveRequest ¶
type LeaveRequest struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Time int32 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"` // contains filtered or unexported fields }
func (*LeaveRequest) Descriptor
deprecated
func (*LeaveRequest) Descriptor() ([]byte, []int)
Deprecated: Use LeaveRequest.ProtoReflect.Descriptor instead.
func (*LeaveRequest) GetId ¶
func (x *LeaveRequest) GetId() int32
func (*LeaveRequest) GetTime ¶
func (x *LeaveRequest) GetTime() int32
func (*LeaveRequest) ProtoMessage ¶
func (*LeaveRequest) ProtoMessage()
func (*LeaveRequest) ProtoReflect ¶
func (x *LeaveRequest) ProtoReflect() protoreflect.Message
func (*LeaveRequest) Reset ¶
func (x *LeaveRequest) Reset()
func (*LeaveRequest) String ¶
func (x *LeaveRequest) String() string
type NodeId ¶
type NodeId struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*NodeId) Descriptor
deprecated
func (*NodeId) ProtoMessage ¶
func (*NodeId) ProtoMessage()
func (*NodeId) ProtoReflect ¶
func (x *NodeId) ProtoReflect() protoreflect.Message
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
The request message containing the user's message
func (*Object) Descriptor
deprecated
func (*Object) ProtoMessage ¶
func (*Object) ProtoMessage()
func (*Object) ProtoReflect ¶
func (x *Object) ProtoReflect() protoreflect.Message
type ServerResponse ¶
type ServerResponse struct { HttpStatusCode int32 `protobuf:"varint,1,opt,name=HttpStatusCode,proto3" json:"HttpStatusCode,omitempty"` Time int32 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"` // contains filtered or unexported fields }
func (*ServerResponse) Descriptor
deprecated
func (*ServerResponse) Descriptor() ([]byte, []int)
Deprecated: Use ServerResponse.ProtoReflect.Descriptor instead.
func (*ServerResponse) GetHttpStatusCode ¶
func (x *ServerResponse) GetHttpStatusCode() int32
func (*ServerResponse) GetTime ¶
func (x *ServerResponse) GetTime() int32
func (*ServerResponse) ProtoMessage ¶
func (*ServerResponse) ProtoMessage()
func (*ServerResponse) ProtoReflect ¶
func (x *ServerResponse) ProtoReflect() protoreflect.Message
func (*ServerResponse) Reset ¶
func (x *ServerResponse) Reset()
func (*ServerResponse) String ¶
func (x *ServerResponse) String() string
type ServiceClient ¶
type ServiceClient interface { // Sends a stream of messages and gets a stream of messages in return Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (Service_JoinClient, error) Method(ctx context.Context, in *Object, opts ...grpc.CallOption) (*ServerResponse, error) Leave(ctx context.Context, in *LeaveRequest, opts ...grpc.CallOption) (*ServerResponse, error) //Gets an ID(which is irrelevant) and returns the next ID in the line CreateID(ctx context.Context, in *NodeId, opts ...grpc.CallOption) (*NodeId, error) }
ServiceClient is the client API for Service service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.golang.ir/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶
type ServiceServer interface { // Sends a stream of messages and gets a stream of messages in return Join(*JoinRequest, Service_JoinServer) error Method(context.Context, *Object) (*ServerResponse, error) Leave(context.Context, *LeaveRequest) (*ServerResponse, error) //Gets an ID(which is irrelevant) and returns the next ID in the line CreateID(context.Context, *NodeId) (*NodeId, error) // contains filtered or unexported methods }
ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility
type Service_JoinClient ¶
type Service_JoinClient interface { Recv() (*Object, error) grpc.ClientStream }
type Service_JoinServer ¶
type Service_JoinServer interface { Send(*Object) error grpc.ServerStream }
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct { }
UnimplementedServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedServiceServer) Join ¶
func (UnimplementedServiceServer) Join(*JoinRequest, Service_JoinServer) error
func (UnimplementedServiceServer) Leave ¶
func (UnimplementedServiceServer) Leave(context.Context, *LeaveRequest) (*ServerResponse, error)
func (UnimplementedServiceServer) Method ¶
func (UnimplementedServiceServer) Method(context.Context, *Object) (*ServerResponse, error)
type UnsafeServiceServer ¶
type UnsafeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.