user service: initial implementation (#17668)
* conceptual user service: initial commit * reflect review comments * fix i18n issues and some tests * implement get user methods * add license * reflect review comments
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d320b50abb
Коммит
ac3bb2e811
31
services/users/errors.go
Обычный файл
31
services/users/errors.go
Обычный файл
@@ -0,0 +1,31 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
package users
|
||||
|
||||
import "errors"
|
||||
|
||||
var (
|
||||
AcceptedDomainError = errors.New("the email provided does not belong to an accepted domain")
|
||||
VerifyUserError = errors.New("could not update verify email field")
|
||||
UserCountError = errors.New("could not get the total number of the users.")
|
||||
)
|
||||
|
||||
// ErrInvalidPassword indicates an error against the password settings
|
||||
type ErrInvalidPassword struct {
|
||||
id string
|
||||
}
|
||||
|
||||
func NewErrInvalidPassword(id string) *ErrInvalidPassword {
|
||||
return &ErrInvalidPassword{
|
||||
id: id,
|
||||
}
|
||||
}
|
||||
|
||||
func (e *ErrInvalidPassword) Error() string {
|
||||
return "invalid password"
|
||||
}
|
||||
|
||||
func (e *ErrInvalidPassword) Id() string {
|
||||
return e.id
|
||||
}
|
||||
Ссылка в новой задаче
Block a user