Documentation
¶
Index ¶
- func GenerateSalt() (string, error)
- func HashPassword(password, salt string) string
- type AuthService
- func (a *AuthService) CreateSession(session *models.Session) (*models.Session, error)
- func (a *AuthService) CreateToken(id int64, email string, isAdmin bool, duration time.Duration) (string, *models.UserClaims, error)
- func (a *AuthService) CreateUser(userReq models.UserRegisterReq) (models.UserRegisterRes, error)
- func (a *AuthService) DeleteSession(id string) error
- func (a *AuthService) DeleteUser(id int64) error
- func (a *AuthService) GetSession(id string) (*models.Session, error)
- func (a *AuthService) GetUser(email, password string) (models.UserLogin, error)
- func (a *AuthService) RevokeSession(id string) error
- func (a *AuthService) UpdateUser(user *models.User) (*models.User, error)
- func (a *AuthService) VerifyAccessToken(tokenStr string) (*models.UserClaims, error)
- func (a *AuthService) VerifyRefreshToken(refreshTokenUUID string) (*models.UserClaims, error)
- type Authorization
- type Chat
- type ChatService
- func (s *ChatService) GetChatHistory(groupID string, limit, offset int) ([]models.Message, error)
- func (s *ChatService) GetUserData(userID int64) (models.Message, error)
- func (s *ChatService) IsUserInGroup(userID int64, groupID string) (bool, error)
- func (s *ChatService) SendMessage(message *models.Message) error
- type Group
- type GroupService
- type Notification
- type NotificationService
- type Service
- type Statistics
- type StatisticsService
- type Task
- type TaskService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSalt ¶
func HashPassword ¶
Types ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(repo repository.Authorization, secretKey []byte) *AuthService
func (*AuthService) CreateSession ¶
func (*AuthService) CreateToken ¶
func (a *AuthService) CreateToken(id int64, email string, isAdmin bool, duration time.Duration) (string, *models.UserClaims, error)
func (*AuthService) CreateUser ¶
func (a *AuthService) CreateUser(userReq models.UserRegisterReq) (models.UserRegisterRes, error)
func (*AuthService) DeleteSession ¶
func (a *AuthService) DeleteSession(id string) error
func (*AuthService) DeleteUser ¶
func (a *AuthService) DeleteUser(id int64) error
func (*AuthService) GetSession ¶
func (a *AuthService) GetSession(id string) (*models.Session, error)
func (*AuthService) GetUser ¶
func (a *AuthService) GetUser(email, password string) (models.UserLogin, error)
func (*AuthService) RevokeSession ¶
func (a *AuthService) RevokeSession(id string) error
func (*AuthService) UpdateUser ¶
func (*AuthService) VerifyAccessToken ¶
func (a *AuthService) VerifyAccessToken(tokenStr string) (*models.UserClaims, error)
func (*AuthService) VerifyRefreshToken ¶
func (a *AuthService) VerifyRefreshToken(refreshTokenUUID string) (*models.UserClaims, error)
type Authorization ¶
type Authorization interface { CreateUser(input models.UserRegisterReq) (models.UserRegisterRes, error) GetUser(email, password string) (models.UserLogin, error) UpdateUser(user *models.User) (*models.User, error) CreateToken(id int64, email string, isAdmin bool, duration time.Duration) (string, *models.UserClaims, error) VerifyAccessToken(tokenStr string) (*models.UserClaims, error) VerifyRefreshToken(refreshTokenUUID string) (*models.UserClaims, error) CreateSession(session *models.Session) (*models.Session, error) GetSession(id string) (*models.Session, error) RevokeSession(id string) error DeleteSession(id string) error }
type ChatService ¶
type ChatService struct {
// contains filtered or unexported fields
}
func NewChatService ¶
func NewChatService(repo repository.Chat) *ChatService
func (*ChatService) GetChatHistory ¶
func (*ChatService) GetUserData ¶
func (s *ChatService) GetUserData(userID int64) (models.Message, error)
func (*ChatService) IsUserInGroup ¶
func (s *ChatService) IsUserInGroup(userID int64, groupID string) (bool, error)
func (*ChatService) SendMessage ¶
func (s *ChatService) SendMessage(message *models.Message) error
type Group ¶
type Group interface {
CreateGroup(group *models.CreateGroupReq) error
}
type GroupService ¶
type GroupService struct {
// contains filtered or unexported fields
}
func NewGroupService ¶
func NewGroupService(repo repository.Group) *GroupService
func (*GroupService) CreateGroup ¶
func (g *GroupService) CreateGroup(group *models.CreateGroupReq) error
type Notification ¶
type Notification interface { }
type NotificationService ¶
type NotificationService struct {
// contains filtered or unexported fields
}
func NewNotificationService ¶
func NewNotificationService(repo repository.Notification) *NotificationService
type Service ¶
type Service struct { Authorization Task Group Notification Chat Statistics }
func NewService ¶
func NewService(repo *repository.Repository, secretKey []byte) *Service
type Statistics ¶
type Statistics interface { }
type StatisticsService ¶
type StatisticsService struct {
// contains filtered or unexported fields
}
func NewStatisticsService ¶
func NewStatisticsService(repo repository.Statistics) *StatisticsService
type TaskService ¶
type TaskService struct {
// contains filtered or unexported fields
}
func NewTaskService ¶
func NewTaskService(repo repository.Task) *TaskService
Click to show internal directories.
Click to hide internal directories.