sessions

package
v0.0.0-...-a23bd61 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const TIMEOUT = 3600

Session timeout in seconds. Default 1 hour.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	Id         string
	User       core.User
	RemoteAddr string

	Other map[string]interface{}
	// contains filtered or unexported fields
}

func NewSession

func NewSession() *Session

func (*Session) GetExpires

func (s *Session) GetExpires() time.Time

func (*Session) String

func (s *Session) String() string

func (*Session) UpdateExpires

func (s *Session) UpdateExpires(newExpire time.Time)

func (*Session) Username

func (s *Session) Username() string

type SessionStore

type SessionStore struct {
	Header string
	// contains filtered or unexported fields
}

func NewSessionStore

func NewSessionStore() *SessionStore

func (*SessionStore) Delete

func (s *SessionStore) Delete(session *Session)

func (*SessionStore) DeleteById

func (s *SessionStore) DeleteById(id string)

func (*SessionStore) FindSession

func (s *SessionStore) FindSession(r *http.Request) *Session

func (*SessionStore) GenerateID

func (s *SessionStore) GenerateID() string

func (*SessionStore) Get

func (s *SessionStore) Get(id string) *Session

func (*SessionStore) NewSession

func (s *SessionStore) NewSession() *Session

NewSession creates a new session with a session ID. It DOES NOT add the session to the session store.

func (*SessionStore) Put

func (s *SessionStore) Put(session *Session)

func (*SessionStore) Reap

func (s *SessionStore) Reap()

Reap will remove expired sessions.

Jump to

Keyboard shortcuts

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