Documentation ¶
Index ¶
- Constants
- Variables
- type ChatService
- func (s *ChatService) CreateChannel(ctx context.Context, userID model.UserID, title string, username string, ...) (*model.ChatDTO, *vali.Varror)
- func (s *ChatService) CreateDirect(ctx context.Context, userID model.UserID, recipientUserID model.UserID) (*model.ChatDTO, *vali.Varror)
- func (s *ChatService) CreateGroup(ctx context.Context, userID model.UserID, title string, username string, ...) (*model.ChatDTO, *vali.Varror)
- func (s *ChatService) GetChat(ctx context.Context, userID model.UserID, chatID model.ChatID) (*model.Chat, *vali.Varror)
- func (s *ChatService) GetDirectChat(ctx context.Context, userID, recipientUserID model.UserID) (*model.ChatDTO, *vali.Varror)
- func (s *ChatService) GetUserChats(ctx context.Context, userID model.UserID) ([]model.ChatDTO, *vali.Varror)
- func (s *ChatService) JoinChat(ctx context.Context, chatID model.ChatID, userID model.UserID) (*JoinChatResult, *vali.Varror)
- type JoinChatResult
Constants ¶
View Source
const SubjChats = "chats"
Variables ¶
View Source
var ( ErrInvalidValidation = errors.New("failed to validate arguments") ErrCreateChat = errors.New("unable to create chat") ErrNotFound = errors.New("not found") ErrGetUserChats = errors.New("failed to get user chats") ErrChatAlreadyExists = errors.New("chat already exists") ErrUnableToAddChatToUsersList = errors.New("unable to add add chat to users list") ErrUserJoinedBefore = errors.New("user already is a member of the chat") ErrJoinDirectChat = errors.New("joining direct chat is not possible") ErrRecipientNotFound = errors.New("recipient not found") ErrMessageStoreCreation = errors.New("failed to create message store for chat") )
Functions ¶
This section is empty.
Types ¶
type ChatService ¶
type ChatService struct {
// contains filtered or unexported fields
}
func NewChatService ¶
func NewChatService(logger *log.SubLogger, chatRepo repository.ChatRepository, userRepo repository.UserRepository, messageRepo repository.MessageRepository, eventPublisher stream.StreamPublisher) *ChatService
func (*ChatService) CreateChannel ¶
func (*ChatService) CreateDirect ¶
func (*ChatService) CreateGroup ¶
func (*ChatService) GetChat ¶
func (s *ChatService) GetChat(ctx context.Context, userID model.UserID, chatID model.ChatID) (*model.Chat, *vali.Varror)
find single chat with chat id
func (*ChatService) GetDirectChat ¶
type JoinChatResult ¶
Click to show internal directories.
Click to hide internal directories.