Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Write(res *model.Message) Read(cb DataCallback) RoutineWrite() ClientID() string Close() Context() context.Context }
Client is the inteface for the websocket and grpc sockets
type DataCallback ¶
DataCallback is the callback invoked when data is read by the socket
type GRPCRealtimeClient ¶
type GRPCRealtimeClient struct {
// contains filtered or unexported fields
}
GRPCRealtimeClient is the object handling all client interactions
func CreateGRPCRealtimeClient ¶
func CreateGRPCRealtimeClient(stream proto.SpaceCloud_RealTimeServer) *GRPCRealtimeClient
CreateGRPCRealtimeClient makes a client object to manage the grpc
func (*GRPCRealtimeClient) ClientID ¶
func (c *GRPCRealtimeClient) ClientID() string
ClientID returns the client's id
func (*GRPCRealtimeClient) Context ¶
func (c *GRPCRealtimeClient) Context() context.Context
Context returns the client's context
func (*GRPCRealtimeClient) Read ¶
func (c *GRPCRealtimeClient) Read(cb DataCallback)
Read startes a blocking reader routine
func (*GRPCRealtimeClient) RoutineWrite ¶
func (c *GRPCRealtimeClient) RoutineWrite()
RoutineWrite starts a json writer routine
func (*GRPCRealtimeClient) Write ¶
func (c *GRPCRealtimeClient) Write(res *model.Message)
Write wrties the object to the client
type GRPCServiceClient ¶
type GRPCServiceClient struct {
// contains filtered or unexported fields
}
GRPCServiceClient is the object handling all client interactions
func CreateGRPCServiceClient ¶
func CreateGRPCServiceClient(stream proto.SpaceCloud_ServiceServer) *GRPCServiceClient
CreateGRPCServiceClient makes a client object to manage the grpc
func (*GRPCServiceClient) ClientID ¶
func (c *GRPCServiceClient) ClientID() string
ClientID returns the client's id
func (*GRPCServiceClient) Context ¶
func (c *GRPCServiceClient) Context() context.Context
Context returns the client's context
func (*GRPCServiceClient) Read ¶
func (c *GRPCServiceClient) Read(cb DataCallback)
Read startes a blocking reader routine
func (*GRPCServiceClient) RoutineWrite ¶
func (c *GRPCServiceClient) RoutineWrite()
RoutineWrite starts a json writer routine
func (*GRPCServiceClient) Write ¶
func (c *GRPCServiceClient) Write(res *model.Message)
Write wrties the object to the client
type WebsocketClient ¶
type WebsocketClient struct {
// contains filtered or unexported fields
}
WebsocketClient is the websocket client
func CreateWebsocketClient ¶
func CreateWebsocketClient(socket *websocket.Conn) *WebsocketClient
CreateWebsocketClient makes a client object to manage the socket
func (*WebsocketClient) ClientID ¶
func (c *WebsocketClient) ClientID() string
ClientID returns the client's id
func (*WebsocketClient) Context ¶
func (c *WebsocketClient) Context() context.Context
Context returns the client's context
func (*WebsocketClient) Read ¶
func (c *WebsocketClient) Read(cb DataCallback)
Read starts a blocking reader routine
func (*WebsocketClient) RoutineWrite ¶
func (c *WebsocketClient) RoutineWrite()
RoutineWrite starts a json writer routine
func (*WebsocketClient) Write ¶
func (c *WebsocketClient) Write(res *model.Message)
Write writes the object to the client