Documentation ¶
Index ¶
- type AlreadyExistsError
- type ArticlesService
- func (articlesService *ArticlesService) CreateArticle(ctx context.Context, createArticle CreateArticle) (*model.Article, error)
- func (articlesService *ArticlesService) CreateComment(ctx context.Context, articleId uuid.UUID, authorId uuid.UUID, body string) (*model.ArticleComment, error)
- func (articlesService *ArticlesService) DeleteArticle(ctx context.Context, articleId uuid.UUID) error
- func (articlesService *ArticlesService) DeleteComment(ctx context.Context, commentId uuid.UUID) error
- func (articlesService *ArticlesService) FavoriteArticle(ctx context.Context, userId uuid.UUID, articleId uuid.UUID) error
- func (articlesService *ArticlesService) GetArticleById(ctx context.Context, articleId uuid.UUID) (*model.Article, error)
- func (articlesService *ArticlesService) GetArticleBySlug(ctx context.Context, slug string) (*model.Article, error)
- func (articlesService *ArticlesService) GetCommentById(ctx context.Context, commentId uuid.UUID) (*model.ArticleComment, error)
- func (articlesService *ArticlesService) GetFavoritesCount(ctx context.Context, articleId uuid.UUID) (*int, error)
- func (articlesService *ArticlesService) IsFavorite(ctx context.Context, userId uuid.UUID, articleId uuid.UUID) (*bool, error)
- func (articlesService *ArticlesService) ListArticles(ctx context.Context, listArticles ListArticles) (*[]model.Article, error)
- func (articlesService *ArticlesService) ListComments(ctx context.Context, listComments ListComments) (*[]model.ArticleComment, error)
- func (articlesService *ArticlesService) ListTags(ctx context.Context, listTags ListTags) (*[]model.ArticleTag, error)
- func (articlesService *ArticlesService) UnfavoriteArticle(ctx context.Context, userId uuid.UUID, articleId uuid.UUID) error
- func (articlesService *ArticlesService) UpdateArticle(ctx context.Context, articleId uuid.UUID, updateArticle UpdateArticle) (*model.Article, error)
- type CreateArticle
- type InvalidArgumentError
- type ListArticles
- type ListComments
- type ListTags
- type ListUsers
- type NotFoundError
- type Profile
- type ProfilesService
- func (profilesService *ProfilesService) FollowUser(ctx context.Context, followerId uuid.UUID, followedId uuid.UUID) error
- func (profilesService *ProfilesService) GetProfile(ctx context.Context, userId uuid.UUID, followerId *uuid.UUID) (*Profile, error)
- func (profilesService *ProfilesService) IsFollowing(ctx context.Context, followerId uuid.UUID, followedId uuid.UUID) (*bool, error)
- func (profilesService *ProfilesService) ListFollowedProfiles(ctx context.Context, userId uuid.UUID) (*[]Profile, error)
- func (profilesService *ProfilesService) UnfollowUser(ctx context.Context, followerId uuid.UUID, followedId uuid.UUID) error
- type RegisterUser
- type UpdateArticle
- type UpdateUser
- type UsersService
- func (usersService *UsersService) CheckPassword(ctx context.Context, userId uuid.UUID, password string) (*bool, error)
- func (usersService *UsersService) GetToken(ctx context.Context, user *model.Users) (*string, error)
- func (usersService *UsersService) GetUserByEmail(ctx context.Context, email string) (*model.Users, error)
- func (usersService *UsersService) GetUserById(ctx context.Context, userId uuid.UUID) (*model.Users, error)
- func (usersService *UsersService) GetUserByToken(ctx context.Context, token string) (*model.Users, error)
- func (usersService *UsersService) GetUserByUsername(ctx context.Context, username string) (*model.Users, error)
- func (usersService *UsersService) ListUsers(ctx context.Context, listUsers ListUsers) (*[]model.Users, error)
- func (usersService *UsersService) RegisterUser(ctx context.Context, registerUser RegisterUser) (*model.Users, error)
- func (usersService *UsersService) UpdateUser(ctx context.Context, userId uuid.UUID, updateUser UpdateUser) (*model.Users, error)
- type UsersServiceJWT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlreadyExistsError ¶
type AlreadyExistsError struct {
// contains filtered or unexported fields
}
func (*AlreadyExistsError) Error ¶
func (err *AlreadyExistsError) Error() string
type ArticlesService ¶
type ArticlesService struct {
// contains filtered or unexported fields
}
func NewArticlesService ¶
func NewArticlesService(db *sql.DB, logger *slog.Logger, usersService *UsersService) ArticlesService
func (*ArticlesService) CreateArticle ¶
func (articlesService *ArticlesService) CreateArticle(ctx context.Context, createArticle CreateArticle) (*model.Article, error)
func (*ArticlesService) CreateComment ¶
func (*ArticlesService) DeleteArticle ¶
func (*ArticlesService) DeleteComment ¶
func (*ArticlesService) FavoriteArticle ¶
func (*ArticlesService) GetArticleById ¶
func (*ArticlesService) GetArticleBySlug ¶
func (*ArticlesService) GetCommentById ¶
func (articlesService *ArticlesService) GetCommentById(ctx context.Context, commentId uuid.UUID) (*model.ArticleComment, error)
func (*ArticlesService) GetFavoritesCount ¶
func (*ArticlesService) IsFavorite ¶
func (*ArticlesService) ListArticles ¶
func (articlesService *ArticlesService) ListArticles(ctx context.Context, listArticles ListArticles) (*[]model.Article, error)
func (*ArticlesService) ListComments ¶
func (articlesService *ArticlesService) ListComments(ctx context.Context, listComments ListComments) (*[]model.ArticleComment, error)
func (*ArticlesService) ListTags ¶
func (articlesService *ArticlesService) ListTags(ctx context.Context, listTags ListTags) (*[]model.ArticleTag, error)
func (*ArticlesService) UnfavoriteArticle ¶
func (*ArticlesService) UpdateArticle ¶
func (articlesService *ArticlesService) UpdateArticle(ctx context.Context, articleId uuid.UUID, updateArticle UpdateArticle) (*model.Article, error)
type CreateArticle ¶
type CreateArticle struct { AuthorID uuid.UUID Title string Description string Body string TagList *[]string }
func NewCreateArticle ¶
type InvalidArgumentError ¶
type InvalidArgumentError struct {
// contains filtered or unexported fields
}
func (*InvalidArgumentError) Error ¶
func (err *InvalidArgumentError) Error() string
type ListArticles ¶
type ListComments ¶
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
func (*NotFoundError) Error ¶
func (err *NotFoundError) Error() string
type ProfilesService ¶
type ProfilesService struct {
// contains filtered or unexported fields
}
func NewProfilesService ¶
func NewProfilesService(db *sql.DB, logger *slog.Logger, usersService *UsersService) ProfilesService
func (*ProfilesService) FollowUser ¶
func (*ProfilesService) GetProfile ¶
func (*ProfilesService) IsFollowing ¶
func (*ProfilesService) ListFollowedProfiles ¶
func (*ProfilesService) UnfollowUser ¶
type RegisterUser ¶
func NewRegisterUser ¶
func NewRegisterUser(email string, username string, password string) RegisterUser
type UpdateArticle ¶
type UpdateUser ¶
type UsersService ¶
type UsersService struct {
// contains filtered or unexported fields
}
func NewUsersService ¶
func NewUsersService(db *sql.DB, jwt *UsersServiceJWT, logger *slog.Logger) UsersService
func (*UsersService) CheckPassword ¶
func (*UsersService) GetUserByEmail ¶
func (*UsersService) GetUserById ¶
func (*UsersService) GetUserByToken ¶
func (*UsersService) GetUserByUsername ¶
func (*UsersService) RegisterUser ¶
func (usersService *UsersService) RegisterUser(ctx context.Context, registerUser RegisterUser) (*model.Users, error)
func (*UsersService) UpdateUser ¶
func (usersService *UsersService) UpdateUser(ctx context.Context, userId uuid.UUID, updateUser UpdateUser) (*model.Users, error)
type UsersServiceJWT ¶
type UsersServiceJWT struct {
// contains filtered or unexported fields
}
func NewUsersServiceJWT ¶
func NewUsersServiceJWT(iss string, key []byte, validForSeconds int) UsersServiceJWT
Click to show internal directories.
Click to hide internal directories.