Documentation ¶
Index ¶
- Constants
- Variables
- func GenericSendMail(ctx *models.Context, to []string, msg []byte) (err error)
- func RegisterUser(ctx *models.Context, reg UserRegistration, userback iuser.UserBackend) (code string, err error)
- func RequestResetPassword(ctx *models.Context, user *User) error
- func ResetPassword(ctx *models.Context, user *User, code string, password string) error
- type ResetPasswordRequest
- type User
- func (u *User) GetEmail() string
- func (u *User) GetFullName() string
- func (u *User) GetId() int
- func (u *User) GetMobile() string
- func (u *User) GetName() string
- func (u *User) GetPasswordHash() []byte
- func (u *User) GetProfile() iuser.UserProfile
- func (u *User) GetPublicProfile() iuser.UserProfile
- func (u *User) GetSub() string
- func (u *User) SetBackend(b iuser.UserBackend)
- func (u *User) VerifyPassword(password []byte) bool
- type UserBack
- func (ub *UserBack) AuthPassword(sub, passwd string) (bool, error)
- func (ub *UserBack) AuthPasswordByFeature(feature, passwd string) (bool, iuser.User, error)
- func (ub *UserBack) CreateUser(user iuser.User, passwordHashed bool) error
- func (ub *UserBack) DeleteAllActivationCodes(ctx context.Context) error
- func (ub *UserBack) DeleteUser(user iuser.User) error
- func (ub *UserBack) GetUser(id int) (iuser.User, error)
- func (ub *UserBack) GetUserByEmail(email string) (iuser.User, error)
- func (ub *UserBack) GetUserByFeature(f string) (iuser.User, error)
- func (ub *UserBack) GetUserByName(name string) (iuser.User, error)
- func (ub *UserBack) InitDatabase()
- func (ub *UserBack) InitModel(ctx interface{})
- func (ub *UserBack) ListInactiveUsers(ctx context.Context) ([]UserRegistration, error)
- func (ub *UserBack) ListUsers(ctx context.Context) ([]iuser.User, error)
- func (ub *UserBack) Name() string
- func (ub *UserBack) SupportedVerificationMethods() []string
- func (ub *UserBack) UserIdToSub(id int) string
- func (ub *UserBack) UserSubToId(sub string) (int, error)
- type UserProfile
- type UserRegistration
Constants ¶
View Source
const (
// Use ./cmd/bcryptcost tool to find approriate cost
BCRYPT_COST = 11
)
View Source
const (
SSOREALMNAME = "sso-mysql"
)
Variables ¶
View Source
var ( ADMINEMAIL string ADMINPASSWD string )
View Source
var ( ErrUserExists = errors.New("User already exists") ErrCodeNotFound = errors.New("Code not found") )
Functions ¶
func GenericSendMail ¶
func RegisterUser ¶
func RegisterUser(ctx *models.Context, reg UserRegistration, userback iuser.UserBackend) (code string, err error)
Types ¶
type ResetPasswordRequest ¶
type User ¶
type User struct { Id int Name string FullName string Email sql.NullString PasswordHash []byte `db:"password"` Mobile sql.NullString Created string Updated string // contains filtered or unexported fields }
func ActivateUser ¶
func (*User) GetFullName ¶
func (*User) GetPasswordHash ¶
func (*User) GetProfile ¶
func (u *User) GetProfile() iuser.UserProfile
func (*User) GetPublicProfile ¶
func (u *User) GetPublicProfile() iuser.UserProfile
func (*User) SetBackend ¶
func (u *User) SetBackend(b iuser.UserBackend)
func (*User) VerifyPassword ¶
type UserBack ¶
func (*UserBack) AuthPasswordByFeature ¶
func (*UserBack) CreateUser ¶
func (*UserBack) DeleteAllActivationCodes ¶
func (*UserBack) GetUserByEmail ¶
func (*UserBack) GetUserByFeature ¶
func (*UserBack) InitDatabase ¶
func (ub *UserBack) InitDatabase()
func (*UserBack) ListInactiveUsers ¶
func (ub *UserBack) ListInactiveUsers(ctx context.Context) ([]UserRegistration, error)
func (*UserBack) SupportedVerificationMethods ¶
func (*UserBack) UserIdToSub ¶
type UserProfile ¶
type UserProfile struct { Name string `json:"name"` FullName string `json:"fullname"` Email string `json:"email"` Mobile string `json:"mobile"` }
func (*UserProfile) GetEmail ¶
func (p *UserProfile) GetEmail() string
func (*UserProfile) GetMobile ¶
func (p *UserProfile) GetMobile() string
func (*UserProfile) GetName ¶
func (p *UserProfile) GetName() string
type UserRegistration ¶
type UserRegistration struct { Id int Name string FullName string Email sql.NullString Password string Mobile sql.NullString ActivationCode string `db:"activation_code"` Created string }
Click to show internal directories.
Click to hide internal directories.