activesessions

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: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ModuleName = "activesessionsmanager"
View Source
var PayloadSerialNumber = "sessionSerialNumber"

Functions

func MustGetSerialNumber

func MustGetSerialNumber(s *usersystem.Session) string

Types

type Active

type Active struct {
	SessionID  string
	LastActive time.Time
}

type ActiveSessions

type ActiveSessions struct {
	herbsystem.NopModule
	Service
}

func MustGetModule

func MustGetModule(s *usersystem.UserSystem) *ActiveSessions

func New

func New() *ActiveSessions

func (*ActiveSessions) InstallProcess

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

func (*ActiveSessions) ModuleName

func (s *ActiveSessions) ModuleName() string

func (*ActiveSessions) MustOnSessionActive

func (s *ActiveSessions) MustOnSessionActive(session *usersystem.Session)

func (*ActiveSessions) StartService

func (s *ActiveSessions) StartService() error

func (*ActiveSessions) StopService

func (s *ActiveSessions) StopService() error

type Config

type Config struct {
	Supported bool
	Duration  time.Duration
}

type InstalledAcitveSessions

type InstalledAcitveSessions struct {
	*ActiveSessions
	UserSystem *usersystem.UserSystem
}

func NewInstalledAcitveSessions

func NewInstalledAcitveSessions() *InstalledAcitveSessions

func (*InstalledAcitveSessions) MustPurgeActiveSession

func (s *InstalledAcitveSessions) MustPurgeActiveSession(session *usersystem.Session)

type Service

type Service interface {
	MustConfig(st usersystem.SessionType) *Config
	MustOnSessionActive(session *usersystem.Session)
	MustGetActiveSessions(usersystem.SessionType, string) []*Active
	MustPurgeActiveSession(st usersystem.SessionType, uid string, serialnumber string)
	MustCreateSerialNumber() string
	Start() error
	Stop() error
}

Jump to

Keyboard shortcuts

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