useraccount

package
v0.0.0-...-6f239a5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2021 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ModuleName = "account"

Functions

This section is empty.

Types

type InstalledUserAccount

type InstalledUserAccount struct {
	*UserAccount
	UserSystem *usersystem.UserSystem
}

func MustNewAndInstallTo

func MustNewAndInstallTo(s *usersystem.UserSystem) *InstalledUserAccount

func NewInstalledUserAccount

func NewInstalledUserAccount() *InstalledUserAccount

type Service

type Service interface {
	//Accounts return accounts of give uid.
	MustAccounts(uid string) *user.Accounts
	//AccountToUID query uid by user account.
	//Return user id.
	//Return empty string as userid if account not found.
	MustAccountToUID(account *user.Account) (uid string)
	//BindAccount bind account to user.
	//If account exists,user.ErrAccountBindingExists should be rasied.
	MustBindAccount(uid string, account *user.Account)
	//UnbindAccount unbind account from user.
	//If account not exists,user.ErrAccountUnbindingNotExists should be rasied.
	MustUnbindAccount(uid string, account *user.Account)
	//Start start service
	Start() error
	//Stop stop service
	Stop() error
	//Purge purge user data cache
	Purge(string) error
}

type UserAccount

type UserAccount struct {
	herbsystem.NopModule
	Service
}

func MustGetModule

func MustGetModule(s *usersystem.UserSystem) *UserAccount

func New

func New() *UserAccount

func (*UserAccount) InstallProcess

func (s *UserAccount) InstallProcess(ctx context.Context, system herbsystem.System, next func(context.Context, herbsystem.System))

func (*UserAccount) ModuleName

func (s *UserAccount) ModuleName() string

func (*UserAccount) StartService

func (s *UserAccount) StartService() error

func (*UserAccount) StopService

func (s *UserAccount) StopService() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL