models

package
v0.0.0-...-7f33b96 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	User         string
	Token        string
	Expire       time.Time
	Usergroups   []primitive.ObjectID
	NodeTokenMap map[primitive.ObjectID]string
}

Session stores the user data, the token, the expiration of the session and the usergroups of the current user

func RemoveEmptySessions

func RemoveEmptySessions(sessions []*Session) []*Session

RemoveEmptySessions removes nil objects from session slice

func (*Session) InitUserGroups

func (s *Session) InitUserGroups(db *mongo.Database, user string)

InitUserGroups preselects usergroups for the user (for performance reasons)

func (*Session) IsValid

func (s *Session) IsValid() bool

IsValid returns whether the current session is valid or not Username and Token must exist and should not be expired

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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