Documentation ¶
Index ¶
- Variables
- type Service
- func (s *Service) ClearUserSession() error
- func (s *Service) GetFlashMessage() (interface{}, error)
- func (s *Service) GetUserSession() (*UserSession, error)
- func (s *Service) SetFlashMessage(msg string) error
- func (s *Service) SetUserSession(userSession *UserSession) error
- func (s *Service) StartSession() error
- type ServiceInterface
- type UserSession
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // StorageSessionName ... StorageSessionName = "go_oauth2_server_session" // UserSessionKey ... UserSessionKey = "go_oauth2_server_user" // ErrSessonNotStarted ... ErrSessonNotStarted = errors.New("Session not started") )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service wraps session functionality
func NewService ¶
NewService starts a new Service instance
func (*Service) ClearUserSession ¶
ClearUserSession deletes the user session
func (*Service) GetFlashMessage ¶
GetFlashMessage returns the first flash message
func (*Service) GetUserSession ¶
func (s *Service) GetUserSession() (*UserSession, error)
GetUserSession returns the user session
func (*Service) SetFlashMessage ¶
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) StartSession ¶
StartSession starts a new session. This method must be called before other public methods of this struct as it sets the internal session object
type ServiceInterface ¶
type ServiceInterface interface { StartSession() error GetUserSession() (*UserSession, error) SetUserSession(userSession *UserSession) error ClearUserSession() error SetFlashMessage(msg string) error GetFlashMessage() (interface{}, error) }
ServiceInterface defines exported methods
Click to show internal directories.
Click to hide internal directories.