Documentation
¶
Index ¶
- Variables
- type Account
- func (a *Account) MustAccounts(uid string) *user.Accounts
- func (a *Account) MustBindAccount(uid string, account *user.Account)
- func (a *Account) MustUnbindAccount(uid string, account *user.Account)
- func (a *Account) Purge(uid string) error
- func (a *Account) Start() error
- func (a *Account) Stop() error
- type Cache
- func (c *Cache) CreateAccount(service useraccount.Service, preset *cachepreset.Preset) (*Account, error)
- func (c *Cache) CreateProfile(service userprofile.Service, preset *cachepreset.Preset) (*Profile, error)
- func (c *Cache) CreateRole(service userrole.Service, preset *cachepreset.Preset) (*Role, error)
- func (c *Cache) CreateStatus(service userstatus.Service, preset *cachepreset.Preset) (*Status, error)
- func (c *Cache) CreateTerm(service userterm.Service, preset *cachepreset.Preset) (*Term, error)
- func (c *Cache) Execute(s *usersystem.UserSystem) error
- func (c *Cache) Start() error
- func (c *Cache) Stop() error
- type Config
- type Profile
- type Role
- type Status
- type Term
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 }
View Source
var ErrUserAccountServiceNotInstalled = errors.New("usercache:user account service not installed")
View Source
var ErrUserRoleServiceNotInstalled = errors.New("usercache:user role service not installed")
View Source
var ErrUserStatusServiceNotInstalled = errors.New("usercache:user status service not installed")
View Source
var ErrUserTermServiceNotInstalled = errors.New("usercache:user term service not installed")
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
Cache *Cache
useraccount.Service
Preset *cachepreset.Preset
}
func (*Account) MustAccounts ¶
Accounts return accounts of give uid.
func (*Account) MustBindAccount ¶
BindAccount bind account to user. If account exists,user.ErrAccountBindingExists should be rasied.
func (*Account) MustUnbindAccount ¶
UnbindAccount unbind account from user. If account not exists,user.ErrAccountUnbindingNotExists should be rasied.
type Cache ¶
type Cache struct {
Stroage *herbcache.Storage
Preset *cachepreset.Preset
PrefixStatus string
PrefixAccount string
PrefixTerm string
PrefixRole string
PrefixProfile string
// contains filtered or unexported fields
}
func (*Cache) CreateAccount ¶
func (c *Cache) CreateAccount(service useraccount.Service, preset *cachepreset.Preset) (*Account, error)
func (*Cache) CreateProfile ¶
func (c *Cache) CreateProfile(service userprofile.Service, preset *cachepreset.Preset) (*Profile, error)
func (*Cache) CreateRole ¶
func (*Cache) CreateStatus ¶
func (c *Cache) CreateStatus(service userstatus.Service, preset *cachepreset.Preset) (*Status, error)
func (*Cache) CreateTerm ¶
func (*Cache) Execute ¶
func (c *Cache) Execute(s *usersystem.UserSystem) error
type Config ¶
type Config struct {
Cache *cacheconfig.Config
PrefixStatus string
PrefixTerm string
PrefixAccount string
PrefixRole string
PrefixProfile string
}
func (*Config) Execute ¶
func (c *Config) Execute(s *usersystem.UserSystem) error
type Profile ¶
type Profile struct {
Cache *Cache
userprofile.Service
Preset *cachepreset.Preset
}
func (*Profile) MustUpdateProfile ¶
type Status ¶
type Status struct {
Cache *Cache
userstatus.Service
Preset *cachepreset.Preset
}
func (*Status) MustRemoveStatus ¶
MustRemoveStatus remove user status
func (*Status) MustUpdateStatus ¶
MustUpdateStatus update user status.
type Term ¶
type Term struct {
Cache *Cache
userterm.Service
Preset *cachepreset.Preset
}
func (*Term) MustCurrentTerm ¶
func (*Term) MustStartNewTerm ¶
Click to show internal directories.
Click to hide internal directories.