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 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
Click to show internal directories.
Click to hide internal directories.