repository

package
v0.0.0-...-b0c70ce Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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

type MockMongoDBService struct {
	mock.Mock
}

func (*MockMongoDBService) AddChat

func (m *MockMongoDBService) AddChat(contact *models.Contact) (*models.Chat, error)

func (*MockMongoDBService) CreateSessions

func (m *MockMongoDBService) CreateSessions(session *models.Session) (*models.Session, error)

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 (*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) LoginUser

func (m *MockMongoDBService) LoginUser(user *models.User) (*models.User, 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 (m *MockMongoDBService) SaveUserPersonalDataDB(userId primitive.ObjectID, personal *models.Personal) error

func (*MockMongoDBService) SendMessage

func (m *MockMongoDBService) SendMessage(msgReq *models.Message) (*models.Message, error)

type MongoDBService

type MongoDBService struct {
	DB *mongo.Database
}

func (*MongoDBService) AddChat

func (ms *MongoDBService) AddChat(contact *models.Contact) (*models.Chat, error)

func (*MongoDBService) CreateSessions

func (ms *MongoDBService) CreateSessions(session *models.Session) (*models.Session, error)

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) LoginUser

func (ms *MongoDBService) LoginUser(user *models.User) (*models.User, 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 (ms *MongoDBService) SaveUserPersonalDataDB(userId primitive.ObjectID, personal *models.Personal) error

func (*MongoDBService) SendMessage

func (ms *MongoDBService) SendMessage(msgReq *models.Message) (*models.Message, error)

type Service

type Service interface {
	UserRepository
	ChatRepository
	SessionsRepository
}

type SessionsRepository

type SessionsRepository interface {
	CreateSessions(session *models.Session) (*models.Session, error)
	GetRefresh(sessionId string) (string, error)
	GetSessions(id string) (*models.Session, error)
	RevokeSession(id string) error
	DeleteSession(id string) error
}

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL