session

package
v0.0.0-...-c938c57 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages sessions.

func NewManager

func NewManager(s Store) *Manager

NewManager creates a new session manager.

func (*Manager) Load

func (m *Manager) Load(c *gin.Context) (*Session, error)

Load fetches or creates the session from the request context.

func (*Manager) Refresh

func (m *Manager) Refresh(c *gin.Context) (*Session, error)

Refresh erases the current session and starts a blank one. A session should always exist, so it is replace instead of just being destroyed.

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session contains identifying information about the user.

func (*Session) Get

func (s *Session) Get(key string) (string, error)

Get fetches session data.

func (*Session) Set

func (s *Session) Set(key, value string) error

Set modifies session data.

type Store

type Store interface {
	// contains filtered or unexported methods
}

Store interface represents a two layer hash map.

func NewStore

func NewStore(addr, pass string) (Store, error)

NewStore creates a new session store backed by a redis client.

Jump to

Keyboard shortcuts

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