Documentation
¶
Index ¶
- Constants
- type ActivationMailData
- type Article
- type ArticleService
- func (s *ArticleService) Create(ctx context.Context, article *model.Article) error
- func (s *ArticleService) FindAuthorArticles(ctx context.Context, authorID string) ([]*model.Article, error)
- func (s *ArticleService) FindByID(ctx context.Context, id int64) (*model.ArticleDto, error)
- func (s *ArticleService) FindLastArticles(ctx context.Context, limit int) ([]*model.ArticleDto, error)
- func (s *ArticleService) Search(ctx context.Context, query string) ([]*model.Article, error)
- type AuthService
- func (s *AuthService) Activate(ctx context.Context, activationLink string) error
- func (s *AuthService) FindResetPasswordToken(token string) (*model.ResetPasswordToken, error)
- func (s *AuthService) ResetPassword(token string, newPassword string) error
- func (s *AuthService) SaveResetPasswordToken(token *model.ResetPasswordToken) error
- func (s *AuthService) SignIn(user *model.User) (string, error)
- func (s *AuthService) SignUp(user *model.User) (string, error)
- type Authorization
- type Comment
- type CommentService
- type Mail
- type MailService
- type ResetPasswordTokenMailData
- type Service
- type User
- type UserService
Constants ¶
View Source
const ( ACTIVATION = "notifications.mail.activation" RESET_TOKENS = "notifications.mail.reset_tokens" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivationMailData ¶
type Article ¶
type Article interface { Create(ctx context.Context, article *model.Article) error FindByID(ctx context.Context, id int64) (*model.ArticleDto, error) Search(ctx context.Context, query string) ([]*model.Article, error) FindAuthorArticles(ctx context.Context, authorID string) ([]*model.Article, error) FindLastArticles(ctx context.Context, limit int) ([]*model.ArticleDto, error) }
type ArticleService ¶
type ArticleService struct {
// contains filtered or unexported fields
}
func NewArticleRepo ¶
func NewArticleRepo(repo *repository.Repository, rdb *redis.Client) *ArticleService
func (*ArticleService) FindAuthorArticles ¶
func (*ArticleService) FindByID ¶
func (s *ArticleService) FindByID(ctx context.Context, id int64) (*model.ArticleDto, error)
func (*ArticleService) FindLastArticles ¶
func (s *ArticleService) FindLastArticles(ctx context.Context, limit int) ([]*model.ArticleDto, error)
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(repo *repository.Repository, rabbitMQ *mq.MQConn, rdb *redis.Client) *AuthService
func (*AuthService) Activate ¶
func (s *AuthService) Activate(ctx context.Context, activationLink string) error
func (*AuthService) FindResetPasswordToken ¶
func (s *AuthService) FindResetPasswordToken(token string) (*model.ResetPasswordToken, error)
func (*AuthService) ResetPassword ¶
func (s *AuthService) ResetPassword(token string, newPassword string) error
func (*AuthService) SaveResetPasswordToken ¶
func (s *AuthService) SaveResetPasswordToken(token *model.ResetPasswordToken) error
type Authorization ¶
type CommentService ¶
type CommentService struct {
// contains filtered or unexported fields
}
func NewCommentService ¶
func NewCommentService(repo *repository.Repository, rdb *redis.Client) *CommentService
func (*CommentService) FindArticleComments ¶
func (s *CommentService) FindArticleComments(ctx context.Context, articleID int64) ([]*model.CommentDto, error)
type MailService ¶
type MailService struct {
// contains filtered or unexported fields
}
func NewMailService ¶
func NewMailService(rabbitMQ *mq.MQConn) *MailService
func (*MailService) ProcessActivationMails ¶
func (s *MailService) ProcessActivationMails()
func (*MailService) ProcessResetPasswordTokenMails ¶
func (s *MailService) ProcessResetPasswordTokenMails()
func (*MailService) SendActivationMail ¶
func (s *MailService) SendActivationMail(to []string, link string) error
func (*MailService) SendResetPasswordToken ¶
func (s *MailService) SendResetPasswordToken(to []string, token string) error
type Service ¶
type Service struct { Authorization Mail User Article Comment }
func New ¶
func New(repo *repository.Repository, rdb *redis.Client, rabbitMQ *mq.MQConn) *Service
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(repo *repository.Repository, rdb *redis.Client) *UserService
func (*UserService) FindByUsername ¶
func (*UserService) UpdateAvatar ¶
func (s *UserService) UpdateAvatar(c *gin.Context, userID uuid.UUID, image *multipart.FileHeader) error
Click to show internal directories.
Click to hide internal directories.