Documentation
¶
Index ¶
- type ChatService
- func (cs ChatService) Create(userId int, chatWithTitle models.ChatFromRequest) (*models.Chat, utils.HttpError)
- func (cs ChatService) Delete(userId, chatId int) (*models.Chat, utils.HttpError)
- func (cs ChatService) GetOne(userId, chatId int) (*models.Chat, utils.HttpError)
- func (cs ChatService) GetUserChats(userId int) ([]models.Chat, utils.HttpError)
- func (cs ChatService) Update(userId int, chat models.Chat) (*models.Chat, utils.HttpError)
- type IChatService
- type IMessageService
- type IParticipantService
- type IUserService
- type MessageService
- func (ms MessageService) Create(userId int, fromRequest models.MessageFromRequest) (*models.Message, utils.HttpError)
- func (ms MessageService) Delete(userId int, message models.Message) (*models.Message, utils.HttpError)
- func (ms MessageService) GetChatMessages(userId, chatId, page int) ([]models.Message, utils.HttpError)
- func (ms MessageService) GetOne(userId, messageId int) (*models.Message, utils.HttpError)
- func (ms MessageService) Update(userId int, message models.Message) (*models.Message, utils.HttpError)
- type ParticipantService
- func (ps ParticipantService) Create(userId int, participant models.Participant) (*models.Participant, utils.HttpError)
- func (ps ParticipantService) Delete(userId int, participant models.Participant) (*models.Participant, utils.HttpError)
- func (ps ParticipantService) GetChatUsers(userId, chatId int) ([]models.ChatUser, utils.HttpError)
- func (ps ParticipantService) Update(userId int, participant models.Participant) (*models.Participant, utils.HttpError)
- func (ps ParticipantService) UserInChat(userId, chatId int) (bool, error)
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatService ¶
type ChatService struct {
ChatStorer models.IChatStorer
ParticipantStorer models.IParticipantStorer
MessageStorer models.IMessageStorer
ParticipantService IParticipantService
}
func NewChatService ¶
func NewChatService(chatStorer models.IChatStorer, participantStorer models.IParticipantStorer, messageStorer models.IMessageStorer, participantService ParticipantService) ChatService
func (ChatService) Create ¶
func (cs ChatService) Create(userId int, chatWithTitle models.ChatFromRequest) (*models.Chat, utils.HttpError)
func (ChatService) GetUserChats ¶
type IChatService ¶
type IChatService interface {
Create(userId int, chat models.ChatFromRequest) (*models.Chat, utils.HttpError)
GetOne(userId, chatId int) (*models.Chat, utils.HttpError)
GetUserChats(userId int) ([]models.Chat, utils.HttpError)
Update(userId int, chat models.Chat) (*models.Chat, utils.HttpError)
Delete(userId, chatId int) (*models.Chat, utils.HttpError)
}
type IMessageService ¶
type IMessageService interface {
Create(userId int, MessageTDO models.MessageFromRequest) (*models.Message, utils.HttpError)
GetOne(userId, messageId int) (*models.Message, utils.HttpError)
GetChatMessages(userId, chatId, page int) ([]models.Message, utils.HttpError)
Update(userId int, message models.Message) (*models.Message, utils.HttpError)
Delete(userId int, message models.Message) (*models.Message, utils.HttpError)
}
type IParticipantService ¶
type IParticipantService interface {
Create(userId int, participant models.Participant) (*models.Participant, utils.HttpError)
GetChatUsers(userId, chatId int) ([]models.ChatUser, utils.HttpError)
Update(userId int, participant models.Participant) (*models.Participant, utils.HttpError)
Delete(userId int, participant models.Participant) (*models.Participant, utils.HttpError)
UserInChat(userId, chatId int) (bool, error)
}
type IUserService ¶
type MessageService ¶
type MessageService struct {
MessageStorer models.IMessageStorer
ParticipantService IParticipantService
}
func NewMessageService ¶
func NewMessageService(messageStorer models.IMessageStorer, participantService IParticipantService) MessageService
func (MessageService) Create ¶
func (ms MessageService) Create(userId int, fromRequest models.MessageFromRequest) (*models.Message, utils.HttpError)
func (MessageService) GetChatMessages ¶
type ParticipantService ¶
type ParticipantService struct {
ParticipantStorer models.IParticipantStorer
}
func NewParticipantService ¶
func NewParticipantService(participantStorer models.IParticipantStorer) ParticipantService
func (ParticipantService) Create ¶
func (ps ParticipantService) Create(userId int, participant models.Participant) (*models.Participant, utils.HttpError)
func (ParticipantService) Delete ¶
func (ps ParticipantService) Delete(userId int, participant models.Participant) (*models.Participant, utils.HttpError)
func (ParticipantService) GetChatUsers ¶
func (ParticipantService) Update ¶
func (ps ParticipantService) Update(userId int, participant models.Participant) (*models.Participant, utils.HttpError)
func (ParticipantService) UserInChat ¶
func (ps ParticipantService) UserInChat(userId, chatId int) (bool, error)
type UserService ¶
type UserService struct {
UserStorer models.IUserStorer
}
func NewUserService ¶
func NewUserService(userStorer models.IUserStorer) UserService
Click to show internal directories.
Click to hide internal directories.