Documentation
¶
Index ¶
- Constants
- type AddCommentParams
- type AddFavoriteParams
- type AddTagsPayload
- type ArticleRepository
- type ArticleService
- type AssignTagPayload
- type AuthParams
- type CreateArticleTxParams
- type DeleteArticleParams
- type DeleteCommentParams
- type FilterArticlePayload
- type FilterArticleTagPayload
- type FilterCommentPayload
- type FilterFavoritePayload
- type FilterTagPayload
- type FilterUserFollowPayload
- type FilterUserPayload
- type GetArticleParams
- type ListArticleParams
- type ListCommentParams
- type LogEvent
- type Logger
- type LoginParams
- type ProfileParams
- type RegisterParams
- type RemoveFavoriteParams
- type Repository
- type RepositoryAtomicCallback
- type Server
- type Service
- type UpdateArticleParams
- type UpdateUserParams
- type UserRepository
- type UserService
Constants ¶
View Source
const SubLoggerCtxKey = "sub_logger"
set context value with this key
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddCommentParams ¶
type AddCommentParams struct { AuthArg AuthParams Slug string Comment domain.Comment }
type AddFavoriteParams ¶
type AddFavoriteParams struct { AuthArg AuthParams Slug string UserID domain.ID }
type AddTagsPayload ¶
type AddTagsPayload struct {
Tags []string
}
type ArticleRepository ¶
type ArticleRepository interface { CreateArticle(context.Context, domain.Article) (domain.Article, error) UpdateArticle(context.Context, domain.Article) (domain.Article, error) DeleteArticle(context.Context, domain.Article) error FilterArticle(context.Context, FilterArticlePayload) ([]domain.Article, error) FindOneArticle(context.Context, FilterArticlePayload) (domain.Article, error) FilterTags(context.Context, FilterTagPayload) ([]domain.Tag, error) AddTags(context.Context, AddTagsPayload) ([]domain.Tag, error) FilterArticleTags(context.Context, FilterArticleTagPayload) ([]domain.ArticleTag, error) AssignArticleTags(context.Context, AssignTagPayload) ([]domain.ArticleTag, error) AddFavorite(context.Context, domain.ArticleFavorite) (domain.ArticleFavorite, error) RemoveFavorite(context.Context, domain.ArticleFavorite) (domain.ArticleFavorite, error) FilterFavorite(context.Context, FilterFavoritePayload) ([]domain.ArticleFavorite, error) FilterFavoriteCount(context.Context, FilterFavoritePayload) ([]domain.ArticleFavoriteCount, error) AddComment(context.Context, domain.Comment) (domain.Comment, error) DeleteComment(context.Context, domain.Comment) error FilterComment(context.Context, FilterCommentPayload) ([]domain.Comment, error) }
type ArticleService ¶
type ArticleService interface { Create(context.Context, CreateArticleTxParams) (domain.Article, error) Update(context.Context, UpdateArticleParams) (domain.Article, error) Delete(context.Context, DeleteArticleParams) error List(context.Context, ListArticleParams) ([]domain.Article, error) Feed(context.Context, ListArticleParams) ([]domain.Article, error) Get(context.Context, GetArticleParams) (domain.Article, error) AddComment(context.Context, AddCommentParams) (domain.Comment, error) ListComments(context.Context, ListCommentParams) ([]domain.Comment, error) DeleteComment(context.Context, DeleteCommentParams) error AddFavorite(context.Context, AddFavoriteParams) (domain.Article, error) RemoveFavorite(context.Context, RemoveFavoriteParams) (domain.Article, error) ListTags(context.Context) ([]string, error) }
type AuthParams ¶
type CreateArticleTxParams ¶
type CreateArticleTxParams struct { AuthArg AuthParams Article domain.Article Tags []string }
type DeleteArticleParams ¶
type DeleteArticleParams struct { AuthArg AuthParams Slug string }
type DeleteCommentParams ¶
type DeleteCommentParams struct { AuthArg AuthParams Slug string CommentID domain.ID }
type FilterArticlePayload ¶
type FilterArticleTagPayload ¶
type FilterCommentPayload ¶
type FilterFavoritePayload ¶
type FilterTagPayload ¶
type FilterUserFollowPayload ¶
type FilterUserPayload ¶
type GetArticleParams ¶
type GetArticleParams struct { AuthArg AuthParams Slug string }
type ListArticleParams ¶
type ListCommentParams ¶
type ListCommentParams struct { AuthArg AuthParams Slug string }
type Logger ¶
type LoginParams ¶
type ProfileParams ¶
type ProfileParams struct { AuthArg AuthParams Username string }
type RegisterParams ¶
type RemoveFavoriteParams ¶
type RemoveFavoriteParams AddFavoriteParams
type Repository ¶
type Repository interface { Atomic(context.Context, RepositoryAtomicCallback) error User() UserRepository Article() ArticleRepository }
type RepositoryAtomicCallback ¶
type RepositoryAtomicCallback func(r Repository) error
type Service ¶
type Service interface { TokenMaker() token.Maker User() UserService Article() ArticleService }
type UpdateArticleParams ¶
type UpdateArticleParams struct { AuthArg AuthParams Slug string Article domain.Article }
type UpdateUserParams ¶
type UpdateUserParams struct { AuthArg AuthParams User domain.User }
type UserRepository ¶
type UserRepository interface { CreateUser(context.Context, domain.User) (domain.User, error) UpdateUser(context.Context, domain.User) (domain.User, error) FilterUser(context.Context, FilterUserPayload) ([]domain.User, error) FindOne(context.Context, FilterUserPayload) (domain.User, error) FilterFollow(context.Context, FilterUserFollowPayload) ([]domain.UserFollow, error) Follow(context.Context, domain.UserFollow) (domain.UserFollow, error) UnFollow(context.Context, domain.UserFollow) (domain.UserFollow, error) }
type UserService ¶
type UserService interface { Register(context.Context, RegisterParams) (domain.User, error) Login(context.Context, LoginParams) (domain.User, error) Update(context.Context, UpdateUserParams) (domain.User, error) Current(context.Context, AuthParams) (domain.User, error) Profile(context.Context, ProfileParams) (domain.User, error) Follow(context.Context, ProfileParams) (domain.User, error) UnFollow(context.Context, ProfileParams) (domain.User, error) }
Click to show internal directories.
Click to hide internal directories.