Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMsgDuplicateArticleSlug = "duplicate article slug \"%v\"" ErrMsgDuplicateArticleUuid = "duplicate article uuid %v" ErrMsgArticleSlugNotFound = "article slug \"%v\" not found" ErrMsgArticleNotFound = "article not found for Id %v" ErrMsgArticleCreateMissingFields = "article has missing fields for Create operation" ErrMsgArticleAlreadyFavorited = "article with ID \"%v\" has already been favoriated" ErrMsgArticleWasNotFavorited = "article with ID \"%v\" was not favorited" ErrMsgCommentNotFound = "comment not found because comment ID not valid or user did not author the article" ErrMsgProfileNotFound = "profile not found" ErrMsgTagNameAlreadyExists = "tag name %v already exists" ErrMsgTagOnArticleAlreadyExists = "tag with name %v already exists on article with slug %v" ErrMsgUserEmailNotFound = "user not found for email %v" ErrMsgUsernameOrEmailDuplicate = "user with name \"%v\" or email \"%v\" already exists" ErrMsgUsernameDuplicate = "user with name \"%v\" already exists" ErrMsgUsernameNotFound = "user not found for username \"%v\"" ErrMsgUserAlreadyFollowed = "user with username \"%v\" was already followed" ErrMsgUserWasNotFollowed = "user with username \"%v\" was not followed" ErrMsgAuthenticationFailed = "user authentication failed with name \"%v\" and password \"%v\"" ErrMsgNotAuthenticated = "user not authenticated" ErrMsgDuplicateUserEmail = "user with email %v already exists" )
View Source
var ( ErrAuthenticationFailed = errx.NewKind("ErrAuthenticationFailed") ErrValidationFailed = errx.NewKind("ErrValidationFailed") )
Functions ¶
This section is empty.
Types ¶
type ArticleCheckOwnerBfT ¶
type ArticleCheckOwnerBfT = func(article model.ArticlePlus, username string) error
var ArticleCheckOwnerBf ArticleCheckOwnerBfT = func(article model.ArticlePlus, username string) error { if article.Author.Username != username { return ErrUnauthorizedUser.Make(nil, ErrMsgUnauthorizedUser, username) } return nil }
type UserAuthenticateBfT ¶
var UserAuthenticateBf UserAuthenticateBfT = func( user model.User, password string, ) bool { return crypto.ArgonPasswordCheck(password, user.PasswordHash) }
type UserGenTokenBfT ¶
func UserGenTokenEcdsaBfC ¶
func UserGenTokenEcdsaBfC( cfgSrc UserGenTokenEcdsaBfCfgSrc, ) UserGenTokenBfT
func UserGenTokenHmacBfC ¶
func UserGenTokenHmacBfC( cfgSrc UserGenTokenHmacBfCfgSrc, ) UserGenTokenBfT
type UserGenTokenEcdsaBfCfgSrc ¶
type UserGenTokenEcdsaBfCfgSrc = func() ( privateKey ecdsa.PrivateKey, tokenTimeToLive time.Duration, )
Click to show internal directories.
Click to hide internal directories.