Documentation ¶
Index ¶
- Constants
- func Connect(w http.ResponseWriter, r *http.Request)
- func Contains(slice interface{}, x interface{}) bool
- func CreateRoom(msg *chc.Message) chc.InitRoom
- func DeleteRoom(room *chc.Room, userid string)
- func GetIndexOfVal(slice interface{}, x interface{}) int
- func HandleUserSecurity(user chc.User, msg chc.Message) bool
- func JoinRoom(user *chc.User, iroom chc.InitRoom) int
- func LeaveRoom(user *chc.User, roomid string)
- func PolicyViolation(c *websocket.Conn, message string) bool
- func RemoveIndex(slice interface{}, i int) interface{}
- func SendToUsers(users map[string]*chc.User, message chc.Message)
- func Start(port string)
Constants ¶
View Source
const ( OPWelcome = 1 OPTextMessage = 100 OPCreateRoom = 200 OPUserJoin = 210 OPUserLeave = 211 OPDeleteRoom = 212 OPStatusChange = 300 OPReceiveOK = 400 OPReceiveNotFound = 404 )
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains(slice interface{}, x interface{}) bool
Contains checks if a slice contains an element.
func DeleteRoom ¶
func GetIndexOfVal ¶
func GetIndexOfVal(slice interface{}, x interface{}) int
GetIndexOfVal returns the index of a value in a slice.
func HandleUserSecurity ¶
HandleUserSecurity makes sure all protocols are followed and the user token is not stolen. Returns true if everything is OK.
func PolicyViolation ¶
PolicyViolation sends a close message to a connection and always returns false.
func RemoveIndex ¶
func RemoveIndex(slice interface{}, i int) interface{}
func SendToUsers ¶
SendToUsers sends a message to certain websocket connections.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.