session

package
v2.2.0-preview.5.3.6+i... Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: CC0-1.0 Imports: 8 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 represents a StorageService internally

func NewSessionService

func NewSessionService(timeout time.Duration, store api.StorageService, log api.LogService) *Service

NewSessionService returns a SessionService

func (Service) GetAccountIfSessionIsValid

func (s Service) GetAccountIfSessionIsValid(sessionKey string) (api.Account, api.Session, error)

GetAccountIfSessionIsValid returns an Account if the session key is valid and an error otherwise

func (Service) UserDidAuthenticate

func (s Service) UserDidAuthenticate(accountID int, sessionIndex sql.NullString) (string, error)

UserDidAuthenticate returns a session key and an error if applicable

func (Service) UserDidLogout

func (s Service) UserDidLogout(sessionKey string) error

UserDidLogout attempts to end the session and returns an error on failure

Jump to

Keyboard shortcuts

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