Documentation ¶
Index ¶
- Variables
- func HasAccessToDeleteMessage(chatType string, detail interface{}, userID model.UserID, ...) bool
- func HasAccessToSendMessage(chatType string, detail interface{}, userID model.UserID) bool
- func ReceiversIDs(chat *model.Chat) ([]model.UserID, error)
- type MessageService
- func (s *MessageService) DeleteMessage(ctx context.Context, chatID model.ChatID, userID model.UserID, ...) *vali.Varror
- func (s *MessageService) FetchMessages(ctx context.Context, chatID model.ChatID) ([]*model.MessageGetter, *vali.Varror)
- func (s *MessageService) SendTextMessage(ctx context.Context, chatID model.ChatID, userID model.UserID, ...) (*model.MessageGetter, *vali.Varror)
- func (s *MessageService) UpdateTextMessage(ctx context.Context, chatID primitive.ObjectID, newMessageContent string) *vali.Varror
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidValidation = errors.New("failed to validate arguments") ErrNotFound = errors.New("not found") ErrChatNotFound = errors.New("chat not found") ErrDeleteMessage = errors.New("failed to delete message") ErrInsertMessage = errors.New("failed to insert message") ErrAccessDenied = errors.New("access denied") )
Functions ¶
func HasAccessToSendMessage ¶
Types ¶
type MessageService ¶
type MessageService struct {
// contains filtered or unexported fields
}
func NewMessageService ¶
func NewMessageService(logger *log.SubLogger, messageRepo repository.MessageRepository, chatRepo repository.ChatRepository, userRepo repository.UserRepository, eventPublisher stream.StreamPublisher) *MessageService
func (*MessageService) DeleteMessage ¶
func (*MessageService) FetchMessages ¶
func (s *MessageService) FetchMessages(ctx context.Context, chatID model.ChatID) ([]*model.MessageGetter, *vali.Varror)
func (*MessageService) SendTextMessage ¶
func (*MessageService) UpdateTextMessage ¶
func (s *MessageService) UpdateTextMessage(ctx context.Context, chatID primitive.ObjectID, newMessageContent string) *vali.Varror
TODO - Implement UpdateTextMessage Method For MessageService
Click to show internal directories.
Click to hide internal directories.