Documentation ¶
Index ¶
- Variables
- func RecievingCompareToLamport(recieveLamp *LamportTimestamp, sendingLamp int32) int32
- func RegisterChittyChatServiceServer(s grpc.ServiceRegistrar, srv ChittyChatServiceServer)
- type ChatRoomMessages
- func (*ChatRoomMessages) Descriptor() ([]byte, []int)deprecated
- func (x *ChatRoomMessages) GetClientId() int32
- func (x *ChatRoomMessages) GetCode() int32
- func (x *ChatRoomMessages) GetLamportTimestamp() int32
- func (x *ChatRoomMessages) GetMsg() string
- func (x *ChatRoomMessages) GetUsername() string
- func (*ChatRoomMessages) ProtoMessage()
- func (x *ChatRoomMessages) ProtoReflect() protoreflect.Message
- func (x *ChatRoomMessages) Reset()
- func (x *ChatRoomMessages) String() string
- type ChittyChatServiceClient
- type ChittyChatServiceServer
- type ChittyChatService_BroadcastClient
- type ChittyChatService_BroadcastServer
- type ChittyChatService_PublishClient
- type ChittyChatService_PublishServer
- type ClientMessage
- func (*ClientMessage) Descriptor() ([]byte, []int)deprecated
- func (x *ClientMessage) GetClientId() int32
- func (x *ClientMessage) GetCode() int32
- func (x *ClientMessage) GetLamportTimestamp() int32
- func (x *ClientMessage) GetMsg() string
- func (x *ClientMessage) GetUserName() string
- func (*ClientMessage) ProtoMessage()
- func (x *ClientMessage) ProtoReflect() protoreflect.Message
- func (x *ClientMessage) Reset()
- func (x *ClientMessage) String() string
- type LamportTimestamp
- type Status
- type StatusMessage
- func (*StatusMessage) Descriptor() ([]byte, []int)deprecated
- func (x *StatusMessage) GetOperation() string
- func (x *StatusMessage) GetStatus() Status
- func (*StatusMessage) ProtoMessage()
- func (x *StatusMessage) ProtoReflect() protoreflect.Message
- func (x *StatusMessage) Reset()
- func (x *StatusMessage) String() string
- type Subscription
- func (*Subscription) Descriptor() ([]byte, []int)deprecated
- func (x *Subscription) GetClientId() int32
- func (x *Subscription) GetLamportTimestamp() int32
- func (x *Subscription) GetUserName() string
- func (*Subscription) ProtoMessage()
- func (x *Subscription) ProtoReflect() protoreflect.Message
- func (x *Subscription) Reset()
- func (x *Subscription) String() string
- type UnimplementedChittyChatServiceServer
- type UnsafeChittyChatServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( Status_name = map[int32]string{ 0: "INVALID", 1: "SUCCESS", 2: "FAILURE", } Status_value = map[string]int32{ "INVALID": 0, "SUCCESS": 1, "FAILURE": 2, } )
Enum value maps for Status.
var ChittyChatService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "main.ChittyChatService", HandlerType: (*ChittyChatServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Publish", Handler: _ChittyChatService_Publish_Handler, ServerStreams: true, ClientStreams: true, }, { StreamName: "Broadcast", Handler: _ChittyChatService_Broadcast_Handler, ServerStreams: true, }, }, Metadata: "ChittyChat.proto", }
ChittyChatService_ServiceDesc is the grpc.ServiceDesc for ChittyChatService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_ChittyChat_proto protoreflect.FileDescriptor
Functions ¶
func RecievingCompareToLamport ¶
func RecievingCompareToLamport(recieveLamp *LamportTimestamp, sendingLamp int32) int32
func RegisterChittyChatServiceServer ¶
func RegisterChittyChatServiceServer(s grpc.ServiceRegistrar, srv ChittyChatServiceServer)
Types ¶
type ChatRoomMessages ¶
type ChatRoomMessages struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` LamportTimestamp int32 `protobuf:"varint,2,opt,name=lamportTimestamp,proto3" json:"lamportTimestamp,omitempty"` Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` ClientId int32 `protobuf:"varint,4,opt,name=clientId,proto3" json:"clientId,omitempty"` Code int32 `protobuf:"varint,5,opt,name=code,proto3" json:"code,omitempty"` // contains filtered or unexported fields }
func (*ChatRoomMessages) Descriptor
deprecated
func (*ChatRoomMessages) Descriptor() ([]byte, []int)
Deprecated: Use ChatRoomMessages.ProtoReflect.Descriptor instead.
func (*ChatRoomMessages) GetClientId ¶
func (x *ChatRoomMessages) GetClientId() int32
func (*ChatRoomMessages) GetCode ¶
func (x *ChatRoomMessages) GetCode() int32
func (*ChatRoomMessages) GetLamportTimestamp ¶
func (x *ChatRoomMessages) GetLamportTimestamp() int32
func (*ChatRoomMessages) GetMsg ¶
func (x *ChatRoomMessages) GetMsg() string
func (*ChatRoomMessages) GetUsername ¶
func (x *ChatRoomMessages) GetUsername() string
func (*ChatRoomMessages) ProtoMessage ¶
func (*ChatRoomMessages) ProtoMessage()
func (*ChatRoomMessages) ProtoReflect ¶
func (x *ChatRoomMessages) ProtoReflect() protoreflect.Message
func (*ChatRoomMessages) Reset ¶
func (x *ChatRoomMessages) Reset()
func (*ChatRoomMessages) String ¶
func (x *ChatRoomMessages) String() string
type ChittyChatServiceClient ¶
type ChittyChatServiceClient interface { Publish(ctx context.Context, opts ...grpc.CallOption) (ChittyChatService_PublishClient, error) Broadcast(ctx context.Context, in *Subscription, opts ...grpc.CallOption) (ChittyChatService_BroadcastClient, error) }
ChittyChatServiceClient is the client API for ChittyChatService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewChittyChatServiceClient ¶
func NewChittyChatServiceClient(cc grpc.ClientConnInterface) ChittyChatServiceClient
type ChittyChatServiceServer ¶
type ChittyChatServiceServer interface { Publish(ChittyChatService_PublishServer) error Broadcast(*Subscription, ChittyChatService_BroadcastServer) error // contains filtered or unexported methods }
ChittyChatServiceServer is the server API for ChittyChatService service. All implementations must embed UnimplementedChittyChatServiceServer for forward compatibility
type ChittyChatService_BroadcastClient ¶
type ChittyChatService_BroadcastClient interface { Recv() (*ChatRoomMessages, error) grpc.ClientStream }
type ChittyChatService_BroadcastServer ¶
type ChittyChatService_BroadcastServer interface { Send(*ChatRoomMessages) error grpc.ServerStream }
type ChittyChatService_PublishClient ¶
type ChittyChatService_PublishClient interface { Send(*ClientMessage) error Recv() (*StatusMessage, error) grpc.ClientStream }
type ChittyChatService_PublishServer ¶
type ChittyChatService_PublishServer interface { Send(*StatusMessage) error Recv() (*ClientMessage, error) grpc.ServerStream }
type ClientMessage ¶
type ClientMessage struct { ClientId int32 `protobuf:"varint,1,opt,name=clientId,proto3" json:"clientId,omitempty"` UserName string `protobuf:"bytes,2,opt,name=userName,proto3" json:"userName,omitempty"` Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"` LamportTimestamp int32 `protobuf:"varint,4,opt,name=lamportTimestamp,proto3" json:"lamportTimestamp,omitempty"` Code int32 `protobuf:"varint,5,opt,name=code,proto3" json:"code,omitempty"` // contains filtered or unexported fields }
func (*ClientMessage) Descriptor
deprecated
func (*ClientMessage) Descriptor() ([]byte, []int)
Deprecated: Use ClientMessage.ProtoReflect.Descriptor instead.
func (*ClientMessage) GetClientId ¶
func (x *ClientMessage) GetClientId() int32
func (*ClientMessage) GetCode ¶
func (x *ClientMessage) GetCode() int32
func (*ClientMessage) GetLamportTimestamp ¶
func (x *ClientMessage) GetLamportTimestamp() int32
func (*ClientMessage) GetMsg ¶
func (x *ClientMessage) GetMsg() string
func (*ClientMessage) GetUserName ¶
func (x *ClientMessage) GetUserName() string
func (*ClientMessage) ProtoMessage ¶
func (*ClientMessage) ProtoMessage()
func (*ClientMessage) ProtoReflect ¶
func (x *ClientMessage) ProtoReflect() protoreflect.Message
func (*ClientMessage) Reset ¶
func (x *ClientMessage) Reset()
func (*ClientMessage) String ¶
func (x *ClientMessage) String() string
type LamportTimestamp ¶
type LamportTimestamp struct { Timestamp int32 // contains filtered or unexported fields }
func (*LamportTimestamp) RecieveIncomingLamportInt ¶
func (lamport *LamportTimestamp) RecieveIncomingLamportInt(timestamp int32)
func (*LamportTimestamp) Tick ¶
func (l *LamportTimestamp) Tick()
func (*LamportTimestamp) UpdateTimestamp ¶
func (lamport *LamportTimestamp) UpdateTimestamp(timestamp int32)
type Status ¶
type Status int32
func (Status) Descriptor ¶
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶
func (x Status) Number() protoreflect.EnumNumber
func (Status) Type ¶
func (Status) Type() protoreflect.EnumType
type StatusMessage ¶
type StatusMessage struct { Operation string `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=main.Status" json:"status,omitempty"` // contains filtered or unexported fields }
func (*StatusMessage) Descriptor
deprecated
func (*StatusMessage) Descriptor() ([]byte, []int)
Deprecated: Use StatusMessage.ProtoReflect.Descriptor instead.
func (*StatusMessage) GetOperation ¶
func (x *StatusMessage) GetOperation() string
func (*StatusMessage) GetStatus ¶
func (x *StatusMessage) GetStatus() Status
func (*StatusMessage) ProtoMessage ¶
func (*StatusMessage) ProtoMessage()
func (*StatusMessage) ProtoReflect ¶
func (x *StatusMessage) ProtoReflect() protoreflect.Message
func (*StatusMessage) Reset ¶
func (x *StatusMessage) Reset()
func (*StatusMessage) String ¶
func (x *StatusMessage) String() string
type Subscription ¶
type Subscription struct { ClientId int32 `protobuf:"varint,1,opt,name=clientId,proto3" json:"clientId,omitempty"` UserName string `protobuf:"bytes,2,opt,name=userName,proto3" json:"userName,omitempty"` LamportTimestamp int32 `protobuf:"varint,3,opt,name=lamportTimestamp,proto3" json:"lamportTimestamp,omitempty"` // contains filtered or unexported fields }
func (*Subscription) Descriptor
deprecated
func (*Subscription) Descriptor() ([]byte, []int)
Deprecated: Use Subscription.ProtoReflect.Descriptor instead.
func (*Subscription) GetClientId ¶
func (x *Subscription) GetClientId() int32
func (*Subscription) GetLamportTimestamp ¶
func (x *Subscription) GetLamportTimestamp() int32
func (*Subscription) GetUserName ¶
func (x *Subscription) GetUserName() string
func (*Subscription) ProtoMessage ¶
func (*Subscription) ProtoMessage()
func (*Subscription) ProtoReflect ¶
func (x *Subscription) ProtoReflect() protoreflect.Message
func (*Subscription) Reset ¶
func (x *Subscription) Reset()
func (*Subscription) String ¶
func (x *Subscription) String() string
type UnimplementedChittyChatServiceServer ¶
type UnimplementedChittyChatServiceServer struct { }
UnimplementedChittyChatServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedChittyChatServiceServer) Broadcast ¶
func (UnimplementedChittyChatServiceServer) Broadcast(*Subscription, ChittyChatService_BroadcastServer) error
func (UnimplementedChittyChatServiceServer) Publish ¶
func (UnimplementedChittyChatServiceServer) Publish(ChittyChatService_PublishServer) error
type UnsafeChittyChatServiceServer ¶
type UnsafeChittyChatServiceServer interface {
// contains filtered or unexported methods
}
UnsafeChittyChatServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ChittyChatServiceServer will result in compilation errors.