Documentation
¶
Index ¶
- Variables
- func NewFilters(author, tag, favorite string) []domain.ArticleFilter
- type ArticleLogic
- type ArticleRW
- type ArticleValidator
- type ArticlesLogic
- type AuthHandler
- type CommentRW
- type CommentsLogic
- type FavoritesLogic
- type Handler
- type HandlerConstructor
- type Logger
- type ProfileLogic
- type Slugger
- type TagsLogic
- type TagsRW
- type UserLogic
- type UserRW
- type UserValidator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadyInUse = errors.New("this username is already in use") ErrNotFound = errors.New("user not found") )
Functions ¶
func NewFilters ¶
func NewFilters(author, tag, favorite string) []domain.ArticleFilter
Types ¶
type ArticleLogic ¶
type ArticleLogic interface { ArticleGet(slug, username string) (*domain.User, *domain.Article, error) ArticlePost(username string, article domain.Article) (*domain.User, *domain.Article, error) ArticlePut(username, slug string, fieldsToUpdate map[domain.ArticleUpdatableField]*string) (*domain.User, *domain.Article, error) ArticleDelete(username, slug string) error }
type ArticleRW ¶
type ArticleRW interface { Create(domain.Article) (*domain.Article, error) Save(domain.Article) (*domain.Article, error) GetBySlug(slug string) (*domain.Article, error) GetByAuthorsNameOrderedByMostRecentAsc(usernames []string) ([]domain.Article, error) GetRecentFiltered(filters []domain.ArticleFilter) ([]domain.Article, error) Delete(slug string) error }
type ArticleValidator ¶
type ArticlesLogic ¶
type ArticlesLogic interface { ArticlesFeed(username string, limit, offset int) (requestingUser *domain.User, articles domain.ArticleCollection, totalArticleCount int, err error) GetArticles(username string, limit, offset int, filters []domain.ArticleFilter) (requestingUser *domain.User, articles domain.ArticleCollection, totalArticleCount int, err error) }
type AuthHandler ¶
type CommentsLogic ¶
type FavoritesLogic ¶
type Handler ¶
type Handler interface { ProfileLogic UserLogic ArticlesLogic ArticleLogic CommentsLogic FavoritesLogic TagsLogic }
type HandlerConstructor ¶
type HandlerConstructor struct { Logger Logger UserRW UserRW ArticleRW ArticleRW CommentRW CommentRW UserValidator UserValidator AuthHandler AuthHandler Slugger Slugger ArticleValidator ArticleValidator TagsRW TagsRW }
func (HandlerConstructor) New ¶
func (c HandlerConstructor) New() Handler
type ProfileLogic ¶
type UserLogic ¶
type UserLogic interface { UserCreate(username, email, password string) (user *domain.User, token string, err error) UserLogin(email, password string) (user *domain.User, token string, err error) UserGet(userName string) (user *domain.User, token string, err error) UserEdit(userName string, fieldsToUpdate map[domain.UserUpdatableProperty]*string) (user *domain.User, token string, err error) }
type UserValidator ¶
Source Files
¶
- HANDLER.go
- INTERACTOR.go
- articleDelete.go
- articleGet.go
- articlePost.go
- articlePut.go
- article_shared.go
- articlesFeed.go
- articlesRecent.go
- commentsDelete.go
- commentsGet.go
- commentsPost.go
- favoritesUpdate.go
- profileGet.go
- profileUpdateFollow.go
- shared.go
- tags.go
- userCreate.go
- userEdit.go
- userGet.go
- userLogin.go
Click to show internal directories.
Click to hide internal directories.