Documentation ¶
Index ¶
- Constants
- func ReceiveHost(ws *websocket.Conn, db *database.DatabaseOp, id string, quit chan bool)
- func ReceiveVisitor(ws *websocket.Conn, db *database.DatabaseOp, id string, userId string, ...)
- func SendHost(ws *websocket.Conn, db *database.DatabaseOp, id string, quit chan bool)
- func SendVisitor(ws *websocket.Conn, db *database.DatabaseOp, id string, userId string, ...)
- func TopicGetter(db *database.DatabaseOp, topics *map[string]*string)
- type CloseSocket
- type InitializeSocket
- type SendAnswers
- type Status
Constants ¶
View Source
const ( TopicTableName = "topics" AnswersTableName = "answers" ConnectUsersTablename = "connectusers" )
Variables ¶
This section is empty.
Functions ¶
func ReceiveHost ¶
Received a socket to the host.
Arguments:
ws {*websocket.Conn} - websocket operator. db {*database.DatabaseOp} - database op. id {string} - id quit {chan bool} - quit signal.
func ReceiveVisitor ¶
func ReceiveVisitor(ws *websocket.Conn, db *database.DatabaseOp, id string, userId string, quit chan bool)
Received a socket to the visitor.
Arguments:
ws {*websocket.Conn} - websocket operator. db {*database.DatabaseOp} - database op. id {string} - id quit {chan bool} - quit signal.
func SendHost ¶
Send a socket to the host.
Arguments:
ws {*websocket.Conn} - websocket operator. db {*database.DatabaseOp} - database op. id {string} - id quit {chan bool} - quit signal.
func SendVisitor ¶
func SendVisitor(ws *websocket.Conn, db *database.DatabaseOp, id string, userId string, quit chan bool, topics *map[string]*string)
Send a socket to the visitor.
Arguments:
ws {*websocket.Conn} - websocket operator. db {*database.DatabaseOp} - database op. id {string} - id userId {string} - user id quit {chan bool} - quit signal. topics {*map[string]*string} - topics.
func TopicGetter ¶
func TopicGetter(db *database.DatabaseOp, topics *map[string]*string)
Types ¶
type CloseSocket ¶
type CloseSocket struct {
// contains filtered or unexported fields
}
func NewCloseSocket ¶
func NewCloseSocket(ws *websocket.Conn, db *database.DatabaseOp, id string) *CloseSocket
Create close socket instance.
Arguments:
ws {*websocket.Conn} - websocket db {*database.DatabaseOp} - database operator id {string} - id.
func (*CloseSocket) Host ¶
func (c *CloseSocket) Host() error
Close host.
- delete topic for id.
- delete answers for id.
- delete connect users for id.
func (*CloseSocket) HostNoErr ¶
func (c *CloseSocket) HostNoErr()
func (*CloseSocket) Visitor ¶
func (c *CloseSocket) Visitor(userId string) error
Close visitor.
- delete connect users for user id.
func (*CloseSocket) VisitorNoErr ¶
func (c *CloseSocket) VisitorNoErr(userId string)
type InitializeSocket ¶
type InitializeSocket struct {
// contains filtered or unexported fields
}
func NewInitSocket ¶
func NewInitSocket(ws *websocket.Conn, db *database.DatabaseOp) *InitializeSocket
Create initialize socket instance.
Arguments:
ws {*websocket.Conn} - websocket db {*database.DatabaseOp} - database operator
func (*InitializeSocket) Host ¶
func (c *InitializeSocket) Host() (string, error)
initialize host.
Returns:
{string} - id
type SendAnswers ¶
Click to show internal directories.
Click to hide internal directories.