Documentation ¶
Index ¶
- Variables
- func Flush()
- func Hash(mode string, password string, user *User) (string, error)
- type Config
- type Data
- type User
- type Users
- func (u *Users) AccountToUID(account *user.Account) (uid string, err error)
- func (u *Users) AccountToUIDOrRegister(account *user.Account) (uid string, registerd bool, err error)
- func (u *Users) Accounts(uid ...string) (*member.Accounts, error)
- func (u *Users) BindAccount(uid string, account *user.Account) error
- func (u *Users) PasswordChangeable() bool
- func (u *Users) Register(account *user.Account) (uid string, err error)
- func (u *Users) Roles(uid ...string) (*member.Roles, error)
- func (u *Users) SetStatus(uid string, status member.Status) error
- func (u *Users) Statuses(uid ...string) (member.StatusMap, error)
- func (u *Users) SupportedStatus() map[member.Status]bool
- func (u *Users) UnbindAccount(uid string, account *user.Account) error
- func (u *Users) UpdatePassword(uid string, password string) error
- func (u *Users) VerifyPassword(uid string, password string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Config ¶
type User ¶
type Users ¶
type Users struct { Source statictoml.Source HashMode string // contains filtered or unexported fields }
func (*Users) AccountToUID ¶
AccountToUID query uid by user account. Return user id and any error if raised. Return empty string as userid if account not found.
func (*Users) AccountToUIDOrRegister ¶
func (u *Users) AccountToUIDOrRegister(account *user.Account) (uid string, registerd bool, err error)
AccountToUIDOrRegister query uid by user account.Register user if account not found. Return user id and any error if raised.
func (*Users) Accounts ¶
Accounts return account map of given uid list. Return account map and any error if raised.
func (*Users) BindAccount ¶
BindAccount bind account to user. Return any error if raised. If account exists,user.ErrAccountBindingExists should be rasied.
func (*Users) PasswordChangeable ¶
PasswordChangeable return password changeable
func (*Users) Register ¶
Register create new user with given account. Return created user id and any error if raised. Privoder should return ErrAccountRegisterExists if account is used.
func (*Users) Roles ¶
Roles return role map of given uid list. Return role map and any error if raised.
func (*Users) Statuses ¶
Statuses return status map of given uid list. Return status map and any error if raised.
func (*Users) SupportedStatus ¶
SupportedStatus return supported status map
func (*Users) UnbindAccount ¶
UnbindAccount unbind account from user. Return any error if raised. If account not exists,user.ErrAccountUnbindingNotExists should be rasied.
func (*Users) UpdatePassword ¶
UpdatePassword update user password Return any error if raised