session

package
v0.0.0-...-ca0f7d1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSessionNotFound   = errors.New("session not found")
	ErrNoSessionsUpdated = errors.New("sessions with sent params are not updated")
)

Functions

This section is empty.

Types

type MockService

type MockService struct {
	mock.Mock
}

MockService is an autogenerated mock type for the Service type

func (*MockService) CreateSession

func (_m *MockService) CreateSession(accountID uuid.UUID, identityID uuid.UUID, clientID models.ClientID, tx *sql.Tx) (*models.Session, error)

CreateSession provides a mock function with given fields: accountID, identityID, clientID, tx

func (*MockService) DeleteAllSessionsByAccountID

func (_m *MockService) DeleteAllSessionsByAccountID(accountID uuid.UUID, tx *sql.Tx) error

DeleteAllSessionsByAccountID provides a mock function with given fields: accountID, tx

func (*MockService) DeleteExpiredSessions

func (_m *MockService) DeleteExpiredSessions() error

DeleteExpiredSessions provides a mock function with given fields:

func (*MockService) DeleteSessionBySessionID

func (_m *MockService) DeleteSessionBySessionID(sessionID uuid.UUID) error

DeleteSessionBySessionID provides a mock function with given fields: sessionID

func (*MockService) GetSessionByAccessToken

func (_m *MockService) GetSessionByAccessToken(accessToken uuid.UUID) (*models.Session, error)

GetSessionByAccessToken provides a mock function with given fields: accessToken

func (*MockService) RefreshSession

func (_m *MockService) RefreshSession(refreshToken uuid.UUID) (*models.Session, error)

RefreshSession provides a mock function with given fields: refreshToken

type Repository

type Repository interface {
	CreateSession(executor database.QueryExecutor, session models.Session) error
	UpdateSessionByRefreshToken(
		executor database.QueryExecutor,
		refreshToken uuid.UUID,
		accessTokenExpiresDate, refreshTokenExpiresDate time.Time,
	) (*models.Session, error)
	DeleteAllSessionsByAccountID(executor database.QueryExecutor, accountID uuid.UUID) error
	DeleteSessionBySessionID(executor database.QueryExecutor, sessionID uuid.UUID) error
	GetSessionByAccessToken(executor database.QueryExecutor, accessToken uuid.UUID) (*models.Session, error)
	DeleteExpiredSessions(executor database.QueryExecutor) error
}

type Service

type Service interface {
	GetSessionByAccessToken(executor database.QueryExecutor, accessToken uuid.UUID) (*models.Session, error)
	CreateSession(
		executor database.QueryExecutor,
		accountID, identityID uuid.UUID,
		clientID models.ClientID,
	) (*models.Session, error)
	DeleteAllSessionsByAccountID(executor database.QueryExecutor, accountID uuid.UUID) error
	DeleteSessionBySessionID(executor database.QueryExecutor, sessionID uuid.UUID) error
	DeleteExpiredSessions(executor database.QueryExecutor) error
	RefreshSession(executor database.QueryExecutor, refreshToken uuid.UUID) (*models.Session, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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