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) GetAllUsers() *Data
- func (u *Users) MustAccountToUID(account *user.Account) (uid string)
- func (u *Users) MustAccounts(uid string) *user.Accounts
- func (u *Users) MustBindAccount(uid string, account *user.Account)
- func (u *Users) MustCreateStatus(uid string)
- func (u *Users) MustCurrentTerm(uid string) string
- func (u *Users) MustGetProfile(id string) *profile.Profile
- func (u *Users) MustListUsersByStatus(last string, limit int, reverse bool, statuses ...status.Status) []string
- func (u *Users) MustLoadStatus(id string) (status.Status, bool)
- func (u *Users) MustRemoveStatus(uid string)
- func (u *Users) MustRoles(uid string) *role.Roles
- func (u *Users) MustStartNewTerm(uid string) string
- func (u *Users) MustUnbindAccount(uid string, account *user.Account)
- func (u *Users) MustUpdatePassword(uid string, password string)
- func (u *Users) MustUpdateProfile(id string, p *profile.Profile)
- func (u *Users) MustUpdateStatus(uid string, st status.Status)
- func (u *Users) MustVerifyPassword(uid string, password string) bool
- func (u *Users) PasswordChangeable() bool
- func (u *Users) Purge(uid string) error
- func (u *Users) SetRoles(uid string, r *role.Roles) error
- func (u *Users) Start() error
- func (u *Users) Stop() error
Constants ¶
This section is empty.
Variables ¶
View Source
var DirectiveFactory = func(loader func(v interface{}) error) (usersystem.Directive, error) { c := &Config{} err := loader(c) if err != nil { return nil, err } return c, nil }
Functions ¶
Types ¶
type Config ¶
type Config struct {
Source statictoml.Source
Example statictoml.Source
ProfileFields []string
ServePassword bool
ServeStatus bool
ServeAccounts bool
ServeRoles bool
ServeTerm bool
ServeProfile bool
HashMode string
}
func (*Config) Execute ¶
func (c *Config) Execute(s *usersystem.UserSystem) error
type User ¶
type Users ¶
type Users struct {
Source statictoml.Source
HashMode string
status.Service
ProfileFields map[string]bool
// contains filtered or unexported fields
}
func (*Users) GetAllUsers ¶
func (*Users) MustAccountToUID ¶
AccountToUID query uid by user account. Return user id . Return empty string as userid if account not found.
func (*Users) MustBindAccount ¶
BindAccount bind account to user. If account exists,user.ErrAccountBindingExists should be rasied.
func (*Users) MustCreateStatus ¶
func (*Users) MustCurrentTerm ¶
func (*Users) MustListUsersByStatus ¶
func (*Users) MustRemoveStatus ¶
func (*Users) MustStartNewTerm ¶
func (*Users) MustUnbindAccount ¶
UnbindAccount unbind account from user. If account not exists,user.ErrAccountUnbindingNotExists should be rasied.
func (*Users) MustUpdatePassword ¶
UpdatePassword update user password
func (*Users) MustVerifyPassword ¶
MustVerifyPassword Verify user password.
func (*Users) PasswordChangeable ¶
PasswordChangeable return password changeable
Click to show internal directories.
Click to hide internal directories.