redisactives

package
v0.0.0-...-be25ffa Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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

This section is empty.

Types

type Config

type Config struct {
	redispool.Config
	Interval  int64
	Prefix    string
	Durations map[string]string
}

func (*Config) CreateService

func (c *Config) CreateService() (*Service, error)

func (*Config) Execute

func (c *Config) Execute(us *usersystem.UserSystem) error

type Service

type Service struct {
	Pool     *redis.Pool
	Prefix   string
	Interval int64
	// contains filtered or unexported fields
}

func NewService

func NewService() *Service

func (*Service) Execute

func (s *Service) Execute(us *usersystem.UserSystem) error

func (*Service) MustConfig

func (s *Service) MustConfig(st usersystem.SessionType) *activesessions.Config

func (*Service) MustCreateSerialNumber

func (s *Service) MustCreateSerialNumber() string

func (*Service) MustGetActiveSessions

func (s *Service) MustGetActiveSessions(st usersystem.SessionType, uid string) []*activesessions.Active

func (*Service) MustOnSessionActive

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

func (*Service) MustPurgeActiveSession

func (s *Service) MustPurgeActiveSession(st usersystem.SessionType, uid string, serialnumber string)

func (*Service) Start

func (s *Service) Start() error

func (*Service) Stop

func (s *Service) Stop() error

Jump to

Keyboard shortcuts

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