Documentation ¶
Index ¶
- type DBStore
- func (s DBStore) Close() error
- func (s DBStore) CreateSession(accountID string, sessionKey string, expirationDuration time.Duration) error
- func (s DBStore) DeleteSession(sessionKey string) error
- func (s DBStore) ExtendAndFetchSession(sessionKey string, expirationDuration time.Duration) (domain.Session, error)
- func (s DBStore) FetchPossiblyExpiredSession(accountID string) (domain.Session, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBStore ¶
type DBStore struct {
// contains filtered or unexported fields
}
func NewDBStore ¶
func (DBStore) CreateSession ¶
func (s DBStore) CreateSession(accountID string, sessionKey string, expirationDuration time.Duration) error
CreateSession creates a new session. It errors if a valid session already exists.
func (DBStore) DeleteSession ¶
DeleteSession removes a session record from the db
func (DBStore) ExtendAndFetchSession ¶
func (s DBStore) ExtendAndFetchSession(sessionKey string, expirationDuration time.Duration) (domain.Session, error)
ExtendAndFetchSession fetches session data from the db On success it returns the session On failure, it can return ErrValidSessionNotFound, ErrSessionExpired, or an unexpected error
func (DBStore) FetchPossiblyExpiredSession ¶
FetchPossiblyExpiredSession returns a session row by account ID regardless of wether it is expired This is potentially dangerous, it is only intended to be used during the new login flow, never to check on a valid session for authentication purposes.
Click to show internal directories.
Click to hide internal directories.