Documentation ¶
Overview ¶
This file is part of Assemble Web Chat.
Assemble Web Chat is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Assemble Web Chat is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Assemble Web Chat. If not, see <http://www.gnu.org/licenses/>.
This file is part of Assemble Web Chat.
Assemble Web Chat is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Assemble Web Chat is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Assemble Web Chat. If not, see <http://www.gnu.org/licenses/>.
This file is part of Assemble Web Chat.
Assemble Web Chat is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Assemble Web Chat is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Assemble Web Chat. If not, see <http://www.gnu.org/licenses/>.
This file is part of Assemble Web Chat.
Assemble Web Chat is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Assemble Web Chat is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Assemble Web Chat. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- func CreateNewUserToken(nick, name, email, phone, url, desc, avatar, alertaddress string) (*gabs.Container, error)
- func CreateUpdatedUserToken(nick, name, email, phone, url, desc, avatar, alertaddress, uid, privid string) (*gabs.Container, error)
- func PublicUserString(token *gabs.Container) string
- type Err
- type OnlineUser
- type Room
- type Service
- func (svc *Service) AddToRoom(so socketio.Socket, uid string, room string)
- func (svc *Service) BroadcastUserLeave(room string, uid string, so socketio.Socket)
- func (svc *Service) CanJoin(uid string, room string, removeinvite bool) bool
- func (svc *Service) CreateRoom(fname, roomid string, isprivate, isdirect bool, creatoruid string, ...) *Room
- func (svc *Service) CreateRoomList() string
- func (svc *Service) ExtractAndCheckToken(so socketio.Socket, g *gabs.Container) (string, bool)
- func (svc *Service) JoinRoom(so socketio.Socket, uid string, room string)
- func (svc *Service) JoinRooms(so socketio.Socket, uid string)
- func (svc *Service) SendAlert(toaddr, subject, message string)
- func (svc *Service) SendOnlineUserList(so socketio.Socket)
- func (svc *Service) SendRoomHistory(so socketio.Socket, uid, room string, last int)
- func (svc *Service) SendRoomUserList(so socketio.Socket, room string)
- func (svc *Service) SetUserOnline(uid string, so socketio.Socket)
- func (svc *Service) Start()
- func (svc *Service) ValidateUserToken(so socketio.Socket, msg string) (string, error)
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNewUserToken ¶
func CreateUpdatedUserToken ¶
func PublicUserString ¶
Types ¶
type OnlineUser ¶
OnlineUser has info for and online user including last active timestamp
type Room ¶
type Room struct { FriendlyName string RoomID string IsPrivate bool IsDirect bool CreatorUID string MemberUIDs map[string]string InvitedUIDs map[string]string DirectUIDs map[string]string MaxExpTime time.Duration MinExpTime time.Duration Avatar string MaxHistoryLen int Messages []*gabs.Container }
Room contains all room info, messages, user list, etc
type Service ¶
type Service struct { SocketServer *socketio.Server Cfg *config.Config Rooms map[string]*Room Users map[string]*User OnlineUsers map[string]*OnlineUser Invites map[string]string Banlist map[string]string UserKey []byte DefMaxExp time.Duration DefMinExp time.Duration IconsJs string }
Service holds the key parts of the assemble server
func NewService ¶
NewService creates an assemble server
func (*Service) BroadcastUserLeave ¶
func (*Service) CreateRoom ¶
func (svc *Service) CreateRoom(fname, roomid string, isprivate, isdirect bool, creatoruid string, maxexptime time.Duration, minexptime time.Duration, avatar string, maxhistorylen int) *Room
CreateRoom adds a room to the services list
func (*Service) CreateRoomList ¶
func (*Service) ExtractAndCheckToken ¶
func (*Service) SendOnlineUserList ¶
func (svc *Service) SendOnlineUserList(so socketio.Socket)