Documentation
¶
Index ¶
- Variables
- func HandleClientReadyMessage(ready ws.ClientReady, client *Client, thisSession *ws.Session)
- func HandlePadDelete(client *Client, padDeleteMessage PadDelete)
- func HandleUserInfoUpdate(userInfo UserInfoUpdate, client *Client)
- func KickSessionsFromPad(padID string)
- func ServeWs(hub *Hub, w http.ResponseWriter, r *http.Request, sessionStore *session.Store, ...)
- func UpdatePadClients(pad *pad2.Pad)
- type AcceptCommitData
- type AcceptCommitMessage
- type AccessStatusMessage
- type AuthSession
- type ChannelOperator
- type Client
- type Hub
- type Message
- type NewChangesMessage
- type NewChangesMessageData
- type PadDelete
- type PadDeleteMessage
- type SessionInfo
- type SessionStore
- type Task
- type UserDupMessage
- type UserInfoUpdate
- type UserInfoUpdateWrapper
Constants ¶
This section is empty.
Variables ¶
View Source
var PadChannels = NewChannelOperator()
Functions ¶
func HandleClientReadyMessage ¶
func HandleClientReadyMessage(ready ws.ClientReady, client *Client, thisSession *ws.Session)
func HandlePadDelete ¶
func HandleUserInfoUpdate ¶
func HandleUserInfoUpdate(userInfo UserInfoUpdate, client *Client)
func KickSessionsFromPad ¶
func KickSessionsFromPad(padID string)
func ServeWs ¶
func ServeWs(hub *Hub, w http.ResponseWriter, r *http.Request, sessionStore *session.Store, fiber *fiber.Ctx)
ServeWs serveWs handles websocket requests from the peer.
func UpdatePadClients ¶
Types ¶
type AcceptCommitData ¶
type AcceptCommitMessage ¶
type AcceptCommitMessage struct {
Type string `json:"type"`
Data AcceptCommitData `json:"data"`
}
type AccessStatusMessage ¶
type AccessStatusMessage struct {
AccessStatus string `json:"accessStatus"`
}
type AuthSession ¶
type ChannelOperator ¶
type ChannelOperator struct {
// contains filtered or unexported fields
}
func NewChannelOperator ¶
func NewChannelOperator() ChannelOperator
func (*ChannelOperator) AddToQueue ¶
func (c *ChannelOperator) AddToQueue(ch string, t Task)
type Client ¶
type Client struct {
// Buffered channel of outbound messages.
Send chan []byte
Room string
SessionId string
// contains filtered or unexported fields
}
Client is a middleman between the websocket connection and the hub.
func GetRoomSockets ¶
func (*Client) SendPadDelete ¶
func (c *Client) SendPadDelete()
func (*Client) SendUserDupMessage ¶
func (c *Client) SendUserDupMessage()
type Hub ¶
type Hub struct {
// Inbound messages from the clients.
Broadcast chan []byte
// Register requests from the clients.
Register chan *Client
// Unregister requests from clients.
Unregister chan *Client
// contains filtered or unexported fields
}
Hub maintains the set of active clients and broadcasts messages to the clients.
var HubGlob *Hub
type Message ¶
type Message struct {
Data clientVars2.ClientVars `json:"data"`
Type string `json:"type"`
}
type NewChangesMessage ¶
type NewChangesMessage struct {
Type string `json:"type"`
Data NewChangesMessageData `json:"data"`
}
type NewChangesMessageData ¶
type PadDeleteMessage ¶
type PadDeleteMessage struct {
Disconnect string `json:"disconnect"`
}
type SessionInfo ¶
type SessionInfo struct {
// contains filtered or unexported fields
}
type SessionStore ¶
type SessionStore struct {
// contains filtered or unexported fields
}
var SessionStoreInstance SessionStore
func NewSessionStore ¶
func NewSessionStore(refresh *int) SessionStore
NewSessionStore @param refresh *int Number of milliseconds to refresh the session
/*
type UserDupMessage ¶
type UserDupMessage struct {
Disconnect string `json:"disconnect"`
}
type UserInfoUpdate ¶
type UserInfoUpdateWrapper ¶
type UserInfoUpdateWrapper struct {
Event string `json:"event"`
Data UserInfoUpdate `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.