Documentation ¶
Index ¶
- type ChatRepository
- type MockMongoDBService
- func (m *MockMongoDBService) AddChat(contact *models.Contact) (*models.Chat, error)
- func (m *MockMongoDBService) CreateSessions(session *models.Session) (*models.Session, error)
- func (m *MockMongoDBService) DeleteChat(chatId string) error
- func (m *MockMongoDBService) DeleteMessage(msgId string) error
- func (m *MockMongoDBService) DeleteSession(id string) error
- func (m *MockMongoDBService) EditMessage(msgId, newMsg string) (*models.Message, error)
- func (m *MockMongoDBService) GetRefresh(sessionId string) (string, error)
- func (m *MockMongoDBService) GetSessions(id string) (*models.Session, error)
- func (m *MockMongoDBService) GetUserById(user *models.UserDataResponse, id primitive.ObjectID) error
- func (m *MockMongoDBService) LoadChats(userId string) ([]models.Chat, error)
- func (m *MockMongoDBService) LoadMessages(chatId string) ([]models.Message, error)
- func (m *MockMongoDBService) LoginUser(user *models.User) (*models.User, error)
- func (m *MockMongoDBService) RegisterUser(user *models.User) (*mongo.InsertOneResult, error)
- func (m *MockMongoDBService) RevokeSession(id string) error
- func (m *MockMongoDBService) SaveUserPersonalDataDB(userId primitive.ObjectID, personal *models.Personal) error
- func (m *MockMongoDBService) SendMessage(msgReq *models.Message) (*models.Message, error)
- type MongoDBService
- func (ms *MongoDBService) AddChat(contact *models.Contact) (*models.Chat, error)
- func (ms *MongoDBService) CreateSessions(session *models.Session) (*models.Session, error)
- func (ms *MongoDBService) DeleteChat(chatId string) error
- func (ms *MongoDBService) DeleteMessage(msgId string) error
- func (ms *MongoDBService) DeleteSession(id string) error
- func (ms *MongoDBService) EditMessage(msgId, newMsg string) (*models.Message, error)
- func (ms *MongoDBService) GetRefresh(sessionId string) (string, error)
- func (ms *MongoDBService) GetSessions(id string) (*models.Session, error)
- func (ms *MongoDBService) GetUserById(user *models.UserDataResponse, id primitive.ObjectID) error
- func (ms *MongoDBService) LoadChats(userId string) (chats []models.Chat, err error)
- func (ms *MongoDBService) LoadMessages(chatId string) ([]models.Message, error)
- func (ms *MongoDBService) LoginUser(user *models.User) (*models.User, error)
- func (ms *MongoDBService) RegisterUser(user *models.User) (*mongo.InsertOneResult, error)
- func (ms *MongoDBService) RevokeSession(id string) error
- func (ms *MongoDBService) SaveUserPersonalDataDB(userId primitive.ObjectID, personal *models.Personal) error
- func (ms *MongoDBService) SendMessage(msgReq *models.Message) (*models.Message, error)
- type Service
- type SessionsRepository
- type UserRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatRepository ¶
type ChatRepository interface { LoadChats(userId string) ([]models.Chat, error) AddChat(contact *models.Contact) (*models.Chat, error) DeleteChat(chatId string) error SendMessage(msgReq *models.Message) (*models.Message, error) LoadMessages(chatId string) ([]models.Message, error) EditMessage(msgId, newMsg string) (*models.Message, error) DeleteMessage(msgId string) error }
type MockMongoDBService ¶
func (*MockMongoDBService) CreateSessions ¶
func (*MockMongoDBService) DeleteChat ¶
func (m *MockMongoDBService) DeleteChat(chatId string) error
func (*MockMongoDBService) DeleteMessage ¶
func (m *MockMongoDBService) DeleteMessage(msgId string) error
func (*MockMongoDBService) DeleteSession ¶
func (m *MockMongoDBService) DeleteSession(id string) error
func (*MockMongoDBService) EditMessage ¶
func (m *MockMongoDBService) EditMessage(msgId, newMsg string) (*models.Message, error)
func (*MockMongoDBService) GetRefresh ¶
func (m *MockMongoDBService) GetRefresh(sessionId string) (string, error)
func (*MockMongoDBService) GetSessions ¶
func (m *MockMongoDBService) GetSessions(id string) (*models.Session, error)
func (*MockMongoDBService) GetUserById ¶
func (m *MockMongoDBService) GetUserById(user *models.UserDataResponse, id primitive.ObjectID) error
func (*MockMongoDBService) LoadChats ¶
func (m *MockMongoDBService) LoadChats(userId string) ([]models.Chat, error)
func (*MockMongoDBService) LoadMessages ¶
func (m *MockMongoDBService) LoadMessages(chatId string) ([]models.Message, error)
func (*MockMongoDBService) RegisterUser ¶
func (m *MockMongoDBService) RegisterUser(user *models.User) (*mongo.InsertOneResult, error)
func (*MockMongoDBService) RevokeSession ¶
func (m *MockMongoDBService) RevokeSession(id string) error
func (*MockMongoDBService) SaveUserPersonalDataDB ¶
func (*MockMongoDBService) SendMessage ¶
type MongoDBService ¶
func (*MongoDBService) CreateSessions ¶
func (*MongoDBService) DeleteChat ¶
func (ms *MongoDBService) DeleteChat(chatId string) error
func (*MongoDBService) DeleteMessage ¶
func (ms *MongoDBService) DeleteMessage(msgId string) error
func (*MongoDBService) DeleteSession ¶
func (ms *MongoDBService) DeleteSession(id string) error
func (*MongoDBService) EditMessage ¶
func (ms *MongoDBService) EditMessage(msgId, newMsg string) (*models.Message, error)
func (*MongoDBService) GetRefresh ¶
func (ms *MongoDBService) GetRefresh(sessionId string) (string, error)
func (*MongoDBService) GetSessions ¶
func (ms *MongoDBService) GetSessions(id string) (*models.Session, error)
func (*MongoDBService) GetUserById ¶
func (ms *MongoDBService) GetUserById(user *models.UserDataResponse, id primitive.ObjectID) error
func (*MongoDBService) LoadChats ¶
func (ms *MongoDBService) LoadChats(userId string) (chats []models.Chat, err error)
func (*MongoDBService) LoadMessages ¶
func (ms *MongoDBService) LoadMessages(chatId string) ([]models.Message, error)
func (*MongoDBService) RegisterUser ¶
func (ms *MongoDBService) RegisterUser(user *models.User) (*mongo.InsertOneResult, error)
func (*MongoDBService) RevokeSession ¶
func (ms *MongoDBService) RevokeSession(id string) error
func (*MongoDBService) SaveUserPersonalDataDB ¶
func (*MongoDBService) SendMessage ¶
type Service ¶
type Service interface { UserRepository ChatRepository SessionsRepository }
type SessionsRepository ¶
type UserRepository ¶
type UserRepository interface { RegisterUser(user *models.User) (*mongo.InsertOneResult, error) LoginUser(user *models.User) (*models.User, error) GetUserById(user *models.UserDataResponse, id primitive.ObjectID) error SaveUserPersonalDataDB(userId primitive.ObjectID, personal *models.Personal) error }
Click to show internal directories.
Click to hide internal directories.