Documentation
¶
Index ¶
- type Account
- type BroadcastPackage
- type Chat
- func (c *Chat) AddMessage(message models.Message) (*models.Message, *conf.ApiError)
- func (c *Chat) AddReaction(profileID string, roomID string, messageID string, reaction string) *conf.ApiError
- func (c *Chat) AddRoomMember(profileID string, roomID string, memberID string) (*models.Room, *conf.ApiError)
- func (c *Chat) CreateRoom(profileID string, room models.Room) (*models.Room, *conf.ApiError)
- func (c *Chat) DeleteRoom(profileID string, roomID string) *conf.ApiError
- func (c *Chat) EditMessage(profileID string, messageID string, body string) *conf.ApiError
- func (c *Chat) GetAllMembersInfo(profileID string, roomID string) ([]models.MemberInfo, *conf.ApiError)
- func (c *Chat) GetAllRoomsInfo(profileID string) ([]models.MemberInfo, *conf.ApiError)
- func (c *Chat) GetMemberInfo(profileID string, roomID string) (*models.MemberInfo, *conf.ApiError)
- func (c *Chat) GetMessages(profileID string, roomID string, from time.Time, limit int) ([]models.Message, *conf.ApiError)
- func (c *Chat) GetRoom(profileID string, roomID string) (*models.Room, *conf.ApiError)
- func (c *Chat) GetRooms(profileID string) ([]models.Room, *conf.ApiError)
- func (c *Chat) RemoveRoomMember(profileID string, roomID string, memberID string) *conf.ApiError
- func (c *Chat) UpdateLastReadTime(profileID string, roomID string) *conf.ApiError
- type Connection
- type ConnectionManager
- type FBError
- type FBPermission
- type FBPermissionsResponse
- type Facebook
- func (f *Facebook) ExchangeCodeToToken(accessCode string) (string, *conf.ApiError)
- func (f *Facebook) GetFriends(profileID string) ([]models.User, *conf.ApiError)
- func (f *Facebook) GetProfile(accessToken string) (*models.User, *conf.ApiError)
- func (f *Facebook) GetUser(profileID string) (*models.User, *conf.ApiError)
- func (f *Facebook) HasFriendsPermissions(profileID string) *conf.ApiError
- type Friends
- type MessageJob
- type OAuth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BroadcastPackage ¶
type Chat ¶
type Chat struct {
// contains filtered or unexported fields
}
func (*Chat) AddMessage ¶
Adds new message to the chat log Additionally checks that current user is a member of that chat room.
func (*Chat) AddReaction ¶
func (c *Chat) AddReaction(profileID string, roomID string, messageID string, reaction string) *conf.ApiError
Adds reaction to a specific message
func (*Chat) AddRoomMember ¶
func (c *Chat) AddRoomMember(profileID string, roomID string, memberID string) (*models.Room, *conf.ApiError)
Add room member to a specific chat room. Checks if members count exceeds the configured maximum
func (*Chat) CreateRoom ¶
Checks if user exceeds the maximum of opened chat rooms and creates a new room
func (*Chat) DeleteRoom ¶
Remove room association of the current user. If user is an owner of the specific group chat then this chat will be deleted.
func (*Chat) EditMessage ¶
Modifies the specific message
func (*Chat) GetAllMembersInfo ¶
func (c *Chat) GetAllMembersInfo(profileID string, roomID string) ([]models.MemberInfo, *conf.ApiError)
Returns all chat members info
func (*Chat) GetAllRoomsInfo ¶
Returns all chat member infos for a given member
func (*Chat) GetMemberInfo ¶
Returns chat member info
func (*Chat) GetMessages ¶
func (c *Chat) GetMessages(profileID string, roomID string, from time.Time, limit int) ([]models.Message, *conf.ApiError)
Returns chat log for a given period
func (*Chat) RemoveRoomMember ¶
Removes room member by the room owner. If there are no more members then delete the room entirely.
type Connection ¶
type Connection struct { UserID string // abstract user ID DeviceID middleware.DeviceID // user device ID to support chats opened on several devices Socket *websocket.Conn // socket connection for incoming messages and notifications }
Connection DTO for channel
type ConnectionManager ¶
type ConnectionManager struct { Connections map[string]map[middleware.DeviceID]*websocket.Conn Register chan *Connection Unregister chan *Connection Broadcast chan *BroadcastPackage // contains filtered or unexported fields }
func NewConnectionManager ¶
func NewConnectionManager(bus db.Bus, socketConf conf.SocketConf) *ConnectionManager
type FBPermission ¶
type FBPermission struct {
// contains filtered or unexported fields
}
type FBPermissionsResponse ¶
type FBPermissionsResponse struct {
// contains filtered or unexported fields
}
type Facebook ¶
type Facebook struct {
// contains filtered or unexported fields
}
Facebook Service performs necessary operations related to the Facebook.com social network such as:
- retrieving client token by service credentials
- exchanging authorization code to access token
- retrieving user profile
- retrieving user friends list
- retrieving user by id
func NewFacebook ¶
func NewFacebook(options conf.FacebookConf, httpClient *http.Client) (f *Facebook)
func (*Facebook) ExchangeCodeToToken ¶
Exchanges user authorization code to its access token.
func (*Facebook) GetFriends ¶
Retrieves user friends list.
func (*Facebook) GetProfile ¶
Retrieves user profile using access token.
type MessageJob ¶
type MessageJob struct {
// contains filtered or unexported fields
}