userstatus

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: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ModuleName = "status"

Functions

This section is empty.

Types

type InstalledUserStatus

type InstalledUserStatus struct {
	*UserStatus
	UserSystem *usersystem.UserSystem
}

func MustNewAndInstallTo

func MustNewAndInstallTo(s *usersystem.UserSystem) *InstalledUserStatus

func NewInstalledUserStatus

func NewInstalledUserStatus() *InstalledUserStatus

type Service

type Service interface {
	//MustLoadStatus load user status
	//Return uid status and exists
	//Status.StatusUnkown and false will be retruned if user not exists
	MustLoadStatus(string) (status.Status, bool)
	//MustUpdateStatus update user status.
	MustUpdateStatus(string, status.Status)
	//MustCreateStatus create user status.
	MustCreateStatus(string)
	//MustRemoveStatus remove user status
	MustRemoveStatus(string)
	//MustRemoveStatus list user by status
	MustListUsersByStatus(last string, limit int, reverse bool, statuses ...status.Status) []string
	status.Service
	//Start start service
	Start() error
	//Stop stop service
	Stop() error
	//Purge purge user data cache
	Purge(string) error
}

type UserStatus

type UserStatus struct {
	herbsystem.NopModule
	Service
}

func MustGetModule

func MustGetModule(s *usersystem.UserSystem) *UserStatus

func New

func New() *UserStatus

func (*UserStatus) InstallProcess

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

func (*UserStatus) ModuleName

func (s *UserStatus) ModuleName() string

func (*UserStatus) MustCheckSession

func (s *UserStatus) MustCheckSession(ctx context.Context, session *usersystem.Session) bool

func (*UserStatus) MustIsUserAvaliable

func (s *UserStatus) MustIsUserAvaliable(id string) bool

func (*UserStatus) StartService

func (s *UserStatus) StartService() error

func (*UserStatus) StopService

func (s *UserStatus) StopService() error

Jump to

Keyboard shortcuts

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