session

package
v0.0.0-...-813a201 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2015 License: MPL-2.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 Service

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

Service wraps session functionality

func NewService

func NewService(cnf *config.Config, r *http.Request, w http.ResponseWriter) *Service

NewService starts a new Service instance

func (*Service) ClearUserSession

func (s *Service) ClearUserSession() error

ClearUserSession deletes the user session

func (*Service) GetFlashMessage

func (s *Service) GetFlashMessage() interface{}

GetFlashMessage returns the first flash message

func (*Service) GetUserSession

func (s *Service) GetUserSession() (*UserSession, error)

GetUserSession returns the user session

func (*Service) SetFlashMessage

func (s *Service) SetFlashMessage(msg string)

SetFlashMessage sets a flash message, useful for displaying an error after 302 redirection

func (*Service) SetUserSession

func (s *Service) SetUserSession(userSession *UserSession) error

SetUserSession saves the user session

func (*Service) StartUserSession

func (s *Service) StartUserSession() error

StartUserSession starts a new user session

type UserSession

type UserSession struct {
	ClientID     string
	Username     string
	AccessToken  string
	RefreshToken string
}

UserSession has user data stored in a session after logging in

Jump to

Keyboard shortcuts

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