session

package
v0.0.0-...-1599866 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: GPL-3.0 Imports: 2 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 {
	// contains filtered or unexported fields
}

Session represents a login session with user id, and many timestamps

func NewSession

func NewSession(timeout int64, user string) *Session

NewSession returns a new Session struct

func (*Session) GetUserID

func (s *Session) GetUserID() string

GetUserID returns the user id of the session

func (*Session) IsValid

func (s *Session) IsValid() bool

IsValid returns whether a Session is still valid

func (*Session) Use

func (s *Session) Use() error

Use saves the current timestamp to the Session´s lastuse timestamp

Jump to

Keyboard shortcuts

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